Perform a runtime checking transformation test case.
(self, testcase: DataDrivenTestCase)
| 78 | optional_out = True |
| 79 | |
| 80 | def run_case(self, testcase: DataDrivenTestCase) -> None: |
| 81 | """Perform a runtime checking transformation test case.""" |
| 82 | options = infer_ir_build_options_from_test_name(testcase.name) |
| 83 | if options is None: |
| 84 | # Skipped test case |
| 85 | return |
| 86 | if "_withgil" in testcase.name and IS_FREE_THREADED: |
| 87 | # Test case should only run on a non-free-threaded build. |
| 88 | return |
| 89 | with use_custom_builtins(os.path.join(self.data_prefix, ICODE_GEN_BUILTINS), testcase): |
| 90 | expected_output = remove_comment_lines(testcase.output) |
| 91 | expected_output = replace_word_size(expected_output) |
| 92 | name = testcase.name |
| 93 | try: |
| 94 | ir = build_ir_for_single_file(testcase.input, options) |
| 95 | except CompileError as e: |
| 96 | actual = e.messages |
| 97 | else: |
| 98 | actual = [] |
| 99 | for fn in ir: |
| 100 | if fn.name == TOP_LEVEL_NAME and not name.endswith("_toplevel"): |
| 101 | continue |
| 102 | actual.extend(format_func(fn)) |
| 103 | |
| 104 | assert_test_output(testcase, actual, "Invalid source code output", expected_output) |
nothing calls this directly
no test coverage detected