tests/auto/qmake/tst_qmake.cpp
changeset 37 758a864f9613
parent 33 3e2da88830cd
--- a/tests/auto/qmake/tst_qmake.cpp	Fri Sep 17 08:34:18 2010 +0300
+++ b/tests/auto/qmake/tst_qmake.cpp	Mon Oct 04 01:19:32 2010 +0300
@@ -90,6 +90,7 @@
     void bundle_spaces();
 #endif
     void includefunction();
+    void substitutes();
 
 private:
     TestCompiler test_compiler;
@@ -98,7 +99,8 @@
 
 tst_qmake::tst_qmake()
 {
-    QString cmd = QString("qmake \"QT_VERSION=%1\"").arg(QT_VERSION);
+    QString binpath = QLibraryInfo::location(QLibraryInfo::BinariesPath);
+    QString cmd = QString("%2/qmake \"QT_VERSION=%1\"").arg(QT_VERSION).arg(binpath);
 #ifdef Q_CC_MSVC
     test_compiler.setBaseCommands( "nmake", cmd );
 #elif defined(Q_CC_MINGW)
@@ -477,6 +479,23 @@
     QVERIFY(test_compiler.commandOutput().contains(warningMsg));
 }
 
+void tst_qmake::substitutes()
+{
+    QString workDir = base_path + "/testdata/substitutes";
+    QVERIFY( test_compiler.qmake( workDir, "test" ));
+    QVERIFY( test_compiler.exists( workDir, "test", Plain, "" ));
+    QVERIFY( test_compiler.exists( workDir, "sub/test2", Plain, "" ));
+    QVERIFY( test_compiler.exists( workDir, "sub/indirect_test.txt", Plain, "" ));
+    QVERIFY( test_compiler.makeDistClean( workDir ));
+
+    QString buildDir = base_path + "/testdata/substitutes_build";
+    QVERIFY( test_compiler.qmake( workDir, "test", buildDir ));
+    QVERIFY( test_compiler.exists( buildDir, "test", Plain, "" ));
+    QVERIFY( test_compiler.exists( buildDir, "sub/test2", Plain, "" ));
+    QVERIFY( test_compiler.exists( buildDir, "sub/indirect_test.txt", Plain, "" ));
+    QVERIFY( test_compiler.makeDistClean( buildDir ));
+}
+
 QTEST_MAIN(tst_qmake)
 #include "tst_qmake.moc"