forked from Archive/PX4-Autopilot
Tests: Add further instrumentation
This commit is contained in:
parent
1834c156d2
commit
73edc21667
|
@ -198,8 +198,12 @@ def main():
|
|||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--log-dir",
|
||||
help="Directory for log files, stdout if not provided")
|
||||
parser.add_argument("--speed-factor", default=1,
|
||||
parser.add_argument("--speed-factor", type=int, default=1,
|
||||
help="How fast to run the simulation")
|
||||
parser.add_argument("--iterations", type=int, default=1,
|
||||
help="How often to run the simulation")
|
||||
parser.add_argument("--fail-early", action='store_true',
|
||||
help="Abort on first failure")
|
||||
parser.add_argument("--gui", default=False, action='store_true',
|
||||
help="Display gzclient with")
|
||||
args = parser.parse_args()
|
||||
|
@ -209,6 +213,8 @@ def main():
|
|||
|
||||
overall_success = True
|
||||
|
||||
for x in range(args.iterations):
|
||||
print("Test iterations: %d" % (x + 1))
|
||||
for group in test_matrix:
|
||||
print("Running test group for '{}' with filter '{}'"
|
||||
.format(group['model'], group['test_filter']))
|
||||
|
@ -241,6 +247,8 @@ def main():
|
|||
format(test, "Success" if was_success else "Fail"))
|
||||
if not was_success:
|
||||
overall_success = False
|
||||
if args.fail_early:
|
||||
break
|
||||
|
||||
if args.gui:
|
||||
returncode = gzclient_runner.stop()
|
||||
|
@ -252,10 +260,17 @@ def main():
|
|||
px4_runner.stop()
|
||||
print("px4 exited with {}".format(returncode))
|
||||
|
||||
print("Overall result: {}".
|
||||
format("SUCCESS" if overall_success else "FAIL"))
|
||||
if not overall_success and x > 0:
|
||||
print("Aborting with a failure in test run %d" % (x + 1))
|
||||
sys.exit(0 if overall_success else 1)
|
||||
|
||||
print("Overall result: {}".
|
||||
format("SUCCESS" if overall_success else "FAIL"))
|
||||
|
||||
if x > 0:
|
||||
print("Test iterations: %d" % (x + 1))
|
||||
|
||||
sys.exit(0 if overall_success else 1)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
Loading…
Reference in New Issue