本文整理汇总了C++中TestSuite::reset方法的典型用法代码示例。如果您正苦于以下问题:C++ TestSuite::reset方法的具体用法?C++ TestSuite::reset怎么用?C++ TestSuite::reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestSuite
的用法示例。
在下文中一共展示了TestSuite::reset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char ** argv)
{
int i;
vector<string> cpps;
string class_dir;
TestSuite t;
//If they did not provide the minimum set of args
if( argc < 3 )
{
cout << "Usage: ./tester [-g|-r] [directory]" << endl;
cout << " -g: Generate test cases from \"golden\" .cpp" << endl;
cout << " -r: Run tests on student programs." << endl;
return -1;
}
class_dir = argv[2];
if(chdir(argv[2]))
{
cout << "Failed to change to directory: " << class_dir;
}
//Choose one of two modes. [R]unning tests or [G]enerating tests.
string flag = argv[1];
if(flag == "-g")
{
//Call test generation function
t.helper_func();
}
else if(flag == "-r")
{
//fill "cpps" with the name of every .cpp to be ran
t.dirCrawl(".cpp", ".", cpps);
//loop through every .cpp and run it
for(i=0;i<cpps.size();i++)
{
//Excludes the "golden" .cpp from being evaluated
if(count(cpps.at(i).begin(), cpps.at(i).end(), '/') > 1)
{
//t.initTest(argv[1],".tst",".ans");
t.initTest( cpps.at(i) ,".tst",".ans");
t.runTests();
t.outputLogFile();
t.reset();
}
}
//end for loop
t.createSummary();
}
else
{
cout << "Unrecognized command line option. [-g|-r]" << endl;
return -2;
}
return 0;
}