qt6-bb10/tests/auto/testlib/selftests
Lucie Gérard 7b6289a035 Correct license for tools files
According to QUIP-18 [1], all tools file should be
LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

[1]: https://contribute.qt-project.org/quips/18

Pick-to: 6.7
Task-number: QTBUG-121787
Change-Id: Icd5d5be2e04819617e68ff142924de1773bebbad
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-03-05 12:59:21 +01:00
..
assert Change license for tests files 2024-02-04 09:56:42 +01:00
badxml Change license for tests files 2024-02-04 09:56:42 +01:00
benchlibcallgrind Change license for tests files 2024-02-04 09:56:42 +01:00
benchlibcounting Change license for tests files 2024-02-04 09:56:42 +01:00
benchlibeventcounter Change license for tests files 2024-02-04 09:56:42 +01:00
benchliboptions Change license for tests files 2024-02-04 09:56:42 +01:00
benchlibtickcounter Change license for tests files 2024-02-04 09:56:42 +01:00
benchlibwalltime Change license for tests files 2024-02-04 09:56:42 +01:00
blacklisted Change license for tests files 2024-02-04 09:56:42 +01:00
cmptest QTest: allow passing chrono literal as QTRY_ timeout 2024-02-07 12:15:09 +00:00
commandlinedata Change license for tests files 2024-02-04 09:56:42 +01:00
counting Change license for tests files 2024-02-04 09:56:42 +01:00
crashes Change license for tests files 2024-02-04 09:56:42 +01:00
datatable Change license for tests files 2024-02-04 09:56:42 +01:00
datetime Change license for tests files 2024-02-04 09:56:42 +01:00
deleteLater Change license for tests files 2024-02-04 09:56:42 +01:00
deleteLater_noApp Change license for tests files 2024-02-04 09:56:42 +01:00
differentexec Change license for tests files 2024-02-04 09:56:42 +01:00
eventloop Change license for tests files 2024-02-04 09:56:42 +01:00
exceptionthrow Change license for tests files 2024-02-04 09:56:42 +01:00
expectfail Change license for tests files 2024-02-04 09:56:42 +01:00
extendedcompare Change license for tests files 2024-02-04 09:56:42 +01:00
failcleanup Change license for tests files 2024-02-04 09:56:42 +01:00
failcleanuptestcase Change license for tests files 2024-02-04 09:56:42 +01:00
faildatatype Change license for tests files 2024-02-04 09:56:42 +01:00
failfetchtype Change license for tests files 2024-02-04 09:56:42 +01:00
failinit Change license for tests files 2024-02-04 09:56:42 +01:00
failinitdata Change license for tests files 2024-02-04 09:56:42 +01:00
fetchbogus Change license for tests files 2024-02-04 09:56:42 +01:00
findtestdata Change license for tests files 2024-02-04 09:56:42 +01:00
float Change license for tests files 2024-02-04 09:56:42 +01:00
globaldata Change license for tests files 2024-02-04 09:56:42 +01:00
junit Change license for tests files 2024-02-04 09:56:42 +01:00
keyboard Change license for tests files 2024-02-04 09:56:42 +01:00
longstring Change license for tests files 2024-02-04 09:56:42 +01:00
maxwarnings Change license for tests files 2024-02-04 09:56:42 +01:00
mouse Change license for tests files 2024-02-04 09:56:42 +01:00
multiexec Change license for tests files 2024-02-04 09:56:42 +01:00
pairdiagnostics Change license for tests files 2024-02-04 09:56:42 +01:00
pass Change license for tests files 2024-02-04 09:56:42 +01:00
patches
printdatatags Change license for tests files 2024-02-04 09:56:42 +01:00
printdatatagswithglobaltags Change license for tests files 2024-02-04 09:56:42 +01:00
qexecstringlist Change license for tests files 2024-02-04 09:56:42 +01:00
signaldumper Change license for tests files 2024-02-04 09:56:42 +01:00
silent Change license for tests files 2024-02-04 09:56:42 +01:00
silent_fatal Change license for tests files 2024-02-04 09:56:42 +01:00
singleskip Change license for tests files 2024-02-04 09:56:42 +01:00
skip Change license for tests files 2024-02-04 09:56:42 +01:00
skipblacklisted Change license for tests files 2024-02-04 09:56:42 +01:00
skipcleanup Change license for tests files 2024-02-04 09:56:42 +01:00
skipcleanuptestcase Change license for tests files 2024-02-04 09:56:42 +01:00
skipinit Change license for tests files 2024-02-04 09:56:42 +01:00
skipinitdata Change license for tests files 2024-02-04 09:56:42 +01:00
sleep Change license for tests files 2024-02-04 09:56:42 +01:00
strcmp Change license for tests files 2024-02-04 09:56:42 +01:00
subtest Change license for tests files 2024-02-04 09:56:42 +01:00
testlib Change license for tests files 2024-02-04 09:56:42 +01:00
tuplediagnostics Change license for tests files 2024-02-04 09:56:42 +01:00
verbose1 QTest: add opt-in changing QCOMPARE etc to exit with throw, not return 2024-01-27 22:56:12 +01:00
verbose2 QTest: add opt-in changing QCOMPARE etc to exit with throw, not return 2024-01-27 22:56:12 +01:00
verifyexceptionthrown Change license for tests files 2024-02-04 09:56:42 +01:00
warnings Change license for tests files 2024-02-04 09:56:42 +01:00
watchdog Change license for tests files 2024-02-04 09:56:42 +01:00
.gitignore
CATCH_LICENSE.txt
CMakeLists.txt qtestlib: Add option to skip blacklisted tests 2023-11-22 20:09:34 +02:00
README selftests: document how to run subtests from Windows' cmd.exe 2023-10-17 12:26:07 +08:00
catch.cpp Change license for tests files 2024-02-04 09:56:42 +01:00
catch_p.h Change license for tests files 2024-02-04 09:56:42 +01:00
catch_p_p.h Update Catch2 to v2.13.10 2022-10-17 14:07:43 +02:00
expected_assert.junitxml
expected_assert.lightxml
expected_assert.tap
expected_assert.teamcity
expected_assert.txt
expected_assert.xml
expected_badxml.junitxml
expected_badxml.lightxml
expected_badxml.xml
expected_benchlibcallgrind_0.txt
expected_benchlibcallgrind_1.txt
expected_benchlibcallgrind_2.txt
expected_benchlibcounting.csv
expected_benchlibcounting.junitxml
expected_benchlibcounting.lightxml
expected_benchlibcounting.tap
expected_benchlibcounting.txt
expected_benchlibcounting.xml
expected_benchlibeventcounter.csv
expected_benchlibeventcounter.junitxml
expected_benchlibeventcounter.lightxml
expected_benchlibeventcounter.tap
expected_benchlibeventcounter.txt
expected_benchlibeventcounter.xml
expected_benchliboptions.txt
expected_benchlibtickcounter.csv
expected_benchlibtickcounter.junitxml
expected_benchlibtickcounter.lightxml
expected_benchlibtickcounter.tap
expected_benchlibtickcounter.txt
expected_benchlibtickcounter.xml
expected_benchlibwalltime.csv
expected_benchlibwalltime.junitxml
expected_benchlibwalltime.lightxml
expected_benchlibwalltime.tap
expected_benchlibwalltime.txt
expected_benchlibwalltime.xml
expected_blacklisted.junitxml
expected_blacklisted.lightxml
expected_blacklisted.tap
expected_blacklisted.teamcity
expected_blacklisted.txt
expected_blacklisted.xml
expected_cmptest.junitxml Increase QTest failure message limit 2023-10-19 10:57:21 +08:00
expected_cmptest.lightxml Increase QTest failure message limit 2023-10-19 10:57:21 +08:00
expected_cmptest.tap Increase QTest failure message limit 2023-10-19 10:57:21 +08:00
expected_cmptest.teamcity Increase QTest failure message limit 2023-10-19 10:57:21 +08:00
expected_cmptest.txt Increase QTest failure message limit 2023-10-19 10:57:21 +08:00
expected_cmptest.xml Increase QTest failure message limit 2023-10-19 10:57:21 +08:00
expected_commandlinedata.junitxml
expected_commandlinedata.lightxml
expected_commandlinedata.tap
expected_commandlinedata.teamcity
expected_commandlinedata.txt
expected_commandlinedata.xml
expected_counting.junitxml
expected_counting.lightxml
expected_counting.tap
expected_counting.teamcity
expected_counting.txt
expected_counting.xml
expected_crashes_1.txt
expected_crashes_2.txt
expected_datatable.junitxml
expected_datatable.lightxml
expected_datatable.tap
expected_datatable.teamcity
expected_datatable.txt
expected_datatable.xml
expected_datetime.junitxml
expected_datetime.lightxml
expected_datetime.tap
expected_datetime.teamcity
expected_datetime.txt
expected_datetime.xml
expected_deleteLater.junitxml
expected_deleteLater.lightxml
expected_deleteLater.tap
expected_deleteLater.teamcity
expected_deleteLater.txt
expected_deleteLater.xml
expected_deleteLater_noApp.junitxml
expected_deleteLater_noApp.lightxml
expected_deleteLater_noApp.tap
expected_deleteLater_noApp.teamcity
expected_deleteLater_noApp.txt
expected_deleteLater_noApp.xml
expected_differentexec.txt
expected_eventloop.junitxml Skip early return from test loops during cleanup() 2022-09-22 17:34:51 +02:00
expected_eventloop.lightxml Skip early return from test loops during cleanup() 2022-09-22 17:34:51 +02:00
expected_eventloop.tap Skip early return from test loops during cleanup() 2022-09-22 17:34:51 +02:00
expected_eventloop.teamcity Skip early return from test loops during cleanup() 2022-09-22 17:34:51 +02:00
expected_eventloop.txt Skip early return from test loops during cleanup() 2022-09-22 17:34:51 +02:00
expected_eventloop.xml Skip early return from test loops during cleanup() 2022-09-22 17:34:51 +02:00
expected_exceptionthrow.junitxml
expected_exceptionthrow.lightxml
expected_exceptionthrow.tap
expected_exceptionthrow.teamcity
expected_exceptionthrow.txt
expected_exceptionthrow.xml
expected_expectfail.junitxml
expected_expectfail.lightxml
expected_expectfail.tap
expected_expectfail.teamcity
expected_expectfail.txt
expected_expectfail.xml
expected_extendedcompare.junitxml QTest: Rename QCOMPARE_XX parameters to add meaning 2023-03-08 15:10:21 +01:00
expected_extendedcompare.lightxml QTest: Rename QCOMPARE_XX parameters to add meaning 2023-03-08 15:10:21 +01:00
expected_extendedcompare.tap QTest: Rename QCOMPARE_XX parameters to add meaning 2023-03-08 15:10:21 +01:00
expected_extendedcompare.teamcity QTest: Rename QCOMPARE_XX parameters to add meaning 2023-03-08 15:10:21 +01:00
expected_extendedcompare.txt QTest: Rename QCOMPARE_XX parameters to add meaning 2023-03-08 15:10:21 +01:00
expected_extendedcompare.xml QTest: Rename QCOMPARE_XX parameters to add meaning 2023-03-08 15:10:21 +01:00
expected_failcleanup.junitxml
expected_failcleanup.lightxml
expected_failcleanup.tap
expected_failcleanup.teamcity
expected_failcleanup.txt
expected_failcleanup.xml
expected_failcleanuptestcase.junitxml
expected_failcleanuptestcase.lightxml
expected_failcleanuptestcase.tap
expected_failcleanuptestcase.teamcity
expected_failcleanuptestcase.txt
expected_failcleanuptestcase.xml
expected_faildatatype.junitxml
expected_faildatatype.lightxml
expected_faildatatype.tap
expected_faildatatype.teamcity
expected_faildatatype.txt
expected_faildatatype.xml
expected_failfetchtype.junitxml
expected_failfetchtype.lightxml
expected_failfetchtype.tap
expected_failfetchtype.teamcity
expected_failfetchtype.txt
expected_failfetchtype.xml
expected_failinit.junitxml
expected_failinit.lightxml
expected_failinit.tap
expected_failinit.teamcity
expected_failinit.txt
expected_failinit.xml
expected_failinitdata.junitxml
expected_failinitdata.lightxml
expected_failinitdata.tap
expected_failinitdata.teamcity
expected_failinitdata.txt
expected_failinitdata.xml
expected_fetchbogus.junitxml
expected_fetchbogus.lightxml
expected_fetchbogus.tap
expected_fetchbogus.teamcity
expected_fetchbogus.txt
expected_fetchbogus.xml
expected_findtestdata.junitxml
expected_findtestdata.lightxml
expected_findtestdata.tap
expected_findtestdata.teamcity
expected_findtestdata.txt
expected_findtestdata.xml
expected_float.txt
expected_globaldata.junitxml
expected_globaldata.lightxml
expected_globaldata.tap
expected_globaldata.teamcity
expected_globaldata.txt
expected_globaldata.xml
expected_junit.junitxml
expected_keyboard.junitxml
expected_keyboard.lightxml
expected_keyboard.tap
expected_keyboard.teamcity
expected_keyboard.txt
expected_keyboard.xml
expected_longstring.junitxml
expected_longstring.lightxml
expected_longstring.tap
expected_longstring.teamcity
expected_longstring.txt
expected_longstring.xml
expected_maxwarnings.junitxml
expected_maxwarnings.lightxml
expected_maxwarnings.tap
expected_maxwarnings.teamcity
expected_maxwarnings.txt
expected_maxwarnings.xml
expected_mouse.junitxml testlib: make it possible to test double-clicks with discrete events 2022-10-16 08:36:03 +02:00
expected_mouse.lightxml testlib: make it possible to test double-clicks with discrete events 2022-10-16 08:36:03 +02:00
expected_mouse.tap testlib: make it possible to test double-clicks with discrete events 2022-10-16 08:36:03 +02:00
expected_mouse.teamcity testlib: make it possible to test double-clicks with discrete events 2022-10-16 08:36:03 +02:00
expected_mouse.txt testlib: make it possible to test double-clicks with discrete events 2022-10-16 08:36:03 +02:00
expected_mouse.xml testlib: make it possible to test double-clicks with discrete events 2022-10-16 08:36:03 +02:00
expected_multiexec.txt
expected_pairdiagnostics.junitxml
expected_pairdiagnostics.lightxml
expected_pairdiagnostics.tap
expected_pairdiagnostics.teamcity
expected_pairdiagnostics.txt
expected_pairdiagnostics.xml
expected_pass.junitxml
expected_pass.lightxml
expected_pass.tap
expected_pass.teamcity
expected_pass.txt
expected_pass.xml
expected_printdatatags.txt
expected_printdatatagswithglobaltags.txt
expected_qexecstringlist.txt
expected_signaldumper.junitxml
expected_signaldumper.lightxml
expected_signaldumper.tap
expected_signaldumper.teamcity
expected_signaldumper.txt
expected_signaldumper.xml
expected_silent.txt tst_selftests: split the qFatal() test away from tst_Silent 2023-09-06 12:36:06 -07:00
expected_silent_fatal.txt tst_selftests: split the qFatal() test away from tst_Silent 2023-09-06 12:36:06 -07:00
expected_singleskip.junitxml
expected_singleskip.lightxml
expected_singleskip.tap
expected_singleskip.teamcity
expected_singleskip.txt
expected_singleskip.xml
expected_skip.junitxml
expected_skip.lightxml
expected_skip.tap
expected_skip.teamcity
expected_skip.txt
expected_skip.xml
expected_skipblacklisted.junitxml qtestlib: Add option to skip blacklisted tests 2023-11-22 20:09:34 +02:00
expected_skipblacklisted.lightxml qtestlib: Add option to skip blacklisted tests 2023-11-22 20:09:34 +02:00
expected_skipblacklisted.tap qtestlib: Add option to skip blacklisted tests 2023-11-22 20:09:34 +02:00
expected_skipblacklisted.teamcity qtestlib: Add option to skip blacklisted tests 2023-11-22 20:09:34 +02:00
expected_skipblacklisted.txt qtestlib: Add option to skip blacklisted tests 2023-11-22 20:09:34 +02:00
expected_skipblacklisted.xml qtestlib: Add option to skip blacklisted tests 2023-11-22 20:09:34 +02:00
expected_skipcleanup.junitxml
expected_skipcleanup.lightxml
expected_skipcleanup.tap
expected_skipcleanup.teamcity
expected_skipcleanup.txt
expected_skipcleanup.xml
expected_skipcleanuptestcase.junitxml
expected_skipcleanuptestcase.lightxml
expected_skipcleanuptestcase.tap
expected_skipcleanuptestcase.teamcity
expected_skipcleanuptestcase.txt
expected_skipcleanuptestcase.xml
expected_skipinit.junitxml
expected_skipinit.lightxml
expected_skipinit.tap
expected_skipinit.teamcity
expected_skipinit.txt
expected_skipinit.xml
expected_skipinitdata.junitxml
expected_skipinitdata.lightxml
expected_skipinitdata.tap
expected_skipinitdata.teamcity
expected_skipinitdata.txt
expected_skipinitdata.xml
expected_sleep.txt
expected_strcmp.junitxml
expected_strcmp.lightxml
expected_strcmp.tap
expected_strcmp.teamcity
expected_strcmp.txt
expected_strcmp.xml
expected_subtest.junitxml
expected_subtest.lightxml
expected_subtest.tap
expected_subtest.teamcity
expected_subtest.txt
expected_subtest.xml
expected_testlib.junitxml
expected_testlib.lightxml
expected_testlib.tap
expected_testlib.teamcity
expected_testlib.txt
expected_testlib.xml
expected_tuplediagnostics.junitxml
expected_tuplediagnostics.lightxml
expected_tuplediagnostics.tap
expected_tuplediagnostics.teamcity
expected_tuplediagnostics.txt
expected_tuplediagnostics.xml
expected_verbose1.junitxml
expected_verbose1.lightxml
expected_verbose1.tap
expected_verbose1.teamcity
expected_verbose1.txt
expected_verbose1.xml
expected_verbose2.junitxml
expected_verbose2.lightxml
expected_verbose2.tap
expected_verbose2.teamcity
expected_verbose2.txt
expected_verbose2.xml
expected_verifyexceptionthrown.junitxml
expected_verifyexceptionthrown.lightxml
expected_verifyexceptionthrown.tap
expected_verifyexceptionthrown.teamcity
expected_verifyexceptionthrown.txt
expected_verifyexceptionthrown.xml
expected_warnings.junitxml QTest: make failOnWarning() functional on temp objects destruction 2023-11-22 20:15:38 +00:00
expected_warnings.lightxml QTest: make failOnWarning() functional on temp objects destruction 2023-11-22 20:15:38 +00:00
expected_warnings.tap QTest: make failOnWarning() functional on temp objects destruction 2023-11-22 20:15:38 +00:00
expected_warnings.teamcity QTest: make failOnWarning() functional on temp objects destruction 2023-11-22 20:15:38 +00:00
expected_warnings.txt QTest: make failOnWarning() functional on temp objects destruction 2023-11-22 20:15:38 +00:00
expected_warnings.xml QTest: make failOnWarning() functional on temp objects destruction 2023-11-22 20:15:38 +00:00
expected_watchdog.junitxml
expected_watchdog.lightxml
expected_watchdog.tap
expected_watchdog.teamcity
expected_watchdog.txt
expected_watchdog.xml
generate_expected_output.py Correct license for tools files 2024-03-05 12:59:21 +01:00
qt_attribution.json Update Catch2 to v2.13.10 2022-10-17 14:07:43 +02:00
tst_selftests.cpp Change license for tests files 2024-02-04 09:56:42 +01:00

README

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

Running the QtTestLib selftests with Catch2
===========================================

Catch2 [1] is a header only test framework that we use to allow
testing QtTestLib without relying on any part of testlib itself.

To run the test suite, execute 'make check' or './tst_selftests'
as normal. This should print:

    ===================================================================
    All tests passed (2453 assertions in 5 test cases)

To run specific tests, first lists the available tests:

     ./tst_selftests -l
    All available test cases:
      Loggers support both old and new style arguments
      Loggers can output to both file and stdout
      Logging to file and stdout at the same time
      All loggers can be enabled at the same time
      Scenario: Test output of the loggers is as expected
    5 test cases

Then pass the name of the test in quotes as the first argument:

     ./tst_selftests "Loggers support both old and new style arguments"
    Filters: Loggers support both old and new style arguments
    ==================================================================
    All tests passed (96 assertions in 1 test case)

You can find the tests in the sources as individual TEST_CASE
entries. Note that each of these tests run the tests once per
logger, and in the case of the test log check also all sub tests,
so the amount of actual test assertions is much higher than the
five tests listed above.

To see what the tests is actually doing, pass the -s option.
This will result in very verbose output. Each leaf test is
prefixed with a heading:

    ---------------------------------------------------------------
          Given: The QTestLog::TAP logger
           When: Passing arguments with new style
    ---------------------------------------------------------------

You can choose a specific subtest by passing the -c option:

     ./tst_selftests "Scenario: Test output of the loggers is as expected" \
        -c "Given: The QTestLog::Plain logger" \
        -c 'And given: The "skip" subtest'

Note that on Windows, when using cmd.exe, you cannot use single
quotes, so the command above becomes:

     ./tst_selftests "Scenario: Test output of the loggers is as expected" \
        -c "Given: The QTestLog::Plain logger" \
        -c "And given: The ""skip"" subtest"

It's possible to pass only the first -c options, to e.g. run all
tests with the Plain logger, but it's unfortunately not possible
to pass only the last -c option, to run the 'skip' subtest with
all loggers.

If a test fails it will print the expected, actual, and difference.
The test results are also left in a temporary directory for closer
inspection.

Add new tests by modifying selftest.pri and CMakeLists.txt, adding
a new subprogram.

Generating new test expectations is done using the python script
in this directory (generate_expected_output.py). In the future this
will be done with the --rebase option to ./tst_selftest, but this
is not fleshed out yet.

[1] https://github.com/catchorg/Catch2