1#ifndef JON_TEST_TEST_SUITE_TYPED_H
2#define JON_TEST_TEST_SUITE_TYPED_H
27template <
typename TestSuiteDerived>
42 std::map<std::string, TestCase<TestSuite>>
cases;
69 const std::string& caseName
78 const char*
const testCaseName,
93 std::vector<std::string>
names;
100 for(
const auto& name :
names)
102 out <<
"\t" <<
suiteName <<
":" << name <<
"\n";
Count of tests run, and fails.
int fails
Number of tests that have failed.
int count
Number of tests that have been run.
Interface for logging events while running tests.
Defines and runs a single Test Case within a Test Suite.
bool run(TestSuite &suite, Logger &logger) const
Run this Test Case as part of suite, logging events to logger.
void add(const char *const name, TestSuiteInterface *const suite)
Add the suite by name.
static TestRunner & get()
Get the singleton.
Interface for Test Suites.
Holds and runs Test Cases as a single Test Suite.
void(TestSuite::* TestCaseMethod)()
The actual Test Suite Method type for test cases.
const std::string & getName() const
Returns the name of this Test Suit.
virtual ~TestSuiteTyped()
void add(const char *const testCaseName, TestCaseMethod const testCaseMethod)
Add TestCaseMethod by name to this Test Suite.
TestSuiteDerived TestSuite
The actual Test Suite class.
virtual int listTestCases(std::ostream &out) const
List available Test Cases to out.
virtual Count run(Logger &logger)
Run all Test Cases in the Test Suite giving events to logger.
virtual bool isValid(const std::string &caseName) const
TestSuiteTyped(const char *const suiteName)
Create the Test Suite by name and add it to the TestRunner singleton.
std::map< std::string, TestCase< TestSuite > > cases
Map of Test Case name to TestCase<TestSuite> cases.
virtual Count run(Logger &logger, const std::string &testCase)
Runs the given testCase in this Test Suite.
const std::string suiteName
Name of this Test Suite.