ZeroErr
载入中...
搜索中...
未找到
zeroerr::TestContext类 参考

TestContext is a class that holds the test results and reporter context. There are 8 different matrices that are used to store the test results. 更多...

#include <unittest.h>

zeroerr::TestContext 的协作图:

Public 成员函数

int add (TestContext &local)
 Add the subtest results to the matrices.
 
void reset ()
 Reset the matrices to 0.
 
void save_output ()
 Save the output of the test to the correct_output_path as a golden file.
 
 TestContext (IReporter &reporter)
 Construct a new Test Context object
 
 ~TestContext ()=default
 

Public 属性

unsigned passed = 0
 
unsigned warning = 0
 
unsigned failed = 0
 
unsigned skipped = 0
 
unsigned passed_as = 0
 
unsigned warning_as = 0
 
unsigned failed_as = 0
 
unsigned skipped_as = 0
 
std::chrono::duration< double > duration = std::chrono::duration<double>::zero()
 
IReporterreporter
 

详细描述

TestContext is a class that holds the test results and reporter context. There are 8 different matrices that are used to store the test results.

  • passed : Number of passed tests
  • warning : Number of tests that passed with warning
  • failed : Number of failed tests
  • skipped : Number of skipped tests
  • passed_as : Number of passed tests in assertion
  • warning_as: Number of tests that passed with warning in assertion
  • failed_as : Number of failed tests in assertion
  • skipped_as: Number of skipped tests in assertion

构造及析构函数说明

◆ TestContext()

zeroerr::TestContext::TestContext ( IReporter reporter)
inline

Construct a new Test Context object

参数
reporterThe reporter object that will be used to report the test results.

◆ ~TestContext()

zeroerr::TestContext::~TestContext ( )
default

成员函数说明

◆ add()

int zeroerr::TestContext::add ( TestContext local)

Add the subtest results to the matrices.

参数
localThe local test context that will be added to the global context.
返回
int 0 if the test passed, 1 if the test passed with warning, 2 if the test failed.

◆ reset()

void zeroerr::TestContext::reset ( )

Reset the matrices to 0.

◆ save_output()

void zeroerr::TestContext::save_output ( )

Save the output of the test to the correct_output_path as a golden file.

类成员变量说明

◆ duration

std::chrono::duration<double> zeroerr::TestContext::duration = std::chrono::duration<double>::zero()

◆ failed

unsigned zeroerr::TestContext::failed = 0

◆ failed_as

unsigned zeroerr::TestContext::failed_as = 0

◆ passed

unsigned zeroerr::TestContext::passed = 0

◆ passed_as

unsigned zeroerr::TestContext::passed_as = 0

◆ reporter

IReporter& zeroerr::TestContext::reporter

◆ skipped

unsigned zeroerr::TestContext::skipped = 0

◆ skipped_as

unsigned zeroerr::TestContext::skipped_as = 0

◆ warning

unsigned zeroerr::TestContext::warning = 0

◆ warning_as

unsigned zeroerr::TestContext::warning_as = 0

该类的文档由以下文件生成: