Max OS 0.3
Loading...
Searching...
No Matches
MaxOS::tests::TestRunner Class Reference

A class to run all tests. More...

#include <test.h>

Static Public Member Functions

static void test_kernel ()
 Setups the TestRunner and runs all kernel tests.
 
static void run_all_tests ()
 Runs all registered tests.
 
static void run_all_types (TestType type)
 Runs all tests of a specific type.
 
static void add_all_tests ()
 Adds all predefined tests to the test runner.
 
static void add_test (Test *test)
 Adds a test to the test runner.
 

Detailed Description

A class to run all tests.

Todo:
Revisit when cbf

Definition at line 133 of file test.h.

Member Function Documentation

◆ add_all_tests()

void TestRunner::add_all_tests ( )
static

Adds all predefined tests to the test runner.

Definition at line 145 of file test.cpp.

145 {
146 register_tests_common();
147}

Referenced by test_kernel().

◆ add_test()

void TestRunner::add_test ( Test test)
static

Adds a test to the test runner.

Parameters
testThe test to add

Definition at line 138 of file test.cpp.

138 {
139 s_tests.push_back(test);
140}

Referenced by MaxOS::tests::Test::Test().

◆ run_all_tests()

void TestRunner::run_all_tests ( )
static

Runs all registered tests.

Definition at line 116 of file test.cpp.

116 {
117 Logger::TEST() << "Running all tests... (" << (int )s_tests.size() << " tests found)\n";
118 for (auto& test : s_tests)
119 test->run();
120}
static Logger TEST()
Gets active logger set to test level.
Definition logger.cpp:182

References MaxOS::Logger::TEST().

Referenced by test_kernel().

◆ run_all_types()

void TestRunner::run_all_types ( TestType  type)
static

Runs all tests of a specific type.

Parameters
typeThe type of tests to run

Definition at line 127 of file test.cpp.

127 {
128 for (auto& test : s_tests)
129 if (test->type() == type)
130 test->run();
131}

◆ test_kernel()

void TestRunner::test_kernel ( )
static

Setups the TestRunner and runs all kernel tests.

Definition at line 152 of file test.cpp.

152 {
153
154 // Add all tests
155 s_tests = common::Vector<Test*>();
157
158 // Run all system tests
160
161}
static void run_all_tests()
Runs all registered tests.
Definition test.cpp:116
static void add_all_tests()
Adds all predefined tests to the test runner.
Definition test.cpp:145

References add_all_tests(), and run_all_tests().


The documentation for this class was generated from the following files: