mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
test-gdb: exit gracefully on failure instead of raising
Just print the traceback instead. Pass extra CLI options to produce nicer output like --no-show-stdout.
This commit is contained in:
10
test-gdb
10
test-gdb
@@ -34,8 +34,6 @@ found by searching for the Python test files.
|
||||
)
|
||||
|
||||
def timed_main(self):
|
||||
run = lkmc.import_path.import_path_main('run')
|
||||
run_gdb = lkmc.import_path.import_path_main('run-gdb')
|
||||
rootdir_abs_len = len(self.env['root_dir'])
|
||||
for test in self.env['tests']:
|
||||
for path, in_dirnames, in_filenames in self.sh.walk(test):
|
||||
@@ -48,19 +46,21 @@ found by searching for the Python test files.
|
||||
if ext in self.env['baremetal_build_in_exts'] and os.path.exists(path_relative_root_base + '.py'):
|
||||
my_path_properties = path_properties.get(path_relative_root)
|
||||
if my_path_properties.should_be_tested(self.env, is_baremetal=True):
|
||||
run = lkmc.import_path.import_path_main('run')
|
||||
run_gdb = lkmc.import_path.import_path_main('run-gdb')
|
||||
common_args = self.get_common_args()
|
||||
common_args['baremetal'] = path_relative_root
|
||||
run_args = common_args.copy()
|
||||
run_args['gdb_wait'] = True
|
||||
run_args['background'] = True
|
||||
run_args.update(self.base_run_args)
|
||||
test_id_string = self.test_setup(run_args, path_relative_root)
|
||||
run_thread = threading.Thread(target=lambda: run(**run_args))
|
||||
run_thread.start()
|
||||
gdb_args = common_args.copy()
|
||||
gdb_args['test'] = True
|
||||
run_gdb(**gdb_args)
|
||||
exit_status = run_gdb(**gdb_args)
|
||||
run_thread.join()
|
||||
self.test_teardown(run, 0, test_id_string)
|
||||
self.test_teardown(run, exit_status, test_id_string)
|
||||
|
||||
if __name__ == '__main__':
|
||||
Main().cli()
|
||||
|
||||
Reference in New Issue
Block a user