Hegel 0.3.5
Property-based testing for C++
Loading...
Searching...
No Matches
internal.h
1#pragma once
2
3#include <exception>
4
5#include "json.h"
6
7namespace hegel {
8 class TestCase;
9}
10
14namespace hegel::internal {
16 hegel::internal::json::json
17 communicate_with_core(const hegel::internal::json::json& schema,
18 const hegel::TestCase& tc);
19
20 /* Exception thrown when a test case is rejected and should be
21 * discarded (e.g. by `TestCase::assume(false)`, an exhausted
22 * `filter()`, or an `UnsatisfiedAssumption` from the server).
23 * The runner records the case as INVALID and continues.
24 */
25 class HegelReject : public std::exception {
26 public:
27 const char* what() const noexcept override {
28 return "test case rejected";
29 }
30 };
31
32 /* Exception thrown when the backend tells us to abandon the current
33 * test iteration entirely (StopTest, Overflow, FlakyStrategyDefinition,
34 * FlakyReplay). The runner unwinds the test body and skips
35 * `mark_complete` — the server already knows the iteration is over.
36 */
37 class HegelStopTest : public std::exception {
38 public:
39 const char* what() const noexcept override {
40 return "test case stopped by backend";
41 }
42 };
43
44} // namespace hegel::internal
45
Handle to the currently-executing test case.
Definition test_case.h:34
Main namespace.
Definition core.h:16