Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
flatpak-qt-creator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
846e4d3d
Commit
846e4d3d
authored
Mar 02, 2011
by
Oswald Buddenhagen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix ProWriter test
finally ...
parent
2d8967d0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
11 deletions
+29
-11
tests/auto/auto.pro
tests/auto/auto.pro
+1
-1
tests/auto/profilewriter/profilewriter.pro
tests/auto/profilewriter/profilewriter.pro
+1
-0
tests/auto/profilewriter/tst_profilewriter.cpp
tests/auto/profilewriter/tst_profilewriter.cpp
+27
-10
No files found.
tests/auto/auto.pro
View file @
846e4d3d
...
...
@@ -10,7 +10,7 @@ SUBDIRS += \
fakevim
\
generichighlighter
\
#
icheckbuild
\
#
profilewriter
\
profilewriter
\
ioutils
\
qtcprocess
\
utils_stringutils
\
...
...
tests/auto/profilewriter/profilewriter.pro
View file @
846e4d3d
include
(..
/
qttest
.
pri
)
include
(..
/../../
src
/
shared
/
proparser
/
proparser
.
pri
)
SOURCES
+=
\
...
...
tests/auto/profilewriter/tst_profilewriter.cpp
View file @
846e4d3d
...
...
@@ -31,14 +31,33 @@
**
**************************************************************************/
#include
"profileevaluator.h"
#include
"prowriter.h"
#include
<profileparser.h>
#include
<prowriter.h>
#include <QtTest/QtTest>
//#include <QtCore/QSet>
#define BASE_DIR "/some/stuff"
///////////// callbacks for parser/evaluator
static
void
print
(
const
QString
&
fileName
,
int
lineNo
,
const
QString
&
msg
)
{
if
(
lineNo
)
qWarning
(
"%s(%d): %s"
,
qPrintable
(
fileName
),
lineNo
,
qPrintable
(
msg
));
else
qWarning
(
"%s"
,
qPrintable
(
msg
));
}
class
ParseHandler
:
public
ProFileParserHandler
{
public:
virtual
void
parseError
(
const
QString
&
fileName
,
int
lineNo
,
const
QString
&
msg
)
{
print
(
fileName
,
lineNo
,
msg
);
}
};
static
ParseHandler
parseHandler
;
//////////////// the actual autotest
class
tst_ProFileWriter
:
public
QObject
{
Q_OBJECT
...
...
@@ -259,12 +278,11 @@ void tst_ProFileWriter::edit()
QStringList
lines
=
input
.
split
(
QLatin1String
(
"
\n
"
));
QStringList
vars
;
vars
<<
QLatin1String
(
"SOURCES"
);
ProFileOption
option
;
ProFileEvaluator
reader
(
&
option
);
ProFile
*
proFile
=
reader
.
parsedProFile
(
BASE_DIR
"/test.pro"
,
input
);
ProFileParser
parser
(
0
,
&
parseHandler
);
ProFile
*
proFile
=
parser
.
parsedProFile
(
QLatin1String
(
BASE_DIR
"/test.pro"
),
false
,
&
input
);
QVERIFY
(
proFile
);
if
(
add
)
Qt4ProjectManager
::
Internal
::
ProWriter
::
addFiles
(
proFile
,
&
lines
,
baseDir
,
files
,
vars
);
Qt4ProjectManager
::
Internal
::
ProWriter
::
addFiles
(
proFile
,
&
lines
,
baseDir
,
files
,
vars
.
at
(
0
)
);
else
Qt4ProjectManager
::
Internal
::
ProWriter
::
removeFiles
(
proFile
,
&
lines
,
baseDir
,
files
,
vars
);
...
...
@@ -290,9 +308,8 @@ void tst_ProFileWriter::multiVar()
<<
QString
::
fromLatin1
(
BASE_DIR
"/bak"
);
QStringList
vars
;
vars
<<
QLatin1String
(
"SOURCES"
)
<<
QLatin1String
(
"HEADERS"
);
ProFileOption
option
;
ProFileEvaluator
reader
(
&
option
);
ProFile
*
proFile
=
reader
.
parsedProFile
(
BASE_DIR
"/test.pro"
,
input
);
ProFileParser
parser
(
0
,
&
parseHandler
);
ProFile
*
proFile
=
parser
.
parsedProFile
(
QLatin1String
(
BASE_DIR
"/test.pro"
),
false
,
&
input
);
QVERIFY
(
proFile
);
Qt4ProjectManager
::
Internal
::
ProWriter
::
removeFiles
(
proFile
,
&
lines
,
baseDir
,
files
,
vars
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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