x86 asm: fix test-executables after move from x86-assembly-cheat

Even QEMU has unimplemented x86 instructions!
This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-06-24 00:00:00 +00:00
parent 23d8f703fd
commit 9fd9cb520e
2 changed files with 53 additions and 14 deletions

View File

@@ -6,6 +6,7 @@ import sys
import common
import lkmc.import_path
import path_properties
import signal
import thread_pool
class Main(common.TestCliFunction):
@@ -76,13 +77,18 @@ If given, run only the given tests. Otherwise, run all tests.
'run_obj': lkmc.import_path.import_path_main('run'),
'test_id': '{} {}'.format(self.env['mode'], path_relative_root),
}
signal = my_path_properties['signal_received']
if signal is not None:
if (my_path_properties['qemu_unimplemented_instruction'] and
self.env['emulator'] == 'qemu' and
self.env['mode'] == 'userland'
):
run_test_args['expected_exit_status'] = -signal.Signals.SIGILL.value
my_signal = my_path_properties['signal_received']
if my_signal is not None:
if self.env['mode'] == 'baremetal':
run_test_args['expected_exit_status'] = 128 + signal.value
run_test_args['expected_exit_status'] = 128 + my_signal.value
elif self.env['mode'] == 'userland':
# Python subprocess reports signals differently from Bash's 128 + signal rule.
run_test_args['expected_exit_status'] = -signal.value
run_test_args['expected_exit_status'] = -my_signal.value
my_thread_pool.submit(run_test_args)
return self._handle_thread_pool_errors(my_thread_pool)