autotest: fold close method into sole caller

we're missing the non-zero-valgrind-logs-means-failure check somehow
This commit is contained in:
Peter Barker 2024-05-31 11:24:58 +10:00 committed by Randy Mackay
parent ac4beffab5
commit c0f8ba1d1d
1 changed files with 18 additions and 21 deletions

View File

@ -3017,26 +3017,6 @@ class TestSuite(ABC):
util.pexpect_close(self.sitl)
self.sitl = None
def close(self):
"""Tidy up after running all tests."""
if self.mav is not None:
self.mav.close()
self.mav = None
self.stop_SITL()
valgrind_log = util.valgrind_log_filepath(binary=self.binary,
model=self.frame)
files = glob.glob("*" + valgrind_log)
for valgrind_log in files:
os.chmod(valgrind_log, 0o644)
if os.path.getsize(valgrind_log) > 0:
target = self.buildlogs_path("%s-%s" % (
self.log_name(),
os.path.basename(valgrind_log)))
self.progress("Valgrind log: moving %s to %s" % (valgrind_log, target))
shutil.move(valgrind_log, target)
def start_test(self, description):
self.progress("##################################################################################")
self.progress("########## %s ##########" % description)
@ -11656,7 +11636,24 @@ switch value'''
self.rc_thread_should_quit = True
self.rc_thread.join()
self.rc_thread = None
self.close()
if self.mav is not None:
self.mav.close()
self.mav = None
self.stop_SITL()
valgrind_log = util.valgrind_log_filepath(binary=self.binary,
model=self.frame)
files = glob.glob("*" + valgrind_log)
for valgrind_log in files:
os.chmod(valgrind_log, 0o644)
if os.path.getsize(valgrind_log) > 0:
target = self.buildlogs_path("%s-%s" % (
self.log_name(),
os.path.basename(valgrind_log)))
self.progress("Valgrind log: moving %s to %s" % (valgrind_log, target))
shutil.move(valgrind_log, target)
return result_list