Пример #1
0
int main() {
	int success = 0;
	int failed = 0;
	int result;

	for (std::vector<TestCase*>::iterator test = t.tests.begin(); test != t.tests.end(); test++) {
		std::cout << "Test: " << (*test)->name;
		result = (*test)->run();
		if (result) {
			failed++;
			std::cout << " (failed)." << std::endl;
		} else {
			success++;
			std::cout << " (ok)." << std::endl;
		}
	}

	// Print summary
	std::cout << std::endl;
	std::cout << "Summary (" << t.size() << " tests):" << std::endl;
	std::cout << "Success: " << success << " Failed: " << failed << std::endl;
}