Marc Slemko | 8a40a76 | 2006-07-19 17:46:50 +0000 | [diff] [blame^] | 1 | #include <iostream> |
| 2 | #include <string> |
| 3 | |
| 4 | #include "ThreadFactoryTests.h" |
| 5 | #include "TimerManagerTests.h" |
| 6 | |
| 7 | int main(int argc, char** argv) { |
| 8 | |
| 9 | std::string arg; |
| 10 | |
| 11 | if(argc < 2) { |
| 12 | |
| 13 | arg = "all"; |
| 14 | |
| 15 | } else { |
| 16 | |
| 17 | arg = std::string(argv[1]); |
| 18 | } |
| 19 | |
| 20 | bool runAll = arg.compare("all") == 0; |
| 21 | |
| 22 | if(runAll || arg.compare("thread-factory") == 0) { |
| 23 | |
| 24 | ThreadFactoryTests threadFactoryTests; |
| 25 | |
| 26 | std::cout << "ThreadFactory tests..." << std::endl; |
| 27 | |
| 28 | std::cout << "\tThreadFactory hello-world test" << std::endl; |
| 29 | |
| 30 | assert(threadFactoryTests.helloWorldTest()); |
| 31 | |
| 32 | std::cout << "\t\tThreadFactory reap N threads test: N = 100" << std::endl; |
| 33 | |
| 34 | assert(threadFactoryTests.reapNThreads(100)); |
| 35 | |
| 36 | std::cout << "\t\tThreadFactory synchrous start test" << std::endl; |
| 37 | |
| 38 | assert(threadFactoryTests.synchStartTest()); |
| 39 | } |
| 40 | |
| 41 | if(runAll || arg.compare("timer-manager") == 0) { |
| 42 | |
| 43 | std::cout << "TimerManager tests..." << std::endl; |
| 44 | |
| 45 | std::cout << "\t\tTimerManager test00" << std::endl; |
| 46 | |
| 47 | TimerManagerTests timerManagerTests; |
| 48 | |
| 49 | assert(timerManagerTests.test00()); |
| 50 | } |
| 51 | } |
| 52 | |