diff options
| author | Paul Oliver <contact@pauloliver.dev> | 2026-07-07 05:57:49 +0200 |
|---|---|---|
| committer | Paul Oliver <contact@pauloliver.dev> | 2026-07-07 05:57:49 +0200 |
| commit | 55928b51596de4cd1b7a2783529ecda3ff3087ce (patch) | |
| tree | d00172e0e7dc1d5bb593c55e5d51acb1634a4855 /test/test_build.py | |
| parent | b54b9ceb2952ba84b58e75aba014558b17d08e77 (diff) | |
Adds run tests and file checks
Diffstat (limited to 'test/test_build.py')
| -rw-r--r-- | test/test_build.py | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/test/test_build.py b/test/test_build.py index a57c09d..ec23390 100644 --- a/test/test_build.py +++ b/test/test_build.py @@ -1,11 +1,14 @@ +import os import signal from test_general import SalisTest class TestBuild(SalisTest): + NAME = "test-build.sim" + def cmds_new(self, anc, arch): return ( - f"./salis.py new -a{anc} -b -f -g{compiler} -H{self.tempdir.name} {optimized} -s{seed} -u{ui} -v{arch}" + f"./salis.py new -a{anc} -b -f -g{compiler} -H{self.tempdir.name} -n{TestBuild.NAME} {optimized} -s{seed} -u{ui} -v{arch}" for compiler in ["clang", "gcc"] for optimized in ["", "-o"] for seed in [-1, 0, 1234] @@ -20,7 +23,7 @@ class TestBuild(SalisTest): def cmds_load(self): return ( - f"./salis.py load -b -g{compiler} -H{self.tempdir.name} {optimized} -u{ui}" + f"./salis.py load -b -g{compiler} -H{self.tempdir.name} -n{TestBuild.NAME} {optimized} -u{ui}" for compiler in ["clang", "gcc"] for optimized in ["", "-o"] for ui in ["curses", "daemon"] @@ -28,7 +31,7 @@ class TestBuild(SalisTest): def cmds_server(self): return ( - f"./salis.py server -b -g{compiler} -H{self.tempdir.name} {optimized}" + f"./salis.py server -b -g{compiler} -H{self.tempdir.name} -n{TestBuild.NAME} {optimized}" for compiler in ["clang", "gcc"] for optimized in ["", "-o"] ) @@ -41,31 +44,44 @@ class TestBuild(SalisTest): for optimized in ["", "-o"] ) + def file_list(self): + return [ + os.path.join(self.tempdir.name, TestBuild.NAME, "opts.json"), + ] + def test_null_new(self): for cmd in self.cmds_new_null(): SalisTest.run_subprocess(cmd) + self.assert_file_list_exists(self.file_list()) def test_v1_new(self): for cmd in self.cmds_new_v1(): SalisTest.run_subprocess(cmd) + self.assert_file_list_exists(self.file_list()) def test_null_load(self): SalisTest.run_subprocess(next(self.cmds_new_null())) + self.assert_file_list_exists(self.file_list()) for cmd in self.cmds_load(): SalisTest.run_subprocess(cmd) + self.assert_file_list_exists(self.file_list()) def test_v1_load(self): SalisTest.run_subprocess(next(self.cmds_new_v1())) + self.assert_file_list_exists(self.file_list()) for cmd in self.cmds_load(): SalisTest.run_subprocess(cmd) + self.assert_file_list_exists(self.file_list()) def test_server(self): SalisTest.run_subprocess(next(self.cmds_new_null())) + self.assert_file_list_exists(self.file_list()) for cmd in self.cmds_server(): SalisTest.run_subprocess(cmd) + self.assert_file_list_exists(self.file_list()) @SalisTest.run_ui_test(anc="0123", anc_path="anc", name="def.sim", ui="null", ui_path="test/ui", vm_arch="null") def test_client(self): |
