refactor: make test a header

This commit is contained in:
Rendo 2026-09-02 19:58:30 +05:00
commit 92c39f13a6

View file

@ -1,4 +1,6 @@
#include <iostream> #ifndef RENDO_TEST_HPP
#define RENDO_TEST_HPP
#include <string> #include <string>
#include <vector> #include <vector>
#include <functional> #include <functional>
@ -12,7 +14,6 @@ class Test {
bool evaluate(); bool evaluate();
}; };
bool Test::evaluate() { return complete(); }
class TestSuite { class TestSuite {
private: private:
@ -30,6 +31,12 @@ class TestSuite {
TestSuite& custom(std::string, std::function<bool()>); TestSuite& custom(std::string, std::function<bool()>);
}; };
#ifdef RENDO_TEST_IMPLEMENTATION
#include <iostream>
bool Test::evaluate() { return complete(); }
TestSuite::TestSuite(std::string name): suite_name(name) { TestSuite::TestSuite(std::string name): suite_name(name) {
tests = {}; 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; std::cout << "Tests completed: " << completed << "/" << amount << (completed == amount ? ". Well done!" : "... You've got a job to do") << std::endl;
} }
#endif
#endif