1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 15:17:36 +00:00

LibTest: Expand test result bool to a TestResult

This will be used in the randomized tests a lot more than it is in the
unit tests / benchmarks; randomized tests will run the test function
multiple times, check the result and optionally start shrinking the
failing input. Generators will also be able to fail, resulting in some
of the new TestResult variants.
This commit is contained in:
Martin Janiczek 2023-10-24 00:19:04 +02:00 committed by Andrew Kaster
parent 5a7f43ad38
commit a60e3b17b1
4 changed files with 133 additions and 38 deletions

View file

@ -0,0 +1,26 @@
/*
* Copyright (c) 2023, Martin Janiczek <martin@janiczek.cz>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
namespace Test {
// TestResult signals to the TestSuite how the TestCase execution went.
enum class TestResult {
NotRun,
// Test fn ran to completion without setting any of the below flags
Passed,
// Didn't get through EXPECT(...).
Failed,
};
// Used eg. to signal we've ran out of prerecorded random bits.
// Defined in TestSuite.cpp
void set_current_test_result(TestResult);
} // namespace Test