diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2012-01-11 15:40:24 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-12 06:41:10 +0100 |
commit | d3f6faedb5bb02accca3c3ae5f81530e5d60b39a (patch) | |
tree | d84e7cd3c400138de54009f24e6c93e2c0c33ae9 /tests | |
parent | fa699c8f96c8dbc92d68334d3168f817e3aa93ce (diff) |
Fixed findtestdata selftest on mac
This test relies on being able to set a custom QLibraryInfo::PrefixPath
for the duration of the test. However, the test code neglected to
account for the following behavior on mac (from "Using qt.conf"
documentation):
On Mac OS X, the Prefix is relative to the Contents in the application
bundle.
Change-Id: Ie9b6d5ebfe8af7d7f332e827069b60a830d6c6f2
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/testlib/selftests/findtestdata/findtestdata.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/auto/testlib/selftests/findtestdata/findtestdata.cpp b/tests/auto/testlib/selftests/findtestdata/findtestdata.cpp index a0018bc420..09b8634334 100644 --- a/tests/auto/testlib/selftests/findtestdata/findtestdata.cpp +++ b/tests/auto/testlib/selftests/findtestdata/findtestdata.cpp @@ -62,7 +62,11 @@ void FindTestData::initTestCase() { // verify that our qt.conf is working as expected. QString app_path = QCoreApplication::applicationDirPath(); - QString install_path = app_path + "/tests"; + QString install_path = app_path +#ifdef Q_OS_MAC + + "/Contents" +#endif + + "/tests"; QVERIFY(QDir("/").mkpath(install_path)); QVERIFY(QDir("/").mkpath(install_path + "/findtestdata")); QCOMPARE(QLibraryInfo::location(QLibraryInfo::TestsPath), install_path); @@ -107,7 +111,11 @@ void FindTestData::paths() QVERIFY(touch(testfile_path1)); // 2. at the test install path (faked via qt.conf) - QString testfile_path2 = app_path + "/tests/findtestdata/" TESTFILE; + QString testfile_path2 = app_path +#ifdef Q_OS_MAC + + "/Contents" +#endif + + "/tests/findtestdata/" TESTFILE; QVERIFY(touch(testfile_path2)); // 3. at the source path (which we will fake later on) |