blob: d139f55c0b3108c97dabdeef420d82c8fdb34ddd [file] [log] [blame]
Marc Slemko8a40a762006-07-19 17:46:50 +00001#include <iostream>
2#include <string>
3
4#include "ThreadFactoryTests.h"
5#include "TimerManagerTests.h"
Marc Slemkod466b212006-07-20 00:04:18 +00006#include "ThreadManagerTests.h"
Marc Slemko8a40a762006-07-19 17:46:50 +00007
8int 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
Marc Slemko03dedd92006-07-20 00:58:47 +000033 size_t count = 10000;
Marc Slemko8a40a762006-07-19 17:46:50 +000034
Marc Slemko03dedd92006-07-20 00:58:47 +000035 std::cout << "\t\tThreadFactory reap N threads test: N = " << count << std::endl;
36
37 assert(threadFactoryTests.reapNThreads(count));
Marc Slemko8a40a762006-07-19 17:46:50 +000038
39 std::cout << "\t\tThreadFactory synchrous start test" << std::endl;
40
41 assert(threadFactoryTests.synchStartTest());
42 }
43
44 if(runAll || arg.compare("timer-manager") == 0) {
45
46 std::cout << "TimerManager tests..." << std::endl;
47
48 std::cout << "\t\tTimerManager test00" << std::endl;
49
50 TimerManagerTests timerManagerTests;
51
52 assert(timerManagerTests.test00());
53 }
Marc Slemkod466b212006-07-20 00:04:18 +000054
55 if(runAll || arg.compare("thread-manager") == 0) {
56
57 std::cout << "ThreadManager tests..." << std::endl;
58
59 std::cout << "\t\tThreadManager test00" << std::endl;
60
61 ThreadManagerTests threadManagerTests;
62
63 assert(threadManagerTests.test00());
64 }
Marc Slemko8a40a762006-07-19 17:46:50 +000065}
66