#pragma once #include #include #include #include // This header is shared with the portable test target, which builds on a bare Linux runner with no // vcpkg tree and no engine headers. Keep it dependency-free; path helpers live in test_utf8_path.h. namespace test { struct TestCase { std::string name; std::function fn; }; std::vector ®istry(); struct Registrar { Registrar(const char *name, std::function fn); }; } // namespace test #define TEST_CASE(name) \ static void name(); \ static test::Registrar name##_registrar(#name, name); \ static void name() #define REQUIRE(expr) \ do \ { \ if (!(expr)) \ { \ throw std::runtime_error("Requirement failed: " #expr); \ } \ } while (false) #define REQUIRE_EQ(lhs, rhs) \ do \ { \ const auto &_lhs = (lhs); \ const auto &_rhs = (rhs); \ if (!(_lhs == _rhs)) \ { \ throw std::runtime_error("Requirement failed: " #lhs " == " #rhs); \ } \ } while (false)