Skip to content

Commit

Permalink
autotest: install multiple test scripts with one call
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker committed Jun 24, 2024
1 parent 9fdf52c commit b841f55
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
14 changes: 7 additions & 7 deletions Tools/autotest/rover.py
Original file line number Diff line number Diff line change
Expand Up @@ -5311,13 +5311,13 @@ def test_scripting_internal_test(self):
})
self.install_test_modules_context()
self.install_mavlink_module_context()
for script in [
"scripting_test.lua",
"math.lua",
"strings.lua",
"mavlink_test.lua",
]:
self.install_test_script_context(script)

self.install_test_scripts_context([
"scripting_test.lua",
"math.lua",
"strings.lua",
"mavlink_test.lua",
])

self.context_collect('STATUSTEXT')
self.context_collect('NAMED_VALUE_FLOAT')
Expand Down
13 changes: 10 additions & 3 deletions Tools/autotest/vehicle_test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -4632,11 +4632,18 @@ def install_example_script_context(self, scriptname):
self.install_example_script(scriptname)
self.context_get().installed_scripts.append(scriptname)

def install_test_script_context(self, scriptname):
def install_test_script_context(self, scriptnames):
'''installs an test script which will be removed when the context goes
away'''
self.install_test_script(scriptname)
self.context_get().installed_scripts.append(scriptname)
if isinstance(scriptnames, str):
scriptnames = [scriptnames]
for scriptname in scriptnames:
self.install_test_script(scriptname)
self.context_get().installed_scripts.extend(scriptnames)

def install_test_scripts_context(self, *args, **kwargs):
'''same as install_test_scripts_context - just pluralised name'''
return self.install_test_script_context(*args, **kwargs)

def install_test_modules_context(self):
'''installs test modules which will be removed when the context goes
Expand Down

0 comments on commit b841f55

Please sign in to comment.