Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
27f86668
Commit
27f86668
authored
Dec 03, 2008
by
Roberto Raggi
Browse files
Added a simple auto test for our C++ front-end.
parent
56f788cc
Changes
4
Hide whitespace changes
Inline
Side-by-side
tests/manual/cplusplus/c++
0 → 100755
View file @
27f86668
#!/bin/sh
me
=
$(
dirname
$0
)
${
CPP
-gcc
}
-xc
++
-E
-include
$me
/conf.c++
$*
|
$me
/cplusplus0
tests/manual/cplusplus/conf.c++
0 → 100644
View file @
27f86668
#define __extension__
#define __context__
#define __range__
#define __asm(a...)
#define __asm__(a...)
#define restrict
#define __restrict
tests/manual/cplusplus/cplusplus.pro
0 → 100644
View file @
27f86668
QT
=
core
macx
:
CONFIG
-=
app_bundle
TARGET
=
cplusplus0
include
(..
/../../
shared
/
cplusplus
/
cplusplus
.
pri
)
#
Input
SOURCES
+=
main
.
cpp
unix
{
debug
:
OBJECTS_DIR
=
$$
{
OUT_PWD
}
/.
obj
/
debug
-
shared
release
:
OBJECTS_DIR
=
$$
{
OUT_PWD
}
/.
obj
/
release
-
shared
debug
:
MOC_DIR
=
$$
{
OUT_PWD
}
/.
moc
/
debug
-
shared
release
:
MOC_DIR
=
$$
{
OUT_PWD
}
/.
moc
/
release
-
shared
RCC_DIR
=
$$
{
OUT_PWD
}
/.
rcc
/
UI_DIR
=
$$
{
OUT_PWD
}
/.
uic
/
}
tests/manual/cplusplus/main.cpp
0 → 100644
View file @
27f86668
#include
<QFile>
#include
<cstdio>
#include
<cstdlib>
#include
<TranslationUnit.h>
#include
<Control.h>
#include
<AST.h>
#include
<Semantic.h>
#include
<Scope.h>
int
main
(
int
,
char
*
[])
{
Control
control
;
StringLiteral
*
fileId
=
control
.
findOrInsertFileName
(
"<stdin>"
);
QFile
in
;
if
(
!
in
.
open
(
stdin
,
QFile
::
ReadOnly
))
return
EXIT_FAILURE
;
const
QByteArray
source
=
in
.
readAll
();
TranslationUnit
unit
(
&
control
,
fileId
);
unit
.
setSource
(
source
.
constData
(),
source
.
size
());
unit
.
parse
();
if
(
TranslationUnitAST
*
ast
=
unit
.
ast
())
{
Scope
globalScope
;
Semantic
sem
(
&
control
);
for
(
DeclarationAST
*
decl
=
ast
->
declarations
;
decl
;
decl
=
decl
->
next
)
{
sem
.
check
(
decl
,
&
globalScope
);
}
}
return
EXIT_SUCCESS
;
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment