mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-26 03:31:36 +01:00
remove --gem5, use --emulator gem5 everywhere
Allow passing --emulator multiple times for transparent tests selection just like --arch.
This commit is contained in:
@@ -13,40 +13,39 @@ class Main(common.LkmcCliFunction):
|
||||
'hello_cpp.cpp',
|
||||
'print_argv.c',
|
||||
]
|
||||
for emulator in self.env['emulators']:
|
||||
if emulator == 'gem5':
|
||||
extra_args = {
|
||||
'userland_build_id': 'static',
|
||||
}
|
||||
else:
|
||||
extra_args = {}
|
||||
if self.env['arch'] == 'x86_64':
|
||||
arch_sources = [
|
||||
'asm_hello'
|
||||
]
|
||||
elif self.env['arch'] == 'aarch64':
|
||||
arch_sources = [
|
||||
'asm_hello'
|
||||
]
|
||||
else:
|
||||
arch_sources = []
|
||||
arch_sources[:] = [os.path.join('arch', self.env['arch'], arch_source) for arch_source in arch_sources]
|
||||
for source in sources + arch_sources:
|
||||
exit_status = run(
|
||||
archs=[self.env['arch']],
|
||||
dry_run=self.env['dry_run'],
|
||||
userland=source,
|
||||
emulator=emulator,
|
||||
**extra_args,
|
||||
)
|
||||
# TODO forward all args attempt. In particular, --dry-run.
|
||||
#new_env = self.env.copy()
|
||||
#new_env['userland'] = source
|
||||
#new_env['emulator'] = emulator
|
||||
#new_env.update(extra_args)
|
||||
#exit_status = run(**new_env)
|
||||
if exit_status != 0:
|
||||
raise Exception('Test failed: {} {} {} {}'.format(emulator, arch, source, exit_status))
|
||||
if self.env['emulator'] == 'gem5':
|
||||
extra_args = {
|
||||
'userland_build_id': 'static',
|
||||
}
|
||||
else:
|
||||
extra_args = {}
|
||||
if self.env['arch'] == 'x86_64':
|
||||
arch_sources = [
|
||||
'asm_hello'
|
||||
]
|
||||
elif self.env['arch'] == 'aarch64':
|
||||
arch_sources = [
|
||||
'asm_hello'
|
||||
]
|
||||
else:
|
||||
arch_sources = []
|
||||
arch_sources[:] = [os.path.join('arch', self.env['arch'], arch_source) for arch_source in arch_sources]
|
||||
for source in sources + arch_sources:
|
||||
exit_status = run(
|
||||
archs=[self.env['arch']],
|
||||
dry_run=self.env['dry_run'],
|
||||
userland=source,
|
||||
emulators=[self.env['emulator']],
|
||||
**extra_args,
|
||||
)
|
||||
# TODO forward all args attempt. In particular, --dry-run.
|
||||
#new_env = self.env.copy()
|
||||
#new_env['userland'] = source
|
||||
#new_env['emulator'] = emulator
|
||||
#new_env.update(extra_args)
|
||||
#exit_status = run(**new_env)
|
||||
if exit_status != 0:
|
||||
raise Exception('Test failed: {} {} {} {}'.format(emulator, arch, source, exit_status))
|
||||
|
||||
if __name__ == '__main__':
|
||||
Main().cli()
|
||||
|
||||
Reference in New Issue
Block a user