aboutsummaryrefslogtreecommitdiff
path: root/test/test_run.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_run.py')
-rw-r--r--test/test_run.py50
1 files changed, 50 insertions, 0 deletions
diff --git a/test/test_run.py b/test/test_run.py
new file mode 100644
index 0000000..17bdca8
--- /dev/null
+++ b/test/test_run.py
@@ -0,0 +1,50 @@
+import os
+
+from test_general import SalisTest
+
+class TestRun(SalisTest):
+ NAME = "test-run.sim"
+ PUSH_POW = 8
+
+ def cmds(self, anc, arch):
+ return (
+ (
+ f"./salis.py new -a{anc} -d{TestRun.PUSH_POW} -f -g{compiler} -H{self.tempdir.name} -n{TestRun.NAME} {optimized} -s{seed} -upush -Utest/ui/ -v{arch} -y{TestRun.PUSH_POW}",
+ f"./salis.py load -g{compiler} -H{self.tempdir.name} -n{TestRun.NAME} {optimized} -upush -Utest/ui/",
+ )
+ for compiler in ["clang", "gcc"]
+ for optimized in ["", "-o"]
+ for seed in [-1, 0, 1234]
+ )
+
+ def cmds_null(self):
+ return self.cmds("0123", "null")
+
+ def cmds_v1(self):
+ return self.cmds("55a", "v1")
+
+ def file_list_0(self):
+ return [
+ *self.file_list_new(TestRun.NAME),
+ os.path.join(self.tempdir.name, TestRun.NAME, "evas", f"evas-{2 ** TestRun.PUSH_POW:016x}"),
+ ]
+
+ def file_list_1(self):
+ return [
+ *self.file_list_0(),
+ os.path.join(self.tempdir.name, TestRun.NAME, "evas", f"evas-{2 * (2 ** TestRun.PUSH_POW):016x}"),
+ ]
+
+ def test_null(self):
+ for cmd in self.cmds_null():
+ SalisTest.run_subprocess(cmd[0])
+ self.assert_file_list_exists(self.file_list_0())
+ SalisTest.run_subprocess(cmd[1])
+ self.assert_file_list_exists(self.file_list_1())
+
+ def test_v1(self):
+ for cmd in self.cmds_v1():
+ SalisTest.run_subprocess(cmd[0])
+ self.assert_file_list_exists(self.file_list_0())
+ SalisTest.run_subprocess(cmd[1])
+ self.assert_file_list_exists(self.file_list_1())