1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:58:11 +00:00
serenity/Userland/Libraries/LibTest/TestResult.h
Martin Janiczek 7e5a3650fe LibTest: Add the RandomnessSource abstraction
This will be a foundational part of bootstrapping generators: this is
the way they'll get prerecorded values from / record random values into
RandomRuns. (Generators don't get in contact with RandomRuns
themselves, they just interact with the RandomnessSource.)
2023-10-26 17:26:52 -06:00

30 lines
690 B
C++

/*
* 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,
// Ran out of RandomRun data (in a randomized test, when shrinking).
// This is fine, we'll just try some other shrink.
Overrun,
};
// Used eg. to signal we've ran out of prerecorded random bits.
// Defined in TestSuite.cpp
void set_current_test_result(TestResult);
} // namespace Test