]> rtime.felk.cvut.cz Git - can-benchmark.git/blob - gw-tests/tests.py
Changed all (I think) files using CRLF to use LF.
[can-benchmark.git] / gw-tests / tests.py
1 """
2 This file contains and defines tests for use in rtems_bench.
3
4 Any new tests should be added to module variable tests to be seen by the bench.
5 """
6
7 import lib
8
9
10 class Test:
11     def __init__(self, name, func, has_image):
12         self.name = name
13         self.func = func
14         self.has_image = has_image
15
16     def run(self):
17         self.func(self) #
18
19 def nop(self):
20     print(self.name)
21     for l in (2, 4, 6, 8):
22         lib.call_latester(" -d can0 -d can1 -d can2 -c 10000 {0} -l {1} -n len{1}".format(lib.get_latester_arg(l), l))
23         lib.create_plot_script()
24
25
26 def nop_time(self):
27     print(self.name)
28     lib.symlink_results(lib.original_name_from_histogram_name(self.name))
29     lib.create_plot_script()
30
31 def nop_highprio(self):
32     nop(self)
33
34 def nop_highprio_time(self):
35     nop_time(self)
36
37
38 tests = (Test("nop", nop, True),
39          Test("nop-time", nop_time, False),
40          Test("nop-highprio", nop_highprio, True),
41          Test("nop-highprio-time", nop_highprio_time, False))