diff options
-rwxr-xr-x | src/systemc/tests/verify.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/systemc/tests/verify.py b/src/systemc/tests/verify.py index 503c11d8b..2bb6d3357 100755 --- a/src/systemc/tests/verify.py +++ b/src/systemc/tests/verify.py @@ -45,6 +45,10 @@ import sys script_path = os.path.abspath(inspect.getfile(inspect.currentframe())) script_dir = os.path.dirname(script_path) config_path = os.path.join(script_dir, 'config.py') +# Parent directories if checked out as part of gem5. +systemc_dir = os.path.dirname(script_dir) +src_dir = os.path.dirname(systemc_dir) +checkout_dir = os.path.dirname(src_dir) systemc_rel_path = 'systemc' tests_rel_path = os.path.join(systemc_rel_path, 'tests') @@ -131,7 +135,8 @@ class CompilePhase(TestPhaseBase): if args.j == 0: self.args = ('-j', str(self.main_args.j)) + self.args - scons_args = [ 'USE_SYSTEMC=1' ] + list(self.args) + targets + scons_args = [ '--directory', self.main_args.scons_dir, + 'USE_SYSTEMC=1' ] + list(self.args) + targets scons(*scons_args) class RunPhase(TestPhaseBase): @@ -512,6 +517,10 @@ parser.add_argument('-j', type=int, default=1, help='Default level of parallelism, can be overriden ' 'for individual stages') +parser.add_argument('-C', '--scons-dir', metavar='SCONS_DIR', + default=checkout_dir, + help='Directory to run scons from') + filter_opts = parser.add_mutually_exclusive_group() filter_opts.add_argument('--filter', default='True', help='Python expression which filters tests based ' @@ -549,7 +558,7 @@ if len(phases) == 0: json_path = os.path.join(main_args.build_dir, json_rel_path) if main_args.update_json: - scons(os.path.join(json_path)) + scons('--directory', main_args.scons_dir, os.path.join(json_path)) with open(json_path) as f: test_data = json.load(f) |