1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:48:11 +00:00
serenity/Userland/Libraries/LibTest
Martin Janiczek 00934bc344 LibTest: Add the REJECT and ASSUME macros
REJECT and ASSUME are useful for filtering out unwanted generated
values. While this is not ideal, it is ocassionally useful and so we
include it for convenience.

The main loop of RANDOMIZED_TEST_CASE runs the test case 100 times, each
time trying to generate a different set of values. Inside that loop, if
it sees a REJECT (ASSUME is implemented in terms of REJECT), it retries
up to 15 times before giving up (perhaps it's impossible or just very
improbable to generate a value that will survive REJECT or ASSUME).

REJECT("Reason for rejecting") will just outright fail, while
ASSUME(bool) is more of an equivalent of a .filter() method from
functional languages.
2023-10-26 17:26:52 -06:00
..
Randomized LibTest: Add a library of Generators 2023-10-26 17:26:52 -06:00
CMakeLists.txt Everywhere: Resolve conflicts with LibC and libc++ 2023-06-27 12:40:38 +02:00
CrashTest.cpp Tests, LibTest: Implement disabling core dumps on GNU Hurd 2023-09-06 11:41:16 -06:00
CrashTest.h Everywhere: Update copyrights with my new serenityos.org e-mail :^) 2023-07-15 16:21:29 +02:00
JavaScriptTestRunner.h AK+Everywhere: Remove the null state of DeprecatedString 2023-10-13 18:33:21 +03:30
JavaScriptTestRunnerMain.cpp LibTest: Don't attempt to use SA_NOCLDWAIT for SIGABRT 2023-09-06 11:41:16 -06:00
Macros.h LibTest: Add the REJECT and ASSUME macros 2023-10-26 17:26:52 -06:00
Results.h LibTest: Add support for xfail JavaScriptTestRunner tests 2023-07-23 07:36:13 +02:00
TestCase.h AK+Everywhere: Rename String to DeprecatedString 2022-12-06 08:54:33 +01:00
TestMain.cpp Everywhere: Remove NonnullRefPtr.h includes 2023-03-06 23:46:35 +01:00
TestResult.h LibTest: Add the REJECT and ASSUME macros 2023-10-26 17:26:52 -06:00
TestRunner.h LibTest: Add support for xfail JavaScriptTestRunner tests 2023-07-23 07:36:13 +02:00
TestRunnerUtil.h AK+Everywhere: Rename String to DeprecatedString 2022-12-06 08:54:33 +01:00
TestSuite.cpp LibTest: Add the REJECT and ASSUME macros 2023-10-26 17:26:52 -06:00
TestSuite.h LibTest: Add ability to turn test failure reporting on/off 2023-10-26 17:26:52 -06:00