readme: document --no-quit-on-fail

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-01-22 00:00:00 +00:00
parent 0be47d96b5
commit 4eaa9683fa
2 changed files with 26 additions and 5 deletions

View File

@ -11964,9 +11964,9 @@ The link:test[] script runs several different types of tests, which can also be
link:test[] does not all possible tests, because there are too many possible variations and that would take forever. The rationale is the same as for `./build all` and is explained in `./build --help`.
See the sources of those test scripts to learn how to run more specialized tests.
===== Test arch and emulator selection
One important tip is that you can select multiple archs and emulators of interest with any command as in:
You can select multiple archs and emulators of interest, as for an other command, with:
....
./test-user-mode \
@ -11977,10 +11977,31 @@ One important tip is that you can select multiple archs and emulators of interes
;
....
You can also test all supported archs and emulators with:
....
./test-user-mode \
--all-archs \
--all-emulators \
;
....
This command would run the test four times, using `x86_64` and `aarch64` with both gem5 and QEMU.
Without those flags, it defaults to just running the default arch and emulator once: `x86_64` and `qemu`.
===== Quit on fail
By default, tests stop running as soon as the first failure happens.
You can prevent this with the `--no-quit-on-fail option, e.g.:
....
./test-user-mode --no-quit-on-fail
....
You can then see which tests failed on the test summary report at the end.
===== Test userland in full system
Run all userland tests from inside full system simulation (i.e. not <<user-mode-simulation>>):

View File

@ -187,7 +187,7 @@ TODO: implement fully, some stuff is escaping it currently.
'''
)
self.add_argument(
'--quit-on-failure',
'--quit-on-fail',
default=True,
help='''\
Stop running at the first failed test.
@ -878,7 +878,7 @@ Valid emulators: {}
self.print_time(self.ellapsed_seconds)
if ret is not None and ret != 0:
return_value = ret
if self.env['quit_on_failure']:
if self.env['quit_on_fail']:
raise GetOutOfLoop()
elif not real_all_archs:
raise Exception('Unsupported arch for this action: ' + arch)
@ -1141,7 +1141,7 @@ class TestCliFunction(LkmcCliFunction):
test_result = TestResult.PASS
else:
test_result = TestResult.FAIL
if self.env['quit_on_failure']:
if self.env['quit_on_fail']:
self.log_error('Test failed')
sys.exit(1)
self.log_info('test_result {}'.format(test_result.name))