Beispiel #1
0
void TestMain::RunSuite()
{
	CONSOLE("*****************************************\n");	
	CONSOLE("*              Unit Tests               *\n");
	CONSOLE("*****************************************\n");
	CONSOLE("Creating Test Suite.\n");
	CreateSuite();
	int testCnt;
	for(testCnt = 0; m_tests[testCnt] != 0; testCnt++);
	CONSOLE("Found %d Test(s).\n", testCnt);

	CONSOLE("Running Test Suite.\n\n");
	for(int i = 0; i<testCnt; i++)
	{	
		//CONSOLE("Starting %s.\n", m_tests[i]->GetTestName());
		CONSOLE("------[ %s ]------\n", m_tests[i]->GetTestName());
		m_tests[i]->Setup();
		m_tests[i]->RunTest();
		m_tests[i]->TearDown();
		CONSOLE("%s Completed.\n\n", m_tests[i]->GetTestName());
	}

	CONSOLE("*****************************************\n");
	CONSOLE("*           Testing Complete            *\n");
	CONSOLE("*****************************************\n");
}
Beispiel #2
0
int RunCheck()
{ 
  Suite *s = CreateSuite ();
  SRunner *sr = srunner_create (s);
  srunner_set_fork_status(sr, CK_NOFORK);
  srunner_run_all (sr, CK_NORMAL);
  srunner_free (sr);
  return 0;
}