|
9 | 9 |
|
10 | 10 |
|
11 | 11 | class SymQemuTests(unittest.TestCase): |
12 | | - SYMQEMU_OUTPUT_DIR = pathlib.Path(__file__).parent / "symqemu_output" |
13 | | - |
14 | | - def setUp(self): |
15 | | - self.SYMQEMU_OUTPUT_DIR.mkdir() |
16 | | - |
17 | | - def tearDown(self): |
18 | | - shutil.rmtree(self.SYMQEMU_OUTPUT_DIR) |
19 | | - |
20 | 12 | def run_symqemu_and_assert_correct_result(self, binary_name): |
21 | 13 | symqemu_ref_output_dir = util.BINARIES_DIR / binary_name / 'expected_outputs' |
| 14 | + symqemu_gen_output_dir = util.BINARIES_DIR / binary_name / 'generated_outputs' |
| 15 | + |
| 16 | + symqemu_gen_output_dir.mkdir() |
22 | 17 |
|
23 | | - util.run_symqemu_on_test_binary(binary_name=binary_name, generated_test_cases_output_dir=self.SYMQEMU_OUTPUT_DIR) |
| 18 | + util.run_symqemu_on_test_binary(binary_name=binary_name, generated_test_cases_output_dir=symqemu_gen_output_dir) |
24 | 19 |
|
25 | 20 | # `filecmp.dircmp` does a "shallow" comparison, but this is not a problem here because |
26 | 21 | # the timestamps should always be different, so the actual content of the files will be compared. |
27 | 22 | # See https://docs.python.org/3/library/filecmp.html#filecmp.dircmp |
28 | | - expected_vs_actual_output_comparison = filecmp.dircmp(self.SYMQEMU_OUTPUT_DIR, symqemu_ref_output_dir) |
| 23 | + expected_vs_actual_output_comparison = filecmp.dircmp(symqemu_gen_output_dir, symqemu_ref_output_dir) |
29 | 24 |
|
30 | 25 | for diff_file in expected_vs_actual_output_comparison.diff_files: |
31 | 26 | ref_file = symqemu_ref_output_dir / diff_file |
32 | | - gen_file = self.SYMQEMU_OUTPUT_DIR / diff_file |
| 27 | + gen_file = symqemu_gen_output_dir / diff_file |
33 | 28 |
|
34 | 29 | tmp_ref = tempfile.NamedTemporaryFile("w+") |
35 | 30 | subprocess.run(["xxd", f"{ref_file}"], stdout=tmp_ref, check=True) |
|
0 commit comments