本文整理汇总了C++中Tester::allTests方法的典型用法代码示例。如果您正苦于以下问题:C++ Tester::allTests方法的具体用法?C++ Tester::allTests怎么用?C++ Tester::allTests使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tester
的用法示例。
在下文中一共展示了Tester::allTests方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runTests
int KUnitTest::runTests()
{
int globalSteps = 0;
int globalPasses = 0;
int globalFails = 0;
int globalXFails = 0;
int globalXPasses = 0;
int globalSkipped = 0;
cout << "# Running normal tests... #" << endl << endl;
QAsciiDictIterator<Tester> it( m_tests );
for( ; it.current(); ++it ) {
Tester* test = it.current();
test->allTests();
cout << it.currentKey() << " - ";
int numPass = test->testsFinished() - ( test->errorList().count() + test->xfailList().count() + test->skipList().count() );
int numFail = test->errorList().count() + test->xfailList().count();
int numXFail = test->xfailList().count();
int numXPass = test->xpassList().count();
int numSkip = test->skipList().count();
globalSteps += test->testsFinished();
globalPasses += numPass;
globalFails += numFail;
globalXFails += numXFail;
globalXPasses += numXPass;
globalSkipped += numSkip;
cout << numPass << " test" << ( ( 1 == numPass )?"":"s") << " passed";
if ( 0 < test->xpassList().count() ) {
cout << " (" << numXPass << " unexpected pass" << ( ( 1 == numXPass )?"":"es") << ")";
}
cout << ", " << numFail << " test" << ( ( 1 == numFail )?"":"s") << " failed";
if ( 0 < numXFail ) {
cout << " (" << numXFail << " expected failure" << ( ( 1 == numXFail )?"":"s") << ")";
}
if ( 0 < numSkip ) {
cout << "; also " << numSkip << " skipped";
}
cout << endl;
if ( 0 < numXPass ) {
cout << " Unexpected pass" << ( ( 1 == numXPass )?"":"es") << ":" << endl;
QStringList list = test->xpassList();
for ( QStringList::Iterator itr = list.begin(); itr != list.end(); ++itr ) {
cout << "\t" << (*itr).latin1() << endl;
}
}
if ( 0 < (numFail - numXFail) ) {
cout << " Unexpected failure" << ( ( 1 == numFail )?"":"s") << ":" << endl;
QStringList list = test->errorList();
for ( QStringList::Iterator itr = list.begin(); itr != list.end(); ++itr ) {
cout << "\t" << (*itr).latin1() << endl;
}
}
if ( 0 < numXFail ) {
cout << " Expected failure" << ( ( 1 == numXFail)?"":"s") << ":" << endl;
QStringList list = test->xfailList();
for ( QStringList::Iterator itr = list.begin(); itr != list.end(); ++itr ) {
cout << "\t" << (*itr).latin1() << endl;
}
}
if ( 0 < numSkip ) {
cout << " Skipped test" << ( ( 1 == numSkip )?"":"s") << ":" << endl;
QStringList list = test->skipList();
for ( QStringList::Iterator itr = list.begin(); itr != list.end(); ++itr ) {
cout << "\t" << (*itr).latin1() << endl;
}
}
cout << endl;
}
cout << "# Done with normal tests:" << endl;
cout << " Total test cases: " << m_tests.count() << endl;
cout << " Total test steps : " << globalSteps << endl;
cout << " Total passed test steps (including unexpected) : " << globalPasses << endl;
cout << " Total unexpected passed test steps : " << globalXPasses << endl;
cout << " Total failed test steps (including expected) : " << globalFails << endl;
cout << " Total expected failed test steps : " << globalXFails << endl;
cout << " Total skipped test steps : " << globalSkipped << endl;
return m_tests.count();
}