本文整理汇总了C++中TestResult::merge方法的典型用法代码示例。如果您正苦于以下问题:C++ TestResult::merge方法的具体用法?C++ TestResult::merge怎么用?C++ TestResult::merge使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestResult
的用法示例。
在下文中一共展示了TestResult::merge方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: run_suite
void TestSuite::run_suite(
const IFilter& filter,
ITestListener& test_listener,
TestResult& test_suite_result,
TestResult& cumulated_result) const
{
TestResult local_cumulated_result(cumulated_result);
local_cumulated_result.merge(test_suite_result);
bool has_begun_suite = false;
for (size_t i = 0; i < impl->m_factories.size(); ++i)
{
ITestCaseFactory& factory = *impl->m_factories[i];
// Skip test cases that aren't let through by the filter.
if (!filter.accepts(factory.get_name()))
continue;
if (!has_begun_suite)
{
// Tell the listener that a test suite is about to be executed.
test_listener.begin_suite(*this);
test_suite_result.signal_suite_execution();
has_begun_suite = true;
}
// Tell the listener that a test case is about to be executed.
test_listener.begin_case(*this, factory.get_name());
// Instantiate and run the test case.
TestResult test_case_result;
run_case(factory, test_listener, test_case_result);
// Accumulate the test results.
test_suite_result.merge(test_case_result);
local_cumulated_result.merge(test_case_result);
// Tell the listener that the test case execution has ended.
test_listener.end_case(
*this,
factory.get_name(),
test_suite_result,
test_case_result,
local_cumulated_result);
}
if (has_begun_suite)
{
// Report a test suite failure if one or more test cases failed.
if (test_suite_result.get_case_failure_count() > 0)
test_suite_result.signal_suite_failure();
// Tell the listener that the test suite execution has ended.
test_listener.end_suite(
*this,
test_suite_result,
cumulated_result);
}
}
示例2: run
void TestSuite::run(
const IFilter& filter,
ITestListener& test_listener,
TestResult& cumulated_result) const
{
TestResult test_suite_result;
run_suite(
filter,
test_listener,
test_suite_result,
cumulated_result);
cumulated_result.merge(test_suite_result);
}
示例3: run
void TestSuite::run(
const IFilter& filter,
ITestListener& test_listener,
TestResult& cumulated_result) const
{
// Run the test suite.
TestResult test_suite_result;
run_suite(
filter,
test_listener,
test_suite_result,
cumulated_result);
// Accumulate the results.
cumulated_result.merge(test_suite_result);
}