Download presentation
Presentation is loading. Please wait.
Published byAugusta Peters Modified over 8 years ago
1
CTK Hackfest Testing framework November 2011 Inria – Sofia Antipolis
2
MITK Custom testing framework int mitkMyTest(int, char* []) { MITK_TEST_BEGIN(“MyTest"); int value = 10; MITK_TEST_CONDITION_REQUIRED( value < 100, “My Test Message"); MITK_INFO << value; MITK_TEST_END(); }
3
GIMIAS TestSuite –CppUnitCppUnit (JUnit for C++) optionally using old QtTestRunnerQtTestRunner –CxxTestCxxTest JUnit and CppUnit like lightweight
4
Qt Testing #include class TestQString: public QObject { Q_OBJECT private slots: void toUpper() { QString str = "Hello"; QCOMPARE(str.toUpper(), QString("HELLO")); } }; QTEST_MAIN(TestQString) #include "testqstring.moc"
5
MAF3 Wrapper around QTest
6
Google tests // Tests factorial of negative numbers. TEST(FactorialTest, Negative) { // This test is named "Negative", // and belongs to the "FactorialTest“ // test case. EXPECT_EQ(1, Factorial(-5)); EXPECT_EQ(1, Factorial(-1)); EXPECT_TRUE(Factorial(-10) > 0); } RUN_ALL_TESTS() in main().
7
Suggestion for CTK Use QtTest ? –Offers the same as in CxxTests, Google Tests Eventually add macros on top to register tests –What’s missing ? –Mix of MITK / MAF ? How about Python ? How about GUI testing ?
8
QtTest: http://doc.qt.nokia.com/stable/qtestlib- tutorial1.htmlhttp://doc.qt.nokia.com/stable/qtestlib- tutorial1.html
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.