mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
gem5: add mechanism to list regression tests
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user