23#ifndef SCTEST_SIMPLESUITE_H
24#define SCTEST_SIMPLESUITE_H
44 std::function<bool()>
test;
66 void Setup(std::function<
bool(
void)> setupFn) { fnSetup = setupFn; }
72 void Teardown(std::function<
bool(
void)> teardownFn) { fnTeardown = teardownFn; }
80 void AddTest(std::string label, std::function<
bool(
void)> test);
113 std::function<bool(
void)> fnSetup, fnTeardown;
114 std::vector<UnitTest> tests;
Unit test reporting class.
A Report holds test run results.
Definition Report.h:34
SimpleSuite is a test-running harness for simple tests.
Definition SimpleSuite.h:54
void Reset()
Reporting methods.
void Setup(std::function< bool(void)> setupFn)
Define a suite setup function.
Definition SimpleSuite.h:66
Report GetReport()
Retrieve the test run results.
void AddTest(std::string label, std::function< bool(void)> test)
Register a new simple test.
bool HasRun() const
Returns true if Run has been called.
bool Run()
Run all the registered tests.
void AddFailingTest(std::string label, std::function< bool(void)> test)
Register a test that is expected to return false.
void Teardown(std::function< bool(void)> teardownFn)
Define a teardown function.
Definition SimpleSuite.h:72
void Silence()
Silence suppresses output.
Shimmering Clarity testing library.
Definition sctest.h:34
std::ostream & operator<<(std::ostream &os, const Report &report)
UnitTest describes a single unit test.
Definition SimpleSuite.h:39
std::function< bool()> test
This is the test function to be run.
Definition SimpleSuite.h:44
bool expect
This is the value the test returns if it passes.
Definition SimpleSuite.h:47
std::string name
What name should be shown when running tests?
Definition SimpleSuite.h:41