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')
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):
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 '
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)