]> rtime.felk.cvut.cz Git - can-benchmark.git/blobdiff - gw-tests/tests.py
Adds RTEMS target to makefile and associated Python scripts.
[can-benchmark.git] / gw-tests / tests.py
diff --git a/gw-tests/tests.py b/gw-tests/tests.py
new file mode 100644 (file)
index 0000000..a06a1ae
--- /dev/null
@@ -0,0 +1,34 @@
+import lib
+
+
+class Test:
+    def __init__(self, name, func, has_image):
+        self.name = name
+        self.func = func
+        self.has_image = has_image
+
+    def run(self):
+        self.func(self)
+
+def nop(self):
+    print(self.name)
+    for l in (2, 4, 6, 8):
+        lib.call_latester(" -d can0 -d can1 -d can2 -c 10000 {0} -l {1} -n len{1}".format(lib.get_latester_arg(l), l))
+        lib.create_plot_script()
+
+
+def nop_time(self):
+    lib.symlink_results(lib.original_name_from_histogram_name(self.name))
+    lib.create_plot_script()
+
+def nop_highprio(self):
+    nop(self)
+
+def nop_highprio_time(self):
+    nop_time(self)
+
+
+tests = (Test("nop", nop, True),
+         Test("nop-time", nop_time, False),
+         Test("nop-highprio", nop_highprio, True),
+         Test("nop-highprio-time", nop_highprio_time, False))
\ No newline at end of file