qt6-bb10/tests/auto/testlib/selftests
Andreas Buhr d4fd996363 Adapt Catch2 to Apple Silicon
We are still using Catch2 2.11.3 which is not adapted to Apple
silicon yet. This patch backports the required change
from Catch v3.0.0-preview.3.

Change-Id: Ifa14a1fdd6cd1f661c94a0a78648cb01bd9699c1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-25 12:06:31 +01:00
..
assert Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
badxml Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
benchlibcallgrind Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
benchlibcounting Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
benchlibeventcounter Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
benchliboptions Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
benchlibtickcounter Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
benchlibwalltime Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
blacklisted Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
cmptest Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
commandlinedata Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
counting Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
crashes Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
datatable Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
datetime Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
deleteLater Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
deleteLater_noApp Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
differentexec Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
exceptionthrow Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
expectfail Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
failcleanup Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
faildatatype Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
failfetchtype Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
failinit Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
failinitdata Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
fetchbogus Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
findtestdata Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
float Move QEMU emulation detector to QTest 2021-02-13 10:02:51 +02:00
globaldata Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
keyboard Fix testlib/tst_selftests::keyboard on Wayland 2021-03-09 07:42:50 +01:00
longstring Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
maxwarnings Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
mouse Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
multiexec Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
pairdiagnostics Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
pass Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
printdatatags Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
printdatatagswithglobaltags Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
qexecstringlist Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
signaldumper Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
silent Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
singleskip Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
skip Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
skipcleanup Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
skipinit Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
skipinitdata Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
sleep Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
strcmp Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
subtest Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
testlib Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
tuplediagnostics Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
verbose1 Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
verbose2 Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
verifyexceptionthrown Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
warnings Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
watchdog Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
xunit Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
.gitignore
CATCH_LICENSE.txt
CMakeLists.txt Move QEMU emulation detector to QTest 2021-02-13 10:02:51 +02:00
README
catch.cpp
catch_p.h
catch_p_p.h Adapt Catch2 to Apple Silicon 2021-03-25 12:06:31 +01:00
expected_assert.junitxml
expected_assert.lightxml
expected_assert.tap
expected_assert.teamcity
expected_assert.txt
expected_assert.xml
expected_badxml.junitxml QTestlib/JUnit XML: Log most messages to standard output instead of error output 2021-01-15 18:05:40 +01:00
expected_badxml.lightxml
expected_badxml.tap
expected_badxml.teamcity
expected_badxml.txt
expected_badxml.xml
expected_benchlibcallgrind.csv
expected_benchlibcallgrind.junitxml
expected_benchlibcallgrind.lightxml
expected_benchlibcallgrind.tap
expected_benchlibcallgrind.teamcity
expected_benchlibcallgrind.xml
expected_benchlibcallgrind_0.txt
expected_benchlibcallgrind_1.txt
expected_benchlibcounting.csv
expected_benchlibcounting.junitxml QTestlib/JUnit XML: Log most messages to standard output instead of error output 2021-01-15 18:05:40 +01:00
expected_benchlibcounting.lightxml
expected_benchlibcounting.tap
expected_benchlibcounting.teamcity
expected_benchlibcounting.txt
expected_benchlibcounting.xml
expected_benchlibeventcounter.csv
expected_benchlibeventcounter.junitxml
expected_benchlibeventcounter.lightxml
expected_benchlibeventcounter.tap
expected_benchlibeventcounter.teamcity
expected_benchlibeventcounter.txt
expected_benchlibeventcounter.xml
expected_benchliboptions.csv
expected_benchliboptions.junitxml
expected_benchliboptions.lightxml
expected_benchliboptions.tap
expected_benchliboptions.teamcity
expected_benchliboptions.txt
expected_benchliboptions.xml
expected_benchlibtickcounter.csv
expected_benchlibtickcounter.junitxml
expected_benchlibtickcounter.lightxml
expected_benchlibtickcounter.tap
expected_benchlibtickcounter.teamcity
expected_benchlibtickcounter.txt
expected_benchlibtickcounter.xml
expected_benchlibwalltime.csv
expected_benchlibwalltime.junitxml
expected_benchlibwalltime.lightxml
expected_benchlibwalltime.tap
expected_benchlibwalltime.teamcity
expected_benchlibwalltime.txt
expected_benchlibwalltime.xml
expected_blacklisted.junitxml QTestlib/JUnit XML: Log most messages to standard output instead of error output 2021-01-15 18:05:40 +01:00
expected_blacklisted.lightxml
expected_blacklisted.tap
expected_blacklisted.teamcity
expected_blacklisted.txt
expected_blacklisted.xml
expected_cmptest.junitxml QTestLib: Show the values of unregistered enums 2021-01-13 16:15:06 +01:00
expected_cmptest.lightxml QTestLib: Show the values of unregistered enums 2021-01-13 16:15:06 +01:00
expected_cmptest.tap QTestLib: Show the values of unregistered enums 2021-01-13 16:15:06 +01:00
expected_cmptest.teamcity QTestLib: Show the values of unregistered enums 2021-01-13 16:15:06 +01:00
expected_cmptest.txt QTestLib: Show the values of unregistered enums 2021-01-13 16:15:06 +01:00
expected_cmptest.xml QTestLib: Show the values of unregistered enums 2021-01-13 16:15:06 +01:00
expected_commandlinedata.junitxml QTestlib/JUnit XML: Log most messages to standard output instead of error output 2021-01-15 18:05:40 +01:00
expected_commandlinedata.lightxml
expected_commandlinedata.tap
expected_commandlinedata.teamcity
expected_commandlinedata.txt
expected_commandlinedata.xml
expected_counting.junitxml QTestlib/JUnit XML: Log most messages to standard output instead of error output 2021-01-15 18:05:40 +01:00
expected_counting.lightxml
expected_counting.tap
expected_counting.teamcity
expected_counting.txt
expected_counting.xml
expected_crashes_1.txt
expected_crashes_2.txt
expected_crashes_3.txt
expected_crashes_4.txt
expected_crashes_5.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_differentexec.junitxml
expected_differentexec.lightxml
expected_differentexec.tap
expected_differentexec.teamcity
expected_differentexec.txt
expected_differentexec.xml
expected_exceptionthrow.junitxml
expected_exceptionthrow.lightxml
expected_exceptionthrow.tap
expected_exceptionthrow.teamcity
expected_exceptionthrow.txt
expected_exceptionthrow.xml
expected_expectfail.junitxml QTestlib/JUnit XML: Log most messages to standard output instead of error output 2021-01-15 18:05:40 +01:00
expected_expectfail.lightxml
expected_expectfail.tap QTestResult: Don't pass a nullptr file to addFailure() 2020-09-30 16:20:29 +02:00
expected_expectfail.teamcity QTestResult: Don't pass a nullptr file to addFailure() 2020-09-30 16:20:29 +02:00
expected_expectfail.txt QTestResult: Don't pass a nullptr file to addFailure() 2020-09-30 16:20:29 +02:00
expected_expectfail.xml
expected_failcleanup.junitxml
expected_failcleanup.lightxml
expected_failcleanup.tap
expected_failcleanup.teamcity
expected_failcleanup.txt
expected_failcleanup.xml
expected_faildatatype.junitxml QTestlib/JUnit XML: Log most messages to standard output instead of error output 2021-01-15 18:05:40 +01:00
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.junitxml QTestlib/JUnit XML: Log most messages to standard output instead of error output 2021-01-15 18:05:40 +01:00
expected_float.lightxml
expected_float.tap
expected_float.teamcity
expected_float.txt
expected_float.xml
expected_globaldata.junitxml QTestlib/JUnit XML: Log most messages to standard output instead of error output 2021-01-15 18:05:40 +01:00
expected_globaldata.lightxml
expected_globaldata.tap
expected_globaldata.teamcity
expected_globaldata.txt
expected_globaldata.xml
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 QTestlib/JUnit XML: Log most messages to standard output instead of error output 2021-01-15 18:05:40 +01:00
expected_maxwarnings.lightxml
expected_maxwarnings.tap
expected_maxwarnings.teamcity
expected_maxwarnings.txt
expected_maxwarnings.xml
expected_multiexec.junitxml
expected_multiexec.lightxml
expected_multiexec.tap
expected_multiexec.teamcity
expected_multiexec.txt
expected_multiexec.xml
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.junitxml
expected_qexecstringlist.lightxml
expected_qexecstringlist.tap
expected_qexecstringlist.teamcity
expected_qexecstringlist.txt
expected_qexecstringlist.xml
expected_signaldumper.junitxml QTestlib/JUnit XML: Log most messages to standard output instead of error output 2021-01-15 18:05:40 +01:00
expected_signaldumper.lightxml
expected_signaldumper.tap
expected_signaldumper.teamcity
expected_signaldumper.txt
expected_signaldumper.xml
expected_silent.junitxml QTestlib/JUnit XML: Log most messages to standard output instead of error output 2021-01-15 18:05:40 +01:00
expected_silent.lightxml
expected_silent.tap
expected_silent.teamcity
expected_silent.txt
expected_silent.xml
expected_singleskip.junitxml QTestlib/JUnit XML: Log most messages to standard output instead of error output 2021-01-15 18:05:40 +01:00
expected_singleskip.lightxml
expected_singleskip.tap
expected_singleskip.teamcity
expected_singleskip.txt
expected_singleskip.xml
expected_skip.junitxml QTestlib/JUnit XML: Log most messages to standard output instead of error output 2021-01-15 18:05:40 +01:00
expected_skip.lightxml
expected_skip.tap
expected_skip.teamcity
expected_skip.txt
expected_skip.xml
expected_skipcleanup.junitxml QTestlib/JUnit XML: Log most messages to standard output instead of error output 2021-01-15 18:05:40 +01:00
expected_skipcleanup.lightxml
expected_skipcleanup.tap
expected_skipcleanup.teamcity
expected_skipcleanup.txt
expected_skipcleanup.xml
expected_skipinit.junitxml QTestlib/JUnit XML: Log most messages to standard output instead of error output 2021-01-15 18:05:40 +01:00
expected_skipinit.lightxml
expected_skipinit.tap
expected_skipinit.teamcity
expected_skipinit.txt
expected_skipinit.xml
expected_skipinitdata.junitxml QTestlib/JUnit XML: Log most messages to standard output instead of error output 2021-01-15 18:05:40 +01:00
expected_skipinitdata.lightxml
expected_skipinitdata.tap
expected_skipinitdata.teamcity
expected_skipinitdata.txt
expected_skipinitdata.xml
expected_sleep.junitxml
expected_sleep.lightxml
expected_sleep.tap
expected_sleep.teamcity
expected_sleep.txt
expected_sleep.xml
expected_strcmp.junitxml QTestlib/JUnit XML: Log most messages to standard output instead of error output 2021-01-15 18:05:40 +01:00
expected_strcmp.lightxml
expected_strcmp.tap
expected_strcmp.teamcity
expected_strcmp.txt
expected_strcmp.xml
expected_subtest.junitxml QTestlib/JUnit XML: Log most messages to standard output instead of error output 2021-01-15 18:05:40 +01:00
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 QTestlib/JUnit XML: Log most messages to standard output instead of error output 2021-01-15 18:05:40 +01:00
expected_verbose1.lightxml
expected_verbose1.tap
expected_verbose1.teamcity
expected_verbose1.txt
expected_verbose1.xml
expected_verbose2.junitxml QTestlib/JUnit XML: Log most messages to standard output instead of error output 2021-01-15 18:05:40 +01:00
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 QTestlib/JUnit XML: Log most messages to standard output instead of error output 2021-01-15 18:05:40 +01:00
expected_warnings.lightxml
expected_warnings.tap QTestResult: Don't pass a nullptr file to addFailure() 2020-09-30 16:20:29 +02:00
expected_warnings.teamcity QTestResult: Don't pass a nullptr file to addFailure() 2020-09-30 16:20:29 +02:00
expected_warnings.txt QTestResult: Don't pass a nullptr file to addFailure() 2020-09-30 16:20:29 +02:00
expected_warnings.xml
expected_watchdog.junitxml
expected_watchdog.lightxml
expected_watchdog.tap
expected_watchdog.teamcity
expected_watchdog.txt
expected_watchdog.xml
expected_xunit.junitxml QTestlib/JUnit XML: Log most messages to standard output instead of error output 2021-01-15 18:05:40 +01:00
expected_xunit.lightxml
expected_xunit.tap
expected_xunit.teamcity
expected_xunit.txt
expected_xunit.xml
generate_expected_output.py Brush up QTestlib/generate_expected_output.py 2021-01-15 15:37:18 +01:00
qt_attribution.json
tst_selftests.cpp Move QEMU emulation detector to QTest 2021-02-13 10:02:51 +02: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'

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