void CppUnitTestHelper::listTest (CPPUNIT_NS::Test * rootTest)
{
   CppUnitTestHelper::argc = 1;
   CPPUNIT_NS::Test * subTest;
   fprintf (stderr, "Test list:\n");
   for (int i = 0, m = 0; m < rootTest->countTestCases (); ++i) {
      subTest = rootTest->getChildTestAt (i);
      fprintf (stderr, "Find test '%s'\n", subTest->getName ().c_str ());
      for (int ii = 0; ii < subTest->countTestCases (); ++ii, ++m) {
         fprintf (stderr, "Find sub test '%s'\n", subTest->getChildTestAt (ii)->getName ().c_str ());
      }
   }
}
Example #2
0
std::string CppUnitTestRunner::Help(CPPUNIT_NS::Test * test, int level)
{
    std::stringstream s;
    for (int i = 0; i < test->getChildTestCount(); i++)
    {
        s << std::endl;
		if (0 < level)
		{
			std::string spaces(level, ' ');
			s << spaces;
		}
		CPPUNIT_NS::Test * child = test->getChildTestAt(i);
		s << child->getName();
		s << Help(child, level + 1);
    }
    return s.str();
}
Example #3
0
void 
TestRunnerModel::saveSettings( const Settings & s )
{
  CWinApp *app = AfxGetApp();
  ASSERT( app != NULL );

  int autorun = s.autorunOnLaunch ? 1 : 0;
  app->WriteProfileInt( _T("CppUnit"), _T("AutorunAtStartup"), autorun );

  app->WriteProfileInt( _T("CppUnit"), _T("Col_1"),	 s.col_1 );
  app->WriteProfileInt( _T("CppUnit"), _T("Col_2"),	 s.col_2 );
  app->WriteProfileInt( _T("CppUnit"), _T("Col_3"),	 s.col_3 );
  app->WriteProfileInt( _T("CppUnit"), _T("Col_4"),	 s.col_4 );

  int idx = 1;
  for ( History::const_iterator it = m_history.begin(); 
        it != m_history.end(); 
        ++it , ++idx )
  {
    CPPUNIT_NS::Test *test = *it;
    saveHistoryEntry( idx, test->getName().c_str() );
  }
}