From ef4ebbf126acc20afeefcf66d0ff910721fbffcb Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 26 Mar 2021 15:00:42 +1100 Subject: [PATCH] autotest: add a do-nothing --autotest-server option This option is currently ignored, but if given allows the script to continue normally. This allows us to change the autotest server to pass the option in - and then we can change autotest.py so that unless the option is given we spit out a help message rather than completely stuff up the user's development environment --- Tools/autotest/autotest.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Tools/autotest/autotest.py b/Tools/autotest/autotest.py index 2875c309219..3bb61c801ab 100755 --- a/Tools/autotest/autotest.py +++ b/Tools/autotest/autotest.py @@ -794,6 +794,10 @@ if __name__ == "__main__": "e.g. autotest.py --debug --gdb build.Tracker test.Tracker # run Tracker under gdb\n" "e.g. autotest.py --debug --gdb build.Sub test.Sub.DiveManual # do specific Sub test\n" ) + parser.add_option("--autotest-server", + action='store_true', + default=False, + help='Run in autotest-server mode; dangerous!') parser.add_option("--skip", type='string', default='', @@ -1099,6 +1103,12 @@ if __name__ == "__main__": sys.exit(1) matched.extend(matches) steps = matched + elif opts.autotest_server: + # we will be changing this script to give a help message if + # --autotest-server isn't given, instead of assuming we want + # to do everything that happens on autotest.ardupilot.org, + # which includes some significant state-changing actions. + print("AutoTest-Server Mode") # skip steps according to --skip option: steps_to_run = [s for s in steps if should_run_step(s)]