mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-22 00:28:30 -04:00
Tools: autotest: Added a generic run_test.
This function is called from every vehicle to run a test. If any of the tests throws an exception, it will be caught here, and the name of the test and the exception that got raised will be added to the fail_list
This commit is contained in:
parent
b485867db3
commit
7a20dd8b73
@ -668,6 +668,19 @@ class AutoTest(ABC):
|
||||
self.progress("Failed to get EKF.flags=%u" % required_value)
|
||||
raise AutoTestTimeoutException()
|
||||
|
||||
def run_test(self, desc, function):
|
||||
self.progress("#")
|
||||
self.progress("########## %s ##########" % (desc))
|
||||
self.progress("#")
|
||||
|
||||
try:
|
||||
function()
|
||||
except Exception as e:
|
||||
self.progress('FAILED: "%s": %s' % (desc, type(e).__name__))
|
||||
self.fail_list.append( (desc, e) )
|
||||
return
|
||||
self.progress('PASSED: "%s"' % desc)
|
||||
|
||||
@abc.abstractmethod
|
||||
def init(self):
|
||||
"""Initilialize autotest feature."""
|
||||
|
Loading…
Reference in New Issue
Block a user