1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:48:12 +00:00
serenity/Userland/Libraries/LibTest
Martin Janiczek ba20ddb834 LibTest: Add the GEN macro
Generators are callable as-is:

u32 my_int = Gen::unsigned_int(); // -> 1, 5, 8, 3, 2

But there is little visibility in the test fail message into what went
wrong. Showing what values were generated helps a lot, and that's what
this macro does:

GEN(my_int, Gen::unsigned_int());

expands into the above declaration and (crucially) a conditional
warnln() call looking like "my_int = {}". It will only run if error
reporting is enabled (see Test::can_report()), so it will only give the
final shrunk value instead of spamming the output with each generated
value.
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 LibTest: Add the GEN macro 2023-10-26 17:26:52 -06: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