libwreport 3.40
|
Test case that includes a fixture. More...
#include <tests.h>
Public Types | |
typedef FIXTURE | Fixture |
Public Member Functions | |
template<typename... Args> | |
FixtureTestCase (const std::string &name_, Args... args) | |
FixtureTestCase (const FixtureTestCase &)=delete | |
FixtureTestCase (FixtureTestCase &&)=delete | |
FixtureTestCase & | operator= (const FixtureTestCase &)=delete |
FixtureTestCase & | operator= (FixtureTestCase &)=delete |
void | setup () override |
Set up the test case before it is run. | |
void | teardown () override |
Clean up after the test case is run. | |
void | method_setup (TestMethodResult &mr) override |
Set up before the test method is run. | |
void | method_teardown (TestMethodResult &mr) override |
Clean up after the test method is run. | |
template<typename... Args> | |
TestMethod & | add_method (const std::string &name_, std::function< void(FIXTURE &)> test_function) |
Register a new test method that takes a reference to the fixture as argument. | |
template<typename... Args> | |
TestMethod & | add_method (const std::string &name_, const std::string &doc, std::function< void(FIXTURE &)> test_function) |
Register a new test method that takes a reference to the fixture as argument, including documentation. | |
![]() | |
TestCase (const std::string &name) | |
void | register_tests_once () |
Idempotent wrapper for register_tests() | |
virtual void | register_tests ()=0 |
This will be called before running the test case, to populate it with its test methods. | |
virtual void | test_setup () |
Set up before each test method is run. | |
virtual void | test_teardown () |
Clean up after each test method is run. | |
virtual TestCaseResult | run_tests (TestController &controller) |
Call setup(), run all the tests that have been registered, then call teardown(). | |
virtual TestMethodResult | run_test (TestController &controller, TestMethod &method) |
Run a test method. | |
TestMethod & | add_method (const std::string &name_) |
Register a new test method, with the actual test function to be added later. | |
template<typename... Args> | |
TestMethod & | add_method (const std::string &name_, std::function< void()> test_function) |
Register a new test method. | |
template<typename... Args> | |
TestMethod & | add_method (const std::string &name_, const std::string &doc, std::function< void()> test_function) |
Register a new test method, including documentation. | |
Data Fields | |
Fixture * | fixture = nullptr |
std::function< Fixture *()> | make_fixture |
![]() | |
std::string | name |
Name of the test case. | |
std::vector< TestMethod > | methods |
All registered test methods. | |
bool | tests_registered = false |
Set to true the first time register_tests_once is run. | |
Test case that includes a fixture.
|
inlineoverridevirtual |
Set up before the test method is run.
Reimplemented from wreport::tests::TestCase.
References wreport::tests::TestCase::method_setup().
|
inlineoverridevirtual |
Clean up after the test method is run.
Reimplemented from wreport::tests::TestCase.
References wreport::tests::TestCase::method_teardown().
|
inlineoverridevirtual |
Set up the test case before it is run.
Reimplemented from wreport::tests::TestCase.
References wreport::tests::TestCase::setup().
|
inlineoverridevirtual |
Clean up after the test case is run.
Reimplemented from wreport::tests::TestCase.
References wreport::tests::TestCase::teardown().