stuff-from-scratch/test/test_utils/TestCaseRunner.h
2023-01-05 16:40:27 +00:00

35 lines
745 B
C++

#pragma once
#include "TestCase.h"
#include <vector>
#include <string>
class TestUiApplication;
class TestCaseRunner
{
public:
TestCaseRunner();
static TestCaseRunner& getInstance();
~TestCaseRunner();
TestUiApplication* getTestApplication();
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);
void setTestApplication(TestUiApplication* app);
private:
TestUiApplication* mTestApplication{ nullptr };
std::vector<std::string> mFailingTests;
static bool sLastTestFailed;
static std::string sFailureLine;
std::vector<TestCase*> mCases;
};