From 77ddb00a49fdde54df2b232e9e901a08e48cee6d Mon Sep 17 00:00:00 2001 From: Kurt Korbatits Date: Wed, 4 Jan 2012 12:28:20 +1000 Subject: Changed tests: qmake,selftest and lancelot to use QFINDTESTDATA. Changed these tests to use QFINDTESTDATA macro to detect location of testdata. Checking for a specific file contained in the testdata so as not to be confused by empty directories created during configure. Change-Id: Iac2ac6304b6b9ac79e00886025b93ec0af5a8507 Reviewed-by: Jason McDonald Reviewed-by: Rohan McGovern --- tests/auto/tools/qmake/tst_qmake.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'tests/auto/tools/qmake/tst_qmake.cpp') 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() -- cgit v1.2.3