diff options
Diffstat (limited to 'tests/auto/tools/qmake/tst_qmake.cpp')
-rw-r--r-- | tests/auto/tools/qmake/tst_qmake.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/auto/tools/qmake/tst_qmake.cpp b/tests/auto/tools/qmake/tst_qmake.cpp index dbb845ba81..6e1562e2ca 100644 --- a/tests/auto/tools/qmake/tst_qmake.cpp +++ b/tests/auto/tools/qmake/tst_qmake.cpp @@ -118,8 +118,13 @@ void tst_qmake::initTestCase() #else test_compiler.setBaseCommands( "make", cmd ); #endif - QString tmpFile = QFINDTESTDATA("testdata"); - base_path = tmpFile.left(tmpFile.lastIndexOf('/')); + //Detect the location of the testdata + QString subProgram = QLatin1String("testdata/simple_app/main.cpp"); + base_path = QFINDTESTDATA(subProgram); + if (base_path.lastIndexOf(subProgram) > 0) + base_path = base_path.left(base_path.lastIndexOf(subProgram)); + else + base_path = QCoreApplication::applicationDirPath(); } void tst_qmake::cleanupTestCase() |