systemc: Make verify.py run the tests from the directory they expect.
authorGabe Black <gabeblack@google.com>
Tue, 28 Aug 2018 03:34:07 +0000 (20:34 -0700)
committerGabe Black <gabeblack@google.com>
Wed, 26 Sep 2018 00:03:57 +0000 (00:03 +0000)
Change-Id: I4c902cd81f7e46f81f601cae0ff2da044ef48f85
Reviewed-on: https://gem5-review.googlesource.com/12272
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

src/systemc/tests/verify.py

index 9c98d47ad2ae3e1b5deb50d599fa1008aea45d8d..f56c50a79d1d4848f5c142148732b20c271c4d51 100755 (executable)
@@ -142,16 +142,19 @@ class RunPhase(TestPhaseBase):
             '--kill-after', str(args.timeout * 2),
             str(args.timeout)
         ]
+        curdir = os.getcwd()
         def run_test(test):
             cmd = []
             if args.timeout:
                 cmd.extend(timeout_cmd)
             cmd.extend([
                 test.full_path(),
-                '-red', test.m5out_dir(),
+                '-red', os.path.abspath(test.m5out_dir()),
                 '--listener-mode=off',
                 '--quiet',
-                config_path
+                config_path,
+                '--working-dir',
+                os.path.dirname(test.src_dir())
             ])
             # Ensure the output directory exists.
             if not os.path.exists(test.m5out_dir()):
@@ -162,6 +165,7 @@ class RunPhase(TestPhaseBase):
                 returncode = error.returncode
             else:
                 returncode = 0
+            os.chdir(curdir)
             with open(test.returncode_file(), 'w') as rc:
                 rc.write('%d\n' % returncode)