(self, testcase: DataDrivenTestCase)
| 33 | base_path = test_temp_dir |
| 34 | |
| 35 | def run_case(self, testcase: DataDrivenTestCase) -> None: |
| 36 | with use_custom_builtins(os.path.join(self.data_prefix, ICODE_GEN_BUILTINS), testcase): |
| 37 | expected_output = remove_comment_lines(testcase.output) |
| 38 | try: |
| 39 | ir = build_ir_for_single_file(testcase.input) |
| 40 | except CompileError as e: |
| 41 | actual = e.messages |
| 42 | else: |
| 43 | actual = [] |
| 44 | for fn in ir: |
| 45 | if fn.name == TOP_LEVEL_NAME and not testcase.name.endswith("_toplevel"): |
| 46 | continue |
| 47 | insert_uninit_checks(fn, True) |
| 48 | self.do_optimizations(fn) |
| 49 | actual.extend(format_func(fn)) |
| 50 | |
| 51 | assert_test_output(testcase, actual, "Invalid source code output", expected_output) |
| 52 | |
| 53 | def do_optimizations(self, fn: FuncIR) -> None: |
| 54 | raise NotImplementedError |
nothing calls this directly
no test coverage detected