diff --git a/lib/core/src/test_runner.ri b/lib/core/src/test_runner.ri index 65a4eb342..205326e74 100644 --- a/lib/core/src/test_runner.ri +++ b/lib/core/src/test_runner.ri @@ -93,7 +93,9 @@ public struct TestRunner { } } self.print_summary_tests(); - process_exit(@as(int32, self.fail_tests)); + if self.fail_tests > 0 { + process_exit(1); + } } func print_summary_tests(&self) { diff --git a/rivetc/src/__init__.py b/rivetc/src/__init__.py index 30e0f2445..41969ffe4 100644 --- a/rivetc/src/__init__.py +++ b/rivetc/src/__init__.py @@ -57,8 +57,6 @@ def __init__(self, args): self.checker = checker.Checker(self) self.codegen = codegen.Codegen(self) - self.exit_code = 0 - def import_modules(self): for sf in self.parsed_files: for decl in sf.decls: @@ -147,8 +145,6 @@ def run(self): self.codegen.gen_source_files(self.source_files) if report.ERRORS > 0: self.abort() - if self.exit_code != 0: - exit(self.exit_code) def load_root_module(self): if path.isdir(self.prefs.input): diff --git a/rivetc/src/codegen/__init__.py b/rivetc/src/codegen/__init__.py index 96363d089..13baa09d3 100644 --- a/rivetc/src/codegen/__init__.py +++ b/rivetc/src/codegen/__init__.py @@ -276,8 +276,11 @@ def gen_source_files(self, source_files): self.comp.vlog("generating C output from RIR...") CGen(self.comp).gen(self.out_rir) if self.comp.prefs.build_mode == prefs.BuildMode.Test: - self.comp.exit_code = os.system(self.comp.prefs.mod_output) + exit_code = os.system(self.comp.prefs.mod_output) os.remove(self.comp.prefs.mod_output) + # assert exit_code == 0 + if exit_code != 0: + exit(1) def gen_mod_attributes(self, mod_name, attributes): mod_folder = os.path.join(prefs.RIVET_DIR, "obj", mod_name) diff --git a/rivetc/src/prefs.py b/rivetc/src/prefs.py index 7fc8f8dae..e117e3961 100644 --- a/rivetc/src/prefs.py +++ b/rivetc/src/prefs.py @@ -298,7 +298,7 @@ def __init__(self, args: [str]): self.build_rivet_dir() if self.build_mode == BuildMode.Test: - self.mod_output = f"_tests_runner_" + self.mod_output = f"_tests_runner__{self.mod_name}_" elif len(self.mod_output) == 0: self.mod_output = self.mod_name if self.target_os == OS.Windows and not self.mod_output.endswith(