Perform a runtime checking transformation test case.
(self, testcase: DataDrivenTestCase)
| 35 | optional_out = True |
| 36 | |
| 37 | def run_case(self, testcase: DataDrivenTestCase) -> None: |
| 38 | """Perform a runtime checking transformation test case.""" |
| 39 | options = infer_ir_build_options_from_test_name(testcase.name) |
| 40 | if options is None: |
| 41 | # Skipped test case |
| 42 | return |
| 43 | with use_custom_builtins(os.path.join(self.data_prefix, ICODE_GEN_BUILTINS), testcase): |
| 44 | expected_output = remove_comment_lines(testcase.output) |
| 45 | expected_output = replace_word_size(expected_output) |
| 46 | try: |
| 47 | ir = build_ir_for_single_file(testcase.input, options) |
| 48 | except CompileError as e: |
| 49 | actual = e.messages |
| 50 | else: |
| 51 | actual = [] |
| 52 | for fn in ir: |
| 53 | if fn.name == TOP_LEVEL_NAME and not testcase.name.endswith("_toplevel"): |
| 54 | continue |
| 55 | insert_uninit_checks(fn, True) |
| 56 | insert_ref_count_opcodes(fn) |
| 57 | actual.extend(format_func(fn)) |
| 58 | |
| 59 | assert_test_output(testcase, actual, "Invalid source code output", expected_output) |
nothing calls this directly
no test coverage detected