blob: 02e1724d1bb32ad2c408d700fa9ca0f3dbed865d [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
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 Slemkod466b212006-07-20 00:04:18 +000052
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 Slemko8a40a762006-07-19 17:46:50 +000063}
64