blob: cca199dcdb98bc3389579bd357c74131406dfeb4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
#include "../rust_internal.h"
bool
rust_test::run() {
return false;
}
const char *
rust_test::name() {
return "untitled";
}
rust_test_suite::rust_test_suite() {
tests.append(new rust_domain_test());
tests.append(new rust_task_test(this));
tests.append(new rust_array_list_test());
tests.append(new rust_synchronized_indexed_list_test());
}
rust_test_suite::~rust_test_suite() {
}
bool
rust_test_suite::run() {
bool pass = true;
for (size_t i = 0; i < tests.size(); i++) {
rust_test *test = tests[i];
printf("test: %s running ... \n", test->name());
timer timer;
bool result = tests[i]->run();
printf("test: %s %s %.2f ms\n", test->name(),
result ? "PASSED" : "FAILE", timer.get_elapsed_time_in_ms());
if (result == false) {
pass = false;
}
}
return pass;
}
|