From 8ef16e91c351d21a060ddcdbb423107802843ce3 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 31 May 2024 11:52:17 +1000 Subject: [PATCH] autotest: correct Valgrind error detection --- Tools/autotest/vehicle_test_suite.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Tools/autotest/vehicle_test_suite.py b/Tools/autotest/vehicle_test_suite.py index 36e7bd3967..35bac4f454 100644 --- a/Tools/autotest/vehicle_test_suite.py +++ b/Tools/autotest/vehicle_test_suite.py @@ -1491,6 +1491,16 @@ class Result(object): return ret +class ValgrindFailedResult(Result): + '''a custom Result to allow passing of Vaglrind failures around''' + def __init__(self): + super(ValgrindFailedResult, self).__init__(None) + self.passed = False + + def __str__(self): + return "Valgrind error detected" + + class TestSuite(ABC): """Base abstract class. It implements the common function for all vehicle types. @@ -11646,6 +11656,7 @@ switch value''' valgrind_log = util.valgrind_log_filepath(binary=self.binary, model=self.frame) files = glob.glob("*" + valgrind_log) + valgrind_failed = False for valgrind_log in files: os.chmod(valgrind_log, 0o644) if os.path.getsize(valgrind_log) > 0: @@ -11654,6 +11665,9 @@ switch value''' os.path.basename(valgrind_log))) self.progress("Valgrind log: moving %s to %s" % (valgrind_log, target)) shutil.move(valgrind_log, target) + valgrind_failed = True + if valgrind_failed: + result_list.append(ValgrindFailedResult()) return result_list