本文整理汇总了C++中cppunit::TestSuite类的典型用法代码示例。如果您正苦于以下问题:C++ TestSuite类的具体用法?C++ TestSuite怎么用?C++ TestSuite使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TestSuite类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: suite
CppUnit::Test* ObjectPoolTest::suite()
{
CppUnit::TestSuite* suiteOfTests = new CppUnit::TestSuite("ObjectPoolTest");
suiteOfTests->addTest( new CppUnit::TestCaller<ObjectPoolTest>(
"testSimple",
&ObjectPoolTest::testSimple ) );
suiteOfTests->addTest( new CppUnit::TestCaller<ObjectPoolTest>(
"testCreation",
&ObjectPoolTest::testCreation ) );
suiteOfTests->addTest( new CppUnit::TestCaller<ObjectPoolTest>(
"testInvalidChunkSize",
&ObjectPoolTest::testInvalidChunkSize ) );
suiteOfTests->addTest( new CppUnit::TestCaller<ObjectPoolTest>(
"testAcquire",
&ObjectPoolTest::testAcquire ) );
suiteOfTests->addTest( new CppUnit::TestCaller<ObjectPoolTest>(
"testExclusivity",
&ObjectPoolTest::testExclusivity ) );
suiteOfTests->addTest( new CppUnit::TestCaller<ObjectPoolTest>(
"testRelease",
&ObjectPoolTest::testRelease ) );
return suiteOfTests;
}
示例2:
static CppUnit::Test *suite()
{
CppUnit::TestSuite *suiteOfTests = new CppUnit::TestSuite( "JTSArray4MessageTest" );
suiteOfTests->addTest( new CppUnit::TestCaller<JTSArray4MessageTest>(
"testConstructionDefaults",
&JTSArray4MessageTest::testConstructionDefaults ) );
suiteOfTests->addTest( new CppUnit::TestCaller<JTSArray4MessageTest>(
"testSetGetOperations (TP_3.3.5.1)",
&JTSArray4MessageTest::testSetGetOperations ) );
suiteOfTests->addTest( new CppUnit::TestCaller<JTSArray4MessageTest>(
"testEncodeToSpec (TP_3.3.5.2)",
&JTSArray4MessageTest::testEncodeToSpec ) );
suiteOfTests->addTest( new CppUnit::TestCaller<JTSArray4MessageTest>(
"testEncodeDecodeOperations (TP_3.3.5.3)",
&JTSArray4MessageTest::testEncodeDecodeOperations ) );
suiteOfTests->addTest( new CppUnit::TestCaller<JTSArray4MessageTest>(
"testEquality",
&JTSArray4MessageTest::testEquality ) );
suiteOfTests->addTest( new CppUnit::TestCaller<JTSArray4MessageTest>(
"testInequality",
&JTSArray4MessageTest::testInequality ) );
return suiteOfTests;
}
示例3:
CppUnit::Test * ind_withIDTest::suite()
{
CppUnit::TestSuite *suiteOfTests = new CppUnit::TestSuite( "ind_withIDTest" );
suiteOfTests->addTest(
new CppUnit::TestCaller<ind_withIDTest>(
"testNonmemPars_h",
&ind_withIDTest::testNonmemPars_h ) );
suiteOfTests->addTest(
new CppUnit::TestCaller<ind_withIDTest>(
"testIndDataClass",
&ind_withIDTest::testIndDataClass ) );
suiteOfTests->addTest(
new CppUnit::TestCaller<ind_withIDTest>(
"testDataSetClass",
&ind_withIDTest::testDataSetClass ) );
suiteOfTests->addTest(
new CppUnit::TestCaller<ind_withIDTest>(
"testPredClass",
&ind_withIDTest::testPredClass ) );
suiteOfTests->addTest(
new CppUnit::TestCaller<ind_withIDTest>(
"testDriver",
&ind_withIDTest::testDriver ) );
suiteOfTests->addTest(
new CppUnit::TestCaller<ind_withIDTest>(
"testReportML",
&ind_withIDTest::testReportML ) );
return suiteOfTests;
}
示例4: suite
CppUnit::Test* LoggingTestSuite::suite()
{
CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("LoggingTestSuite");
pSuite->addTest(LoggerTest::suite());
pSuite->addTest(ChannelTest::suite());
pSuite->addTest(PatternFormatterTest::suite());
pSuite->addTest(FileChannelTest::suite());
pSuite->addTest(SimpleFileChannelTest::suite());
pSuite->addTest(LoggingFactoryTest::suite());
pSuite->addTest(LoggingRegistryTest::suite());
pSuite->addTest(LogStreamTest::suite());
return pSuite;
}
示例5:
CppUnit::TestSuite *ABTMessageTest::getSuite(void)
{
CppUnit::TestSuite *suite = new CppUnit::TestSuite();
suite->addTest(
new CppUnit::TestCaller<ABTMessageTest>(
"ABTMessageTest::test_constructor",
&ABTMessageTest::test_constructor));
suite->addTest(
new CppUnit::TestCaller<ABTMessageTest>(
"ABTMessageTest::test_accessors",
&ABTMessageTest::test_accessors));
suite->addTest(
new CppUnit::TestCaller<ABTMessageTest>(
"ABTMessageTest::test_xml",
&ABTMessageTest::test_xml));
return suite;
}
示例6: ListAllTestsInTestSuite
/*! List all available tests in a given test suite. */
int ListAllTestsInTestSuite(CppUnit::Test* tests) {
int count = 0;
// try to see if this is a TestSuite
CppUnit::TestSuite* testSuite = dynamic_cast<CppUnit::TestSuite *>(tests);
// it's a suite, check all components
if (testSuite != NULL) {
std::vector<CppUnit::Test*> allTestsVector = testSuite->getTests();
std::vector<CppUnit::Test*>::iterator testIterator;
for (testIterator = allTestsVector.begin();
testIterator != allTestsVector.end();
testIterator++) {
count += ListAllTestsInTestSuite(*testIterator);
}
} else {
// it's a test, get the name
count++;
std::cout << tests->getName() << std::endl;
}
return count;
}
示例7: main
int main(int argc, char* argv[])
{
// Get the top level suite from the registry
//CPPUNIT_NS::Test *suite = CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest();
CppUnit::TestSuite *unitSuite = new CppUnit::TestSuite( "All unit test" );
unitSuite->addTest(CppUnit::TestFactoryRegistry::getRegistry("VarTableTest").makeTest());
unitSuite->addTest(CppUnit::TestFactoryRegistry::getRegistry("ProcTableTest").makeTest());
unitSuite->addTest(CppUnit::TestFactoryRegistry::getRegistry("ModifiesTest").makeTest());
unitSuite->addTest(CppUnit::TestFactoryRegistry::getRegistry("UsesTest").makeTest());
CppUnit::TestFactoryRegistry::getRegistry().addTestToSuite(unitSuite);
CppUnit::TextUi::TestRunner runner;
runner.addTest(unitSuite);
bool wasSucessful = runner.run();
//cin.get();
getchar();
return wasSucessful ? 0 : 1;
}
示例8: InstantiateTests
CppUnit::Test * InstantiateTests(const cisstTestParameters::TestNameContainerType & testNames)
{
CppUnit::Test * wholeRegistry = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
if (testNames.empty())
return wholeRegistry;
CppUnit::TestSuite * testSuite = new CppUnit::TestSuite("");
cisstTestParameters::TestNameContainerType::const_iterator nameIterator
= testNames.begin();
while (nameIterator != testNames.end()) {
CppUnit::Test * test = FindTestInTestSuite(wholeRegistry, (*nameIterator));
if (test != NULL) {
testSuite->addTest(test);
} else {
std::cerr << "Failed to instantiate " << (*nameIterator) << std::endl;
}
++nameIterator;
}
return testSuite;
}
示例9: main
int main(int argc, char** argv)
{
CppUnit::TestSuite suite;
// FrontSparcTest fst("FrontSparcTest");
// FrontendTest fet("FrontendTest");
// FrontPentTest fpt("FrontPentTest");
FrontPentTest fSt("FrontPentTest");
// fst.registerTests(&suite);
// fpt.registerTests(&suite);
fSt.registerTests(&suite);
CppUnit::TextTestResult res;
prog.readLibParams(); // Read library signatures (once!)
suite.run( &res );
std::cout << res << std::endl;
return 0;
}
示例10: suite
CppUnit::Test* TriangleTestFixture::suite()
{
// Create test suite
CppUnit::TestSuite* suiteOfTests = new CppUnit::TestSuite("Triangle Tests");
auto testFixture = new TriangleTestFixture();
// Add tests
suiteOfTests->addTest(new CppUnit::TestCaller<TriangleTestFixture>(
"testEquality", &TriangleTestFixture::testIdentification, testFixture));
suiteOfTests->addTest(new CppUnit::TestCaller<TriangleTestFixture>(
"predicateTesting", &TriangleTestFixture::predicateTesting, testFixture));
suiteOfTests->addTest(new CppUnit::TestCaller<TriangleTestFixture>(
"negativeTesting", &TriangleTestFixture::negativeTesting, testFixture));
//delete testFixture;
return suiteOfTests;
}
示例11: suite
CppUnit::Test* SocketsTestSuite::suite()
{
CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("SocketsTestSuite");
pSuite->addTest(SocketTest::suite());
pSuite->addTest(SocketStreamTest::suite());
pSuite->addTest(DatagramSocketTest::suite());
pSuite->addTest(NetworkInterfaceTest::suite());
pSuite->addTest(MulticastSocketTest::suite());
pSuite->addTest(DialogSocketTest::suite());
pSuite->addTest(RawSocketTest::suite());
return pSuite;
}
示例12: ConcurrencyComposite
CppUnit::Test *SharedQueueTest::suite() {
// Create a ConcurrencyComposite to act as our test suite. Each test added to the composite will
// be run in its own thread.
ConcurrencyComposite *composite = new ConcurrencyComposite("SharedQueueTest");
// Create 10 consumer threads. Each thread will do a testPop followed by a testTryPop 100 times
// before returning.
for (int i = 0; i < 10; ++i) {
CppUnit::TestSuite *consumer = new CppUnit::TestSuite();
consumer->addTest(new CppUnit::TestCaller<SharedQueueTest>("testPop", &SharedQueueTest::testPop));
//consumer->addTest(new CppUnit::TestCaller<SharedQueueTest>("testPop", &SharedQueueTest::testPop));
consumer->addTest(new CppUnit::TestCaller<SharedQueueTest>("testTryPop", &SharedQueueTest::testTryPop));
composite->addTest(new RepetitionDecorator(consumer, 100));
}
// Now create 10 producer threads. Each thread will do a testPush followed by a testTryPush 100 times
// before returning.
for (int i = 0; i < 10; ++i) {
CppUnit::TestSuite *producer = new CppUnit::TestSuite();
producer->addTest(new CppUnit::TestCaller<SharedQueueTest>("testPush", &SharedQueueTest::testPush));
producer->addTest(new CppUnit::TestCaller<SharedQueueTest>("testTryPush", &SharedQueueTest::testTryPush));
composite->addTest(new RepetitionDecorator(producer, 100));
}
return composite;
}
示例13: suite
CppUnit::Test* TestPottsSpin::suite()
{
CppUnit::TestSuite *suiteOfTests = new CppUnit::TestSuite("TestPottsSpin");
suiteOfTests->addTest( new CppUnit::TestCaller<TestPottsSpin>("TestPottsSpin: test_constructor", &TestPottsSpin::test_constructor ) );
suiteOfTests->addTest( new CppUnit::TestCaller<TestPottsSpin>("TestPottsSpin: test_get_set_value", &TestPottsSpin::test_get_set_value ) );
suiteOfTests->addTest( new CppUnit::TestCaller<TestPottsSpin>("TestPottsSpin: test_get_set_max_value", &TestPottsSpin::test_get_set_max_value ) );
suiteOfTests->addTest( new CppUnit::TestCaller<TestPottsSpin>("TestPottsSpin: test_operator_equal", &TestPottsSpin::test_operator_equal ) );
suiteOfTests->addTest( new CppUnit::TestCaller<TestPottsSpin>("TestPottsSpin: test_operator_multiply", &TestPottsSpin::test_operator_multiply ) );
suiteOfTests->addTest( new CppUnit::TestCaller<TestPottsSpin>("TestPottsSpin: test_all_possible_values", &TestPottsSpin::test_all_possible_values ) );
suiteOfTests->addTest( new CppUnit::TestCaller<TestPottsSpin>("TestPottsSpin: test_random", &TestPottsSpin::test_random ) );
suiteOfTests->addTest( new CppUnit::TestCaller<TestPottsSpin>("TestPottsSpin: test_random_differ", &TestPottsSpin::test_random_differ ) );
return suiteOfTests;
}
示例14:
static CppUnit::Test *suite()
{
CppUnit::TestSuite *suiteOfTests = new CppUnit::TestSuite("GraphTest");
suiteOfTests->addTest(new CppUnit::TestCaller<GraphTest>("graphInsertTest", &GraphTest::graphInsertTest));
suiteOfTests->addTest(new CppUnit::TestCaller<GraphTest>("diGraphInsertTest", &GraphTest::diGraphInsertTest));
suiteOfTests->addTest(new CppUnit::TestCaller<GraphTest>("completeGraphTest", &GraphTest::completeGraphTest));
suiteOfTests->addTest(new CppUnit::TestCaller<GraphTest>("findTest", &GraphTest::findTest));
suiteOfTests->addTest(new CppUnit::TestCaller<GraphTest>("traversalTest", &GraphTest::traversalTest));
suiteOfTests->addTest(new CppUnit::TestCaller<GraphTest>("iteratorTest", &GraphTest::iteratorTest));
suiteOfTests->addTest(new CppUnit::TestCaller<GraphTest>("printTest", &GraphTest::printTest));
suiteOfTests->addTest(new CppUnit::TestCaller<GraphTest>("printPrunerTest", &GraphTest::printPrunerTest));
return suiteOfTests;
}
示例15: suite
CppUnit::Test* DateTimeTestSuite::suite()
{
CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("DateTimeTestSuite");
pSuite->addTest(TimestampTest::suite());
pSuite->addTest(ClockTest::suite());
pSuite->addTest(TimespanTest::suite());
pSuite->addTest(TimezoneTest::suite());
pSuite->addTest(DateTimeTest::suite());
pSuite->addTest(LocalDateTimeTest::suite());
pSuite->addTest(DateTimeFormatterTest::suite());
pSuite->addTest(DateTimeParserTest::suite());
return pSuite;
}