stuff-from-scratch/test/test_utils/TestCaseRunner.h

36 lines
710 B
C
Raw Normal View History

2021-05-23 20:02:38 +00:00
#pragma once
#include "TestCase.h"
2023-12-18 10:16:31 +00:00
#include "Vector.h"
#include "String.h"
2021-05-23 20:02:38 +00:00
2023-01-05 16:40:27 +00:00
class TestUiApplication;
2023-01-05 13:16:52 +00:00
2021-05-23 20:02:38 +00:00
class TestCaseRunner
{
public:
2022-11-30 18:28:50 +00:00
TestCaseRunner();
2021-05-23 20:02:38 +00:00
2022-11-30 18:28:50 +00:00
static TestCaseRunner& getInstance();
2021-05-23 20:02:38 +00:00
2022-11-29 18:00:19 +00:00
~TestCaseRunner();
2023-12-18 10:16:31 +00:00
//TestUiApplication* getTestApplication();
2023-01-05 13:16:52 +00:00
2023-12-18 10:16:31 +00:00
void addTestCase(const String& label, const String& tag, TestCase::TestCaseFunction func);
2022-11-29 18:00:19 +00:00
2023-12-18 10:16:31 +00:00
void markTestFailure(const String& line);
2022-11-30 18:28:50 +00:00
2023-12-18 10:16:31 +00:00
bool run(const Vector<String>& args);
2021-05-23 20:02:38 +00:00
2023-12-18 10:16:31 +00:00
//void setTestApplication(TestUiApplication* app);
2021-05-23 20:02:38 +00:00
private:
2023-01-05 13:16:52 +00:00
2023-12-18 10:16:31 +00:00
//TestUiApplication* mTestApplication{ nullptr };
Vector<String> mFailingTests;
2022-11-30 18:28:50 +00:00
static bool sLastTestFailed;
2023-12-18 10:16:31 +00:00
static String sFailureLine;
Vector<TestCase*> mCases;
2021-05-23 20:02:38 +00:00
};