gem5: add mechanism to list regression tests

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2020-01-20 00:00:00 +00:00
parent 911cd11ab9
commit 9fbe39542d
2 changed files with 39 additions and 7 deletions

View File

@@ -15,6 +15,13 @@ class Main(common.LkmcCliFunction):
Run gem5 regression tests.
https://cirosantilli.com/linux-kernel-module-cheat#gem5-regression-tests
'''
)
self.add_argument(
'--cmd',
default='run',
help='''
List tests instead of running them.
''',
)
self.add_argument(
'extra_args',
@@ -23,16 +30,23 @@ https://cirosantilli.com/linux-kernel-module-cheat#gem5-regression-tests
)
def timed_main(self):
return self.sh.run_cmd([
os.path.join(self.env['gem5_source_dir'], 'tests', 'main.py'), LF,
'run', LF,
if self.env['cmd'] == 'run':
extra_args = [
'--base-dir', self.env['gem5_source_dir'], LF,
'--build-dir', self.env['gem5_build_build_dir'], LF,
'--isa', self.env['gem5_arch'], LF,
'--variant', self.env['gem5_build_type'], LF,
'-j', str(self.env['nproc']), LF,
'-t', str(self.env['nproc']), LF,
]
else:
extra_args = []
return self.sh.run_cmd(
[
os.path.join(self.env['gem5_source_dir'], 'tests', 'main.py'), LF,
self.env['cmd'], LF,
'--isa', self.env['gem5_arch'], LF,
'--variant', self.env['gem5_build_type'], LF,
] +
extra_args +
self.sh.add_newlines(self.env['extra_args']),
cwd=os.path.join(self.env['gem5_source_dir'], 'tests'),
raise_on_failure=False,