ladybird/Libraries/LibTest
ayeteadoe 744fd91d0b LibTest: Support death tests without child process cloning
A challenge for getting LibTest working on Windows has always
been CrashTest. It implements death tests similar to Google Test
where a child process is cloned to invoke the expression that
should abort/terminate the program. Then the exit code of the
child is used by the parent test process to verify if the
application correctly aborted/terminated due to invoking
the expression.

The problem was that finding an equivalent way to port Crash::run()
to Windows was not looking very likely as publicly exposed Win32/
Native APIs have no equivalent to fork(); however, Windows actually
does have native support for process cloning via undocumented NT
APIs that clever people reverse engineered and published, see
`NtCreateUserProcess()`.

All that being said, this `EXPECT_DEATH()` implementation avoids
needing to use a child process in general, allowing us to remove
CrashTest in favour of a single cross-platform solution for death
tests.
2025-05-16 13:23:32 -06:00
..
Randomized Everywhere: Remove sv suffix from format string literals 2025-04-08 20:00:18 -04:00
AssertionHandler.cpp LibTest: Support death tests without child process cloning 2025-05-16 13:23:32 -06:00
AssertionHandler.h LibTest: Support death tests without child process cloning 2025-05-16 13:23:32 -06:00
CMakeLists.txt LibTest: Support death tests without child process cloning 2025-05-16 13:23:32 -06:00
CrashTest.cpp Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
CrashTest.h LibTest: Explicitly export symbols 2025-05-16 13:23:32 -06:00
JavaScriptTestRunner.h LibJS: Make Value() default-construct the undefined value 2025-04-05 11:20:26 +02:00
JavaScriptTestRunnerMain.cpp LibJS+LibWeb: Do not return error from VM::create 2025-04-25 14:07:51 +02:00
Macros.h LibTest: Support death tests without child process cloning 2025-05-16 13:23:32 -06:00
Results.h AK+Everywhere: Remove now-unecessary use of ByteString with JSON types 2025-02-20 19:27:51 -05:00
TestCase.h LibTest: Support death tests without child process cloning 2025-05-16 13:23:32 -06:00
TestMain.cpp Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
TestResult.h LibTest: Explicitly export symbols 2025-05-16 13:23:32 -06:00
TestRunner.h AK+Everywhere: Convert JSON value serialization to String 2025-02-20 19:27:51 -05:00
TestRunnerUtil.h LibTest: Remove uses of gettimeofday in favor of AK::Time 2025-02-12 19:13:49 -07:00
TestSuite.cpp LibTest: Support death tests without child process cloning 2025-05-16 13:23:32 -06:00
TestSuite.h LibTest: Explicitly export symbols 2025-05-16 13:23:32 -06:00