#pragma once #include #include #include #include #include #include #include #include #include namespace Void::Testing { inline constexpr std::size_t kMaxRetainedAssertionsPerTest = 1000; inline constexpr std::size_t kMaxDiagnosticBytesPerTest = 1024ULL * 1024ULL; enum class AssertKind : uint8_t { Expect, Require, Assert }; enum class TestState : uint8_t { Passed, Failed, Skipped, Crashed }; struct AssertionResult { bool passed{true}; AssertKind kind{AssertKind::Expect}; std::string expression; std::string expected_repr; std::string actual_repr; std::string message; std::source_location location; static AssertionResult ok(std::source_location loc = std::source_location::current()) { return {.passed = true, .location = loc}; } }; struct TestCase { std::function run; std::string name; std::string suite; std::string file; int line{0}; bool disabled{false}; std::string skip_reason; std::vector tags; std::function fixture_create; std::function fixture_destroy; std::function fixture_setup; std::function fixture_teardown; }; struct TestResult { std::string name; std::string suite; TestState state{TestState::Passed}; std::chrono::nanoseconds duration{0}; std::vector assertions; std::string skip_reason; std::string crash_info; std::string stacktrace; std::vector tags; bool assertions_truncated{false}; std::size_t dropped_assertions{0}; std::size_t diagnostic_bytes{0}; std::string cleanup_error; }; struct SuiteResult { std::string name; std::vector tests; }; struct RunResult { std::vector suites; std::chrono::nanoseconds total_duration{0}; int passed{0}; int failed{0}; int skipped{0}; int crashed{0}; int total{0}; std::string config_error; }; struct RunConfig { std::string filter_pattern; std::string suite_filter; std::string reporter{"console"}; std::string output_file; std::string tag_filter; std::string log_file; bool list_only{false}; bool verbose{false}; bool no_color{false}; bool shuffle{false}; bool show_help{false}; bool allow_empty{false}; unsigned repeat{1}; unsigned random_seed{0}; unsigned parallel_threads{0}; // 0 = sequential std::string parse_error; std::string selftest_child; }; } // namespace Void::Testing