stuff-from-scratch/test/test_utils/TestCaseRunner.h
2022-12-06 18:02:43 +00:00

28 lines
567 B
C++

#pragma once
#include "TestCase.h"
#include <vector>
#include <string>
class TestCaseRunner
{
public:
TestCaseRunner();
static TestCaseRunner& getInstance();
~TestCaseRunner();
void addTestCase(const std::string& label, const std::string& tag, TestCase::TestCaseFunction func);
void markTestFailure(const std::string& line);
bool run(const std::vector<std::string>& args);
private:
std::vector<std::string> mFailingTests;
static bool sLastTestFailed;
static std::string sFailureLine;
std::vector<TestCase*> mCases;
};