This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // File: unittest.cpp | |
| void UnitTest::runTests() | |
| { | |
| // variables to count the number of passed and failed tests | |
| static int passed{0}; | |
| static int failed{0}; | |
| if(testList.empty()) | |
| { | |
| std::cout << "No tests registered!!" << std::endl; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // test.hpp | |
| #include "unittest.hpp" | |
| DeclareTest(module, test1) | |
| DeclareTest(module, test2) | |
| ... | |
| //test.cpp | |
| #include "test.hpp" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // File: test_main.cpp | |
| #include "test_project.hpp" | |
| int main(){ | |
| RegisterTest(module, test1) | |
| RegisterTest(module, test2) | |
| RunTests() | |
| return 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // File: test_dummy.cpp | |
| #include "test_dummy.hpp" | |
| DefineTest(dummy, dummycase){ | |
| // Write your test code here | |
| // ... | |
| } |
OlderNewer