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