lumiera_/tests/00support.tests
Ichthyostega ce2116fccd Library: option to provide an explicit random seed for tests
* add new option to the commandline option parser
 * pass this as std::optional to the test-suite constructor
 * use this value optionally to inject a fixed value on re-seeding
 * provide diagnostic output to show the actual seed value used
2024-11-12 15:49:15 +01:00

124 lines
4.4 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

TESTING "Test support and helpers" ./test-suite --group=common
TEST "Test support functions" TestHelper_test <<END
out: [a-z0-9]{80}$
out-lit: Displaying types and sizes....
out-lit: sizeof( just a char ) = 1
out-lit: sizeof( test::Murpf ) = 1
out-lit: sizeof( test::Wrmrmpft<test::Murpf> ) = 1
out-lit: sizeof( test::Wrmrmpft<char [2]> ) = 2
out-lit: sizeof( test::Wrmrmpft<char [3]> ) = 3
out-lit: sizeof( Universe ) = 42
out-lit: sizeof( test::Wrmrmpft<test::Murpf> ) = 1
out-lit: sizeof( test::Wrmrmpft<test::Murpf> ) = 1
out-lit: sizeof( test::Wrmrmpft<test::Murpf> ) = 1
out-lit: sizeof( test::Wrmrmpft<test::Murpf> ) = 1
out-lit: sizeof( test::Wrmrmpft<test::Murpf> ) = 1
return: 0
END
TEST "Temporary working directory" TempDir_test <<END
return: 0
END
TEST "Helper for event registration and verification" EventLog_test <<END
err-lit: __Log_condition_violated__
err-lit: FAILED to match("γ")
err: ..after HEAD EventLog_test.+
err-lit: __Log_condition_violated__
err-lit: FAILED to match("α")
err-lit: ..after match("β") @ Rec(event|{β})
err: ..after HEAD EventLog_test.+
err-lit: __Log_condition_violated__
err-lit: FAILED to match("ham")
err-lit: ..before match("beans") @ Rec(EventLogHeader| this = baked beans )
err-lit: ..before match("spam") @ Rec(event|{spam})
err-lit: ..after HEAD baked beans
err-lit: __Log_condition_violated__
err-lit: FAILED to match("spam")
err-lit: ..before match("spam") @ Rec(event|{spam})
err-lit: ..before match("ham") @ Rec(event|{ham})
err-lit: ..before match("beans") @ Rec(EventLogHeader| this = baked beans )
err-lit: ..after HEAD baked beans
err-lit: __Log_condition_violated__
err-lit: FOUND at least match("ham") @ Rec(event|{ham})
err-lit: ..after match("eggs") @ Rec(EventLogHeader| this = eggs )
err-lit: ..before match("spam") @ Rec(event|{spam})
err-lit: ..after match("spam") @ Rec(event|{spam})
err-lit: ..after HEAD eggs
err-lit: __Log_condition_violated__
err-lit: FAILED to match("some")
err-lit: ..before match-event("fun") @ Rec(event| ID = no |{fun})
err-lit: ..after HEAD event trace
err-lit: __Log_condition_violated__
err-lit: FAILED to match-event("stuff")
err-lit: ..after HEAD theHog
err-lit: __Log_condition_violated__
err-lit: FAILED to match-event("danger")
err-lit: ..after HEAD theHog
return: 0
END
TEST "Testsuite option handling" TestOption_test <<END
out-lit: Testing invocation with cmdline: ...
out-lit: --> Testgroup=ALL
out-lit: --> Test-ID =--missing--
out-lit: --> remaining=
out-lit: Testing invocation with cmdline: --help...
out-lit: --> Testgroup=ALL
out-lit: --> Test-ID =--missing--
out-lit: --> remaining=
out-lit: Testing invocation with cmdline: --group TestGroupID...
out-lit: --> Testgroup=TestGroupID
out-lit: --> Test-ID =--missing--
out-lit: --> remaining=
out-lit: Testing invocation with cmdline: SingleTestID...
out-lit: --> Testgroup=ALL
out-lit: --> Test-ID =SingleTestID
out-lit: --> remaining=SingleTestID
out-lit: Testing invocation with cmdline: SingleTestID --group TestGroupID...
out-lit: --> Testgroup=TestGroupID
out-lit: --> Test-ID =SingleTestID
out-lit: --> remaining=SingleTestID
out-lit: Testing invocation with cmdline: --group TestGroupID SingleTestID ...
out-lit: --> Testgroup=TestGroupID
out-lit: --> Test-ID =SingleTestID
out-lit: --> remaining=SingleTestID
out-lit: Testing invocation with cmdline: --group TestGroupID SingleTestID spam eggs...
out-lit: --> Testgroup=TestGroupID
out-lit: --> Test-ID =SingleTestID
out-lit: --> remaining=SingleTestID spam eggs
out: Testing invocation with cmdline: .+SingleTestID spam --group TestGroupID.+--eggs...
out-lit: --> Testgroup=TestGroupID
out-lit: --> Test-ID =SingleTestID
out-lit: --> remaining=SingleTestID spam --eggs
out-lit: Testing invocation with cmdline: ham --group spam...
out-lit: --> Testgroup=spam
out-lit: --> Test-ID =ham
out-lit: --> remaining=ham
out-lit: Testing invocation with cmdline: ham --seed 7 spam...
out-lit: --> Testgroup=ALL
out-lit: --> Test-ID =ham
out-lit: --> remaining=ham spam
out-lit: Testing invocation with cmdline: ham --seed 0 spam...
out-lit: --> Testgroup=ALL
out-lit: --> Test-ID =ham
out-lit: --> remaining=ham spam
out-lit: Testing invocation with cmdline: ham --seed spam...
out-lit: Testing invocation with cmdline: --seed=-1...
out-lit: --> Testgroup=ALL
out-lit: --> Test-ID =--missing--
out-lit: --> remaining=
return: 0
END
TEST "Object and allocation tracking" TestTracking_test <<END
return: 0
END