aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-gsm-tester.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/osmo-gsm-tester.py')
-rwxr-xr-xsrc/osmo-gsm-tester.py52
1 files changed, 32 insertions, 20 deletions
diff --git a/src/osmo-gsm-tester.py b/src/osmo-gsm-tester.py
index 0137f25..17b16b7 100755
--- a/src/osmo-gsm-tester.py
+++ b/src/osmo-gsm-tester.py
@@ -143,38 +143,50 @@ if __name__ == '__main__':
trials = []
for trial_package in args.trial_package:
t = trial.Trial(trial_package)
- t.verify()
- trials.append(t)
+ try:
+ t.verify()
+ trials.append(t)
+ except:
+ t.log_exn()
trials_passed = []
trials_failed = []
for current_trial in trials:
- with current_trial:
- suites_passed = 0
- suites_failed = 0
- for suite_def, scenarios in suite_scenarios:
- suite_run = suite.SuiteRun(current_trial, suite_def, scenarios)
- result = suite_run.run_tests(test_names)
- if result.all_passed:
- suites_passed += 1
- suite_run.log('PASS')
+ try:
+ with current_trial:
+ suites_passed = []
+ suites_failed = []
+ for suite_scenario_str, suite_def, scenarios in suite_scenarios:
+ log.large_separator(current_trial.name(), suite_scenario_str)
+ suite_run = suite.SuiteRun(current_trial, suite_scenario_str, suite_def, scenarios)
+ result = suite_run.run_tests(test_names)
+ if result.all_passed:
+ suites_passed.append(suite_scenario_str)
+ suite_run.log('PASS')
+ else:
+ suites_failed.append(suite_scenario_str)
+ suite_run.err('FAIL')
+ if not suites_failed:
+ current_trial.log('PASS')
+ trials_passed.append(current_trial.name())
else:
- suites_failed += 1
- suite_run.err('FAIL')
- if not suites_failed:
- current_trial.log('PASS')
- trials_passed.append(current_trial.name())
- else:
- current_trial.err('FAIL')
- trials_failed.append(current_trial.name())
+ current_trial.err('FAIL')
+ trials_failed.append((current_trial.name(), suites_passed, suites_failed))
+ except:
+ current_trial.log_exn()
sys.stderr.flush()
sys.stdout.flush()
+ log.large_separator()
if trials_passed:
print('Trials passed:\n ' + ('\n '.join(trials_passed)))
if trials_failed:
- print('Trials failed:\n ' + ('\n '.join(trials_failed)))
+ print('Trials failed:')
+ for trial_name, suites_passed, suites_failed in trials_failed:
+ print(' %s (%d of %d suite runs failed)' % (trial_name, len(suites_failed), len(suites_failed) + len(suites_passed)))
+ for suite in suites_failed:
+ print(' FAIL:', suite)
exit(1)
# vim: expandtab tabstop=4 shiftwidth=4