From 92c39f13a6607013c04a4ac78eb60b339e28d0c7 Mon Sep 17 00:00:00 2001 From: Rendo Date: Wed, 2 Sep 2026 19:58:30 +0500 Subject: [PATCH] refactor: make test a header --- test.cpp => test.hpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) rename test.cpp => test.hpp (95%) diff --git a/test.cpp b/test.hpp similarity index 95% rename from test.cpp rename to test.hpp index 809307e..88cf14e 100644 --- a/test.cpp +++ b/test.hpp @@ -1,4 +1,6 @@ -#include +#ifndef RENDO_TEST_HPP +#define RENDO_TEST_HPP + #include #include #include @@ -12,7 +14,6 @@ class Test { bool evaluate(); }; -bool Test::evaluate() { return complete(); } class TestSuite { private: @@ -30,6 +31,12 @@ class TestSuite { TestSuite& custom(std::string, std::function); }; + +#ifdef RENDO_TEST_IMPLEMENTATION + +#include +bool Test::evaluate() { return complete(); } + TestSuite::TestSuite(std::string name): suite_name(name) { tests = {}; } @@ -68,3 +75,7 @@ void TestSuite::run() { std::cout << "Tests completed: " << completed << "/" << amount << (completed == amount ? ". Well done!" : "... You've got a job to do") << std::endl; } + +#endif + +#endif