Files
Library/include/Void/Testing/ConsoleReporter.hpp
T
faumarayandClaude Sonnet 4.6 a09e000f0f Add Hash, Random, Uuid, Encoding, Bits, Math modules + make Testing deps optional
New header-only modules:
- Void::Hash — FNV-1a 32/64, CRC-32, DJB2, MurmurHash3-32, UDL literals
- Void::Random — Xoshiro256** PRNG, uniform_int/real, coin_flip, shuffle, random_string
- Void::Uuid — v4 (random), v5_lite (name-based), parse, RFC 4122 namespaces
- Void::Encoding — Base64 (standard + URL-safe), Hex encode/decode
- Void::Bits — popcount, bit extract/deposit, rotation, align, byteswap, masks
- Void::Math — Vec2/Vec3/Vec4, Mat4 (identity, translation, scale, rotation)

Testing module: move Stacktrace from INTERNAL_DEPS to OPTIONAL_DEPS. Added
Detail/Color.hpp shim that delegates to Stacktrace::Color when present or
provides inline ANSI fallback otherwise. All Stacktrace calls in SignalHandler,
ConsoleReporter, and Runner are gated on VOID_HAS_STACKTRACE.

Fix Repr.hpp reflect_struct to handle template specializations that lack
std::meta::identifier_of (now guarded by has_identifier check).

33/33 tests pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 21:52:22 +03:00

24 lines
915 B
C++

#pragma once
#include <Void/Testing/Reporter.hpp>
#include <Void/Testing/Detail/Color.hpp>
#include <ostream>
namespace Void::Testing {
class ConsoleReporter final : public Reporter {
public:
explicit ConsoleReporter(std::ostream& os, bool color_enabled = true) : os_(os) {
Void::Testing::Detail::Color::g_color_enabled = color_enabled;
}
void on_run_start(const RunConfig& config, int total_tests) override;
void on_suite_start(const std::string& suite_name, int test_count) override;
void on_test_start(const TestCase& test) override;
void on_test_end(const TestResult& result) override;
void on_suite_end(const SuiteResult& result) override;
void on_run_end(const RunResult& result) override;
private:
std::ostream& os_;
void print_assertion_failure(const AssertionResult& ar);
void print_crash_info(const TestResult& result);
};
} // namespace Void::Testing