mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
autotest: correct Valgrind error detection
This commit is contained in:
parent
d28dc038ce
commit
624f9ac936
@ -1491,6 +1491,16 @@ class Result(object):
|
|||||||
return ret
|
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):
|
class TestSuite(ABC):
|
||||||
"""Base abstract class.
|
"""Base abstract class.
|
||||||
It implements the common function for all vehicle types.
|
It implements the common function for all vehicle types.
|
||||||
@ -11646,6 +11656,7 @@ switch value'''
|
|||||||
valgrind_log = util.valgrind_log_filepath(binary=self.binary,
|
valgrind_log = util.valgrind_log_filepath(binary=self.binary,
|
||||||
model=self.frame)
|
model=self.frame)
|
||||||
files = glob.glob("*" + valgrind_log)
|
files = glob.glob("*" + valgrind_log)
|
||||||
|
valgrind_failed = False
|
||||||
for valgrind_log in files:
|
for valgrind_log in files:
|
||||||
os.chmod(valgrind_log, 0o644)
|
os.chmod(valgrind_log, 0o644)
|
||||||
if os.path.getsize(valgrind_log) > 0:
|
if os.path.getsize(valgrind_log) > 0:
|
||||||
@ -11654,6 +11665,9 @@ switch value'''
|
|||||||
os.path.basename(valgrind_log)))
|
os.path.basename(valgrind_log)))
|
||||||
self.progress("Valgrind log: moving %s to %s" % (valgrind_log, target))
|
self.progress("Valgrind log: moving %s to %s" % (valgrind_log, target))
|
||||||
shutil.move(valgrind_log, target)
|
shutil.move(valgrind_log, target)
|
||||||
|
valgrind_failed = True
|
||||||
|
if valgrind_failed:
|
||||||
|
result_list.append(ValgrindFailedResult())
|
||||||
|
|
||||||
return result_list
|
return result_list
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user