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 成员函数

UnitTest & parseArgs (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
 
zeroerr::String list_format = "console"
 
bool no_color = false
 
bool log_to_report = false
 
bool show_help = false
 
bool invalid_args = false
 
zeroerr::String correct_output_path
 
zeroerr::String reporter_name = "console"
 
zeroerr::String binary
 
struct Filters * filters = nullptr
 

详细描述

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.
  • list_format : The format used when listing test cases ("console" or "plain").
  • 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.
  • show_help : If true, print the command line usage and exit.
  • invalid_args : If true, a command line argument could not be parsed.
  • 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

zeroerr::String zeroerr::UnitTest::binary

◆ correct_output_path

zeroerr::String zeroerr::UnitTest::correct_output_path

◆ filters

struct Filters* zeroerr::UnitTest::filters = nullptr

◆ invalid_args

bool zeroerr::UnitTest::invalid_args = false

◆ list_format

zeroerr::String zeroerr::UnitTest::list_format = "console"

◆ 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

zeroerr::String zeroerr::UnitTest::reporter_name = "console"

◆ run_bench

bool zeroerr::UnitTest::run_bench = false

◆ run_fuzz

bool zeroerr::UnitTest::run_fuzz = false

◆ show_help

bool zeroerr::UnitTest::show_help = false

◆ silent

bool zeroerr::UnitTest::silent = false

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