testsuite.cpp

来自「This software aims to create an applet a」· C++ 代码 · 共 50 行

CPP
50
字号
//
// TestSuite.cpp
//
// $Id: //poco/Main/CppUnit/src/TestSuite.cpp#5 $
//


#include "CppUnit/TestSuite.h"
#include "CppUnit/TestResult.h"


CppUnit_BEGIN


// Deletes all tests in the suite.
void TestSuite::deleteContents()
{
	for (std::vector<Test*>::iterator it = _tests.begin(); it != _tests.end(); ++it)
		delete *it;
}


// Runs the tests and collects their result in a TestResult.
void TestSuite::run(TestResult *result)
{
	for (std::vector<Test*>::iterator it = _tests.begin(); it != _tests.end(); ++it) 
	{
		if (result->shouldStop ())
			break;

		Test *test = *it;
		test->run(result);
	}
}


// Counts the number of test cases that will be run by this test.
int TestSuite::countTestCases()
{
	int count = 0;

	for (std::vector<Test*>::iterator it = _tests.begin (); it != _tests.end (); ++it)
		count += (*it)->countTestCases();

	return count;
}


CppUnit_END

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?