(self, testcase: DataDrivenTestCase)
| 32 | base_path = test_temp_dir |
| 33 | |
| 34 | def run_case(self, testcase: DataDrivenTestCase) -> None: |
| 35 | options = infer_ir_build_options_from_test_name(testcase.name) |
| 36 | if options is None: |
| 37 | # Skipped test case |
| 38 | return |
| 39 | with use_custom_builtins(os.path.join(self.data_prefix, ICODE_GEN_BUILTINS), testcase): |
| 40 | expected_output = remove_comment_lines(testcase.output) |
| 41 | expected_output = replace_word_size(expected_output) |
| 42 | try: |
| 43 | ir = build_ir_for_single_file(testcase.input, options) |
| 44 | except CompileError as e: |
| 45 | actual = e.messages |
| 46 | else: |
| 47 | actual = [] |
| 48 | for fn in ir: |
| 49 | if fn.name == TOP_LEVEL_NAME and not testcase.name.endswith("_toplevel"): |
| 50 | continue |
| 51 | options = CompilerOptions(strict_traceback_checks=True) |
| 52 | # Lowering happens after exception handling and ref count opcodes have |
| 53 | # been added. Any changes must maintain reference counting semantics. |
| 54 | insert_uninit_checks(fn, True) |
| 55 | insert_exception_handling(fn, True) |
| 56 | insert_ref_count_opcodes(fn) |
| 57 | lower_ir(fn, options) |
| 58 | do_flag_elimination(fn, options) |
| 59 | actual.extend(format_func(fn)) |
| 60 | |
| 61 | assert_test_output(testcase, actual, "Invalid source code output", expected_output) |
nothing calls this directly
no test coverage detected