diff options
author | Gabe Black <gabeblack@google.com> | 2018-07-27 16:06:32 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2018-09-11 21:52:19 +0000 |
commit | 222f5003f5be2fac805a1a5799d1c49a2f87e244 (patch) | |
tree | 913f2bc962aaf6291c4ce99ef7853a0a11ead0f7 /src | |
parent | f8896e6254869dee1c8d5c3aaacf73e07264f38c (diff) | |
download | gem5-222f5003f5be2fac805a1a5799d1c49a2f87e244.tar.xz |
systemc: Make verify.py delete obsolete diff files.
If diff file exists but the underlying diff has been fixed, delete the
diff file.
Change-Id: Icadc21a61c084198a8a246ab6d00a9b885647cde
Reviewed-on: https://gem5-review.googlesource.com/12056
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src')
-rwxr-xr-x | src/systemc/tests/verify.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/systemc/tests/verify.py b/src/systemc/tests/verify.py index 822065cb9..ad6131970 100755 --- a/src/systemc/tests/verify.py +++ b/src/systemc/tests/verify.py @@ -212,9 +212,9 @@ class LogChecker(Checker): with open(self.test) as test_f, open(self.ref) as ref_f: test = re.sub(self.test_filt, '', test_f.read()) ref = re.sub(self.ref_filt, '', ref_f.read()) + diff_file = '.'.join([ref_file, 'diff']) + diff_path = os.path.join(self.out_dir, diff_file) if test != ref: - diff_file = '.'.join([ref_file, 'diff']) - diff_path = os.path.join(self.out_dir, diff_file) with open(diff_path, 'w') as diff_f: for line in difflib.unified_diff( ref.splitlines(True), test.splitlines(True), @@ -222,6 +222,9 @@ class LogChecker(Checker): tofile=test_file): diff_f.write(line) return False + else: + if os.path.exists(diff_path): + os.unlink(diff_path) return True class VerifyPhase(TestPhaseBase): |