summaryrefslogtreecommitdiffstats
path: root/tests/auto/tools/qmake/testcompiler.cpp
diff options
context:
space:
mode:
authorRafael Roquetto <rafael.roquetto@kdab.com>2012-08-10 17:21:30 +0200
committerQt by Nokia <qt-info@nokia.com>2012-09-04 10:30:33 +0200
commit3d4fc578bd5cc0b6d39d16638aa6f3577eb31f69 (patch)
treedeb4fa0473e37de48a6a299a0f9a6b65aea29f47 /tests/auto/tools/qmake/testcompiler.cpp
parent53d0829aa1552dd1c7d5da008ec4b1a4052a7e5a (diff)
Auto test for 'qmake -project' use case.
Change-Id: Ifb6d64828ba1cb42fd64299438b7eec302112edf Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'tests/auto/tools/qmake/testcompiler.cpp')
-rw-r--r--tests/auto/tools/qmake/testcompiler.cpp36
1 files changed, 32 insertions, 4 deletions
diff --git a/tests/auto/tools/qmake/testcompiler.cpp b/tests/auto/tools/qmake/testcompiler.cpp
index 3b77b1ec63..223f212141 100644
--- a/tests/auto/tools/qmake/testcompiler.cpp
+++ b/tests/auto/tools/qmake/testcompiler.cpp
@@ -244,6 +244,22 @@ bool TestCompiler::makeDistClean( const QString &workPath )
}
+bool TestCompiler::qmakeProject( const QString &workDir, const QString &proName )
+{
+ QDir D;
+ if (!D.exists(workDir)) {
+ testOutput_.append( "Directory '" + workDir + "' doesn't exist" );
+ return errorOut();
+ }
+ D.setCurrent(workDir);
+
+ QString projectFile = proName;
+ if (!projectFile.endsWith(".pro"))
+ projectFile += ".pro";
+
+ return runCommand(qmakeCmd_ + " -project -o " + projectFile + " DESTDIR=./");
+}
+
bool TestCompiler::qmake( const QString &workDir, const QString &proName, const QString &buildDir )
{
QDir D;
@@ -286,12 +302,24 @@ bool TestCompiler::exists( const QString &destDir, const QString &exeName, Build
bool TestCompiler::removeMakefile( const QString &workPath )
{
+ return removeFile( workPath, "Makefile" );
+}
+
+bool TestCompiler::removeProject( const QString &workPath, const QString &project )
+{
+ QString projectFile = project;
+ if (!projectFile.endsWith(".pro"))
+ projectFile += ".pro";
+
+ return removeFile( workPath, projectFile );
+}
+
+bool TestCompiler::removeFile( const QString &workPath, const QString &fileName )
+{
QDir D;
D.setCurrent( workPath );
- if ( D.exists( "Makefile" ) )
- return D.remove( "Makefile" );
- else
- return true;
+
+ return ( D.exists( fileName ) ) ? D.remove( fileName ) : true;
}
QString TestCompiler::commandOutput() const