Skip to content

Commit c91f139

Browse files
committed
Check expected file after successful translation
1 parent eb245bb commit c91f139

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

tests/lit/lit/formats/Cpp2RustTest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,6 @@ def fail(str, code = fail_code):
9696
shutil.rmtree(tmp_dir, True)
9797
return code, str
9898

99-
expected_file = self.getExpectedFile(filepath, model, fname)
100-
if not os.path.exists(expected_file) and not replace_expected:
101-
return fail('no expected file')
102-
10399
cmd = ['./cpp2rust/cpp2rust', '-file', cc_input, '-model', model,
104100
'-o', rs_file]
105101

@@ -119,6 +115,10 @@ def fail(str, code = fail_code):
119115
return lit.Test.PASS, ''
120116
return fail('cpp2rust failed\n' + err)
121117

118+
expected_file = self.getExpectedFile(filepath, model, fname)
119+
if not os.path.exists(expected_file) and not replace_expected:
120+
return fail('no expected file')
121+
122122
if replace_expected:
123123
self.updateExpected(generated, expected_file)
124124

0 commit comments

Comments
 (0)