(vibe) Added testframework
This commit is contained in:
54
douwco_hivemind/include/Testing/TestHarness.hpp
Normal file
54
douwco_hivemind/include/Testing/TestHarness.hpp
Normal file
@@ -0,0 +1,54 @@
|
||||
#ifndef DOUWCO_HIVEMIND_TEST_HARNESS_HPP
|
||||
#define DOUWCO_HIVEMIND_TEST_HARNESS_HPP
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
namespace DouwcoHivemind::Testing
|
||||
{
|
||||
class TestResult
|
||||
{
|
||||
public:
|
||||
std::string testName;
|
||||
bool passed;
|
||||
std::string message;
|
||||
|
||||
TestResult(const std::string& name, bool success, const std::string& msg = "")
|
||||
: testName(name), passed(success), message(msg) {}
|
||||
};
|
||||
|
||||
class TestHarness
|
||||
{
|
||||
private:
|
||||
static std::vector<TestResult> testResults;
|
||||
|
||||
public:
|
||||
static void runAllTests();
|
||||
static void addTestResult(const TestResult& result);
|
||||
static std::string getTestResults();
|
||||
static int getPassedCount();
|
||||
static int getFailedCount();
|
||||
static int getTotalCount();
|
||||
|
||||
// Test categories
|
||||
static void runCreepTests();
|
||||
static void runWorkerTests();
|
||||
static void runSupplierTests();
|
||||
static void runPathTests();
|
||||
static void runSpawnTests();
|
||||
static void runUtilityTests();
|
||||
};
|
||||
|
||||
// Mock classes for testing
|
||||
namespace Mocks
|
||||
{
|
||||
class MockCreep;
|
||||
class MockRoom;
|
||||
class MockSource;
|
||||
class MockStructure;
|
||||
class MockGame;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // DOUWCO_HIVEMIND_TEST_HARNESS_HPP
|
||||
Reference in New Issue
Block a user