ZeroErr
载入中...
搜索中...
未找到
zeroerr::UnitTest结构体 参考

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

#include <unittest.h>

zeroerr::UnitTest 的协作图:

Public 成员函数

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

Public 属性

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
 

详细描述

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.

成员函数说明

◆ parseArgs()

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

Parse the arguments to configure the test.

参数
argcThe number of arguments.
argvThe arguments.
返回
UnitTest& The test configuration.

◆ run()

int zeroerr::UnitTest::run ( )

Run the test.

返回
int 0 if the test passed.

◆ run_filter()

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

Run the test with the given filter.

参数
tcThe test case that will be run.
返回
true If the test passed.
false If the test failed.

类成员变量说明

◆ 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

该结构体的文档由以下文件生成: