ZeroErr
zeroerr::UnitTest Struct Reference

UnitTest is a class that holds the test configuration. There are several options that can be set to configure the test. More...

#include <unittest.h>

Collaboration diagram for zeroerr::UnitTest:

Public Member Functions

UnitTestparseArgs (int argc, const char **argv)
 Parse the arguments to configure the test. More...
 
int run ()
 Run the test. More...
 
bool run_filter (const TestCase &tc)
 Run the test with the given filter. More...
 

Public Attributes

bool silent = false
 
bool run_bench = false
 
bool run_fuzz = false
 
bool list_test_cases = false
 
bool no_color = false
 
bool log_to_report = false
 
std::string correct_output_path
 
std::string reporter_name = "console"
 
std::string binary
 
struct Filtersfilters
 

Detailed Description

UnitTest is a class that holds the test configuration. There are several options that can be set to configure the test.

  • silent : If true, the test will not print the test results.
  • run_bench : If true, the test will run the benchmark tests.
  • run_fuzz : If true, the test will run the fuzz tests.
  • list_test_cases : If true, the test will list the test cases.
  • no_color : If true, the test will not print the test results with color.
  • log_to_report : If true, the test will log the test results to the report.
  • correct_output_path : The path that the golden files will be saved.
  • reporter_name : The name of the reporter that will be used to report the test results.
  • binary : The binary name that will be used to run the test.
  • filters : The filters that will be used to filter the test cases.

Member Function Documentation

◆ parseArgs()

UnitTest & zeroerr::UnitTest::parseArgs ( int  argc,
const char **  argv 
)

Parse the arguments to configure the test.

Parameters
argcThe number of arguments.
argvThe arguments.
Returns
UnitTest& The test configuration.

◆ run()

int zeroerr::UnitTest::run ( )

Run the test.

Returns
int 0 if the test passed.

◆ run_filter()

bool zeroerr::UnitTest::run_filter ( const TestCase tc)

Run the test with the given filter.

Parameters
tcThe test case that will be run.
Returns
true If the test passed.
false If the test failed.

Member Data Documentation

◆ binary

std::string zeroerr::UnitTest::binary

◆ correct_output_path

std::string zeroerr::UnitTest::correct_output_path

◆ filters

struct Filters* zeroerr::UnitTest::filters

◆ list_test_cases

bool zeroerr::UnitTest::list_test_cases = false

◆ log_to_report

bool zeroerr::UnitTest::log_to_report = false

◆ no_color

bool zeroerr::UnitTest::no_color = false

◆ reporter_name

std::string zeroerr::UnitTest::reporter_name = "console"

◆ run_bench

bool zeroerr::UnitTest::run_bench = false

◆ run_fuzz

bool zeroerr::UnitTest::run_fuzz = false

◆ silent

bool zeroerr::UnitTest::silent = false

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