qt5base-lts/tests/auto/testlib/selftests
Rohan McGovern 8481369f3d testlib: add QFINDTESTDATA macro for finding testdata files
Automated tests often need to load some data from external files.
Currently, a wide variety of approaches for this have been used in Qt
autotests, including:

  - embed the source directory into the test binary at compile time, and
    find the testdata relative to that; this fails when the source tree
    is no longer available (e.g. when the tests are deployed to a device).

  - use a path relative to the current working directory, and trust that
    the caller always sets the current working directory such that the
    testdata can be found; this fails when the caller uses a different
    working directory than expected.

  - use a path relative to QCoreApplication::applicationDirPath();
    this fails when source tree != build tree (since testdata is not
    automatically copied into the build tree).

  - compile the files into the binary using the Qt resource system; this
    should work, but does not allow for testing of code which genuinely
    needs external files.

It seems that there is not a simple method for determining the testdata
path which can be reliably used in all circumstances, so various tests
have reinvented the testdata location method in different ways.
Therefore, this is a good candidate for an addition to the testlib API.

The current implementation of QFINDTESTDATA is able to find testdata
in all three of (build tree, install tree, source tree), in that order.

Change-Id: Ib2fed860723ccf437240da3b00db22dfe1a6b56c
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-12-01 09:12:57 +01:00
..
alive all remaining tests: eliminated usage of qttest_p4.prf 2011-10-25 08:42:23 +02:00
assert all remaining tests: eliminated usage of qttest_p4.prf 2011-10-25 08:42:23 +02:00
badxml all remaining tests: eliminated usage of qttest_p4.prf 2011-10-25 08:42:23 +02:00
benchlibcallgrind all remaining tests: eliminated usage of qttest_p4.prf 2011-10-25 08:42:23 +02:00
benchlibeventcounter all remaining tests: eliminated usage of qttest_p4.prf 2011-10-25 08:42:23 +02:00
benchliboptions all remaining tests: eliminated usage of qttest_p4.prf 2011-10-25 08:42:23 +02:00
benchlibtickcounter all remaining tests: eliminated usage of qttest_p4.prf 2011-10-25 08:42:23 +02:00
benchlibwalltime all remaining tests: eliminated usage of qttest_p4.prf 2011-10-25 08:42:23 +02:00
cmptest Make usage of internal QVariant space. 2011-11-09 10:11:34 +01:00
commandlinedata all remaining tests: eliminated usage of qttest_p4.prf 2011-10-25 08:42:23 +02:00
crashes all remaining tests: eliminated usage of qttest_p4.prf 2011-10-25 08:42:23 +02:00
datatable all remaining tests: eliminated usage of qttest_p4.prf 2011-10-25 08:42:23 +02:00
datetime all remaining tests: eliminated usage of qttest_p4.prf 2011-10-25 08:42:23 +02:00
differentexec all remaining tests: eliminated usage of qttest_p4.prf 2011-10-25 08:42:23 +02:00
exceptionthrow all remaining tests: eliminated usage of qttest_p4.prf 2011-10-25 08:42:23 +02:00
expectfail all remaining tests: eliminated usage of qttest_p4.prf 2011-10-25 08:42:23 +02:00
failinit all remaining tests: eliminated usage of qttest_p4.prf 2011-10-25 08:42:23 +02:00
failinitdata all remaining tests: eliminated usage of qttest_p4.prf 2011-10-25 08:42:23 +02:00
fetchbogus all remaining tests: eliminated usage of qttest_p4.prf 2011-10-25 08:42:23 +02:00
findtestdata testlib: add QFINDTESTDATA macro for finding testdata files 2011-12-01 09:12:57 +01:00
float all remaining tests: eliminated usage of qttest_p4.prf 2011-10-25 08:42:23 +02:00
globaldata all remaining tests: eliminated usage of qttest_p4.prf 2011-10-25 08:42:23 +02:00
longstring all remaining tests: eliminated usage of qttest_p4.prf 2011-10-25 08:42:23 +02:00
maxwarnings all remaining tests: eliminated usage of qttest_p4.prf 2011-10-25 08:42:23 +02:00
multiexec all remaining tests: eliminated usage of qttest_p4.prf 2011-10-25 08:42:23 +02:00
printdatatags Added -datatags option to QTestLib 2011-11-04 19:23:33 +01:00
printdatatagswithglobaltags Added -datatags option to QTestLib 2011-11-04 19:23:33 +01:00
qexecstringlist all remaining tests: eliminated usage of qttest_p4.prf 2011-10-25 08:42:23 +02:00
singleskip all remaining tests: eliminated usage of qttest_p4.prf 2011-10-25 08:42:23 +02:00
skip all remaining tests: eliminated usage of qttest_p4.prf 2011-10-25 08:42:23 +02:00
skipinit all remaining tests: eliminated usage of qttest_p4.prf 2011-10-25 08:42:23 +02:00
skipinitdata all remaining tests: eliminated usage of qttest_p4.prf 2011-10-25 08:42:23 +02:00
sleep all remaining tests: eliminated usage of qttest_p4.prf 2011-10-25 08:42:23 +02:00
strcmp all remaining tests: eliminated usage of qttest_p4.prf 2011-10-25 08:42:23 +02:00
subtest all remaining tests: eliminated usage of qttest_p4.prf 2011-10-25 08:42:23 +02:00
test all remaining tests: eliminated usage of qttest_p4.prf 2011-10-25 08:42:23 +02:00
warnings all remaining tests: eliminated usage of qttest_p4.prf 2011-10-25 08:42:23 +02:00
xunit all remaining tests: eliminated usage of qttest_p4.prf 2011-10-25 08:42:23 +02:00
.gitignore Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_alive.txt Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_assert.lightxml Fix XFAIL in testlib selftest 2011-09-17 03:21:44 +02:00
expected_assert.txt Use placeholder for Qt version in expected output 2011-09-26 07:50:20 +02:00
expected_assert.xml Fix XFAIL in testlib selftest 2011-09-17 03:21:44 +02:00
expected_assert.xunitxml Fix XFAIL in testlib selftest 2011-09-17 03:21:44 +02:00
expected_badxml.lightxml Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_badxml.txt Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_badxml.xml Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_badxml.xunitxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_benchlibcallgrind.lightxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_benchlibcallgrind.txt Use placeholder for Qt version in expected output 2011-09-26 07:50:20 +02:00
expected_benchlibcallgrind.xml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_benchlibcallgrind.xunitxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_benchlibeventcounter.lightxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_benchlibeventcounter.txt Use placeholder for Qt version in expected output 2011-09-26 07:50:20 +02:00
expected_benchlibeventcounter.xml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_benchlibeventcounter.xunitxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_benchliboptions.lightxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_benchliboptions.txt Use placeholder for Qt version in expected output 2011-09-26 07:50:20 +02:00
expected_benchliboptions.xml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_benchliboptions.xunitxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_benchlibtickcounter.lightxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_benchlibtickcounter.txt Use placeholder for Qt version in expected output 2011-09-26 07:50:20 +02:00
expected_benchlibtickcounter.xml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_benchlibtickcounter.xunitxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_benchlibwalltime.lightxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_benchlibwalltime.txt Use placeholder for Qt version in expected output 2011-09-26 07:50:20 +02:00
expected_benchlibwalltime.xml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_benchlibwalltime.xunitxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_cmptest.lightxml Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_cmptest.txt Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_cmptest.xml Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_cmptest.xunitxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_commandlinedata.lightxml Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_commandlinedata.txt Use placeholder for Qt version in expected output 2011-09-26 07:50:20 +02:00
expected_commandlinedata.xml Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_commandlinedata.xunitxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_crashes_1.txt Use placeholder for Qt version in expected output 2011-09-26 07:50:20 +02:00
expected_crashes_2.txt Use placeholder for Qt version in expected output 2011-09-26 07:50:20 +02:00
expected_crashes_3.txt Use placeholder for Qt version in expected output 2011-09-26 07:50:20 +02:00
expected_crashes.lightxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_crashes.xml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_crashes.xunitxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_datatable.lightxml Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_datatable.txt Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_datatable.xml Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_datatable.xunitxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_datetime.lightxml Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_datetime.txt Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_datetime.xml Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_datetime.xunitxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_differentexec.txt Use placeholder for Qt version in expected output 2011-09-26 07:50:20 +02:00
expected_exceptionthrow.lightxml Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_exceptionthrow.txt Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_exceptionthrow.xml Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_exceptionthrow.xunitxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_expectfail.lightxml Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_expectfail.txt Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_expectfail.xml Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_expectfail.xunitxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_failinit.lightxml Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_failinit.txt Use placeholder for Qt version in expected output 2011-09-26 07:50:20 +02:00
expected_failinit.xml Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_failinit.xunitxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_failinitdata.lightxml Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_failinitdata.txt Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_failinitdata.xml Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_failinitdata.xunitxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_fatal.txt Use placeholder for Qt version in expected output 2011-09-26 07:50:20 +02:00
expected_fetchbogus.lightxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_fetchbogus.txt Use placeholder for Qt version in expected output 2011-09-26 07:50:20 +02:00
expected_fetchbogus.xml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_fetchbogus.xunitxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_findtestdata.lightxml testlib: add QFINDTESTDATA macro for finding testdata files 2011-12-01 09:12:57 +01:00
expected_findtestdata.txt testlib: add QFINDTESTDATA macro for finding testdata files 2011-12-01 09:12:57 +01:00
expected_findtestdata.xml testlib: add QFINDTESTDATA macro for finding testdata files 2011-12-01 09:12:57 +01:00
expected_findtestdata.xunitxml testlib: add QFINDTESTDATA macro for finding testdata files 2011-12-01 09:12:57 +01:00
expected_float.lightxml Split subtest selftest 2011-09-20 08:46:18 +02:00
expected_float.txt Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_float.xml Split subtest selftest 2011-09-20 08:46:18 +02:00
expected_float.xunitxml Split subtest selftest 2011-09-20 08:46:18 +02:00
expected_globaldata.lightxml Remove QTest::SkipMode from qtestlib API. 2011-10-21 01:20:29 +02:00
expected_globaldata.txt Remove QTest::SkipMode from qtestlib API. 2011-10-21 01:20:29 +02:00
expected_globaldata.xml Remove QTest::SkipMode from qtestlib API. 2011-10-21 01:20:29 +02:00
expected_globaldata.xunitxml Remove QTest::SkipMode from qtestlib API. 2011-10-21 01:20:29 +02:00
expected_longstring.lightxml Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_longstring.txt Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_longstring.xml Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_longstring.xunitxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_maxwarnings.lightxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_maxwarnings.txt Use placeholder for Qt version in expected output 2011-09-26 07:50:20 +02:00
expected_maxwarnings.xml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_maxwarnings.xunitxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_multiexec.lightxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_multiexec.txt Use placeholder for Qt version in expected output 2011-09-26 07:50:20 +02:00
expected_multiexec.xml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_multiexec.xunitxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_printdatatags.txt Added -datatags option to QTestLib 2011-11-04 19:23:33 +01:00
expected_printdatatagswithglobaltags.txt Added -datatags option to QTestLib 2011-11-04 19:23:33 +01:00
expected_qexecstringlist.txt Use placeholder for Qt version in expected output 2011-09-26 07:50:20 +02:00
expected_singleskip.lightxml Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_singleskip.txt Remove QTest::SkipMode from qtestlib API. 2011-10-21 01:20:29 +02:00
expected_singleskip.xml Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_singleskip.xunitxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_skip.lightxml Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_skip.txt Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_skip.xml Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_skip.xunitxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_skipinit.lightxml Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_skipinit.txt Remove QTest::SkipMode from qtestlib API. 2011-10-21 01:20:29 +02:00
expected_skipinit.xml Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_skipinit.xunitxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_skipinitdata.lightxml Remove QTest::SkipMode from qtestlib API. 2011-10-21 01:20:29 +02:00
expected_skipinitdata.txt Remove QTest::SkipMode from qtestlib API. 2011-10-21 01:20:29 +02:00
expected_skipinitdata.xml Remove QTest::SkipMode from qtestlib API. 2011-10-21 01:20:29 +02:00
expected_skipinitdata.xunitxml Remove QTest::SkipMode from qtestlib API. 2011-10-21 01:20:29 +02:00
expected_sleep.lightxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_sleep.txt Use placeholder for Qt version in expected output 2011-09-26 07:50:20 +02:00
expected_sleep.xml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_sleep.xunitxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_strcmp.lightxml Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_strcmp.txt Use placeholder for Qt version in expected output 2011-09-26 07:50:20 +02:00
expected_strcmp.xml Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_strcmp.xunitxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_subtest.lightxml Split subtest selftest 2011-09-20 08:46:18 +02:00
expected_subtest.txt Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_subtest.xml Split subtest selftest 2011-09-20 08:46:18 +02:00
expected_subtest.xunitxml Split subtest selftest 2011-09-20 08:46:18 +02:00
expected_warnings.lightxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_warnings.txt Use placeholder for Qt version in expected output 2011-09-26 07:50:20 +02:00
expected_warnings.xml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_warnings.xunitxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
expected_xunit.lightxml Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_xunit.txt Make QTest::qWarn() use __FILE__ and __LINE__. 2011-09-28 12:17:45 +02:00
expected_xunit.xml Sanitize paths in selftest data. 2011-10-19 07:24:40 +02:00
expected_xunit.xunitxml Moved autotests in category 'testlib' into new directory structure 2011-09-12 08:36:15 +02:00
selftests.pro testlib: add QFINDTESTDATA macro for finding testdata files 2011-12-01 09:12:57 +01:00
selftests.qrc testlib: add QFINDTESTDATA macro for finding testdata files 2011-12-01 09:12:57 +01:00
tst_selftests.cpp testlib: add QFINDTESTDATA macro for finding testdata files 2011-12-01 09:12:57 +01:00