From 76985029ddd8ec7e78dec727026570a2e484aa94 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 4 Nov 2011 09:59:33 +1100 Subject: [PATCH] autotest: run SIL binary under valgrind this lets us find uninitialised variables in the APM code, and other common C/C++ errors --- Tools/autotest/arducopter.py | 2 ++ Tools/autotest/util.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Tools/autotest/arducopter.py b/Tools/autotest/arducopter.py index 2e0807a088..92ec25adc5 100644 --- a/Tools/autotest/arducopter.py +++ b/Tools/autotest/arducopter.py @@ -319,6 +319,8 @@ def fly_ArduCopter(): hquad.close() shutil.copy(logfile, util.reltopdir("../buildlogs/ArduCopter-test.mavlog")) + if os.path.exists('ArduCopter-valgrind.log'): + shutil.copy("ArduCopter-valgrind.log", util.reltopdir("../buildlogs/ArduCopter-valgrind.log")) util.run_cmd(util.reltopdir("../pymavlink/examples/mavtogpx.py") + " " + util.reltopdir("../buildlogs/ArduCopter-test.mavlog")) util.run_cmd(util.reltopdir("../bin/gpxtokml") + " " + util.reltopdir("../buildlogs/ArduCopter-test.mavlog.gpx")) diff --git a/Tools/autotest/util.py b/Tools/autotest/util.py index f08421044f..dbd8873322 100644 --- a/Tools/autotest/util.py +++ b/Tools/autotest/util.py @@ -50,7 +50,7 @@ def build_SIL(atype): def start_SIL(atype): '''launch a SIL instance''' - ret = pexpect.spawn(reltopdir('tmp/%s.build/%s.elf' % (atype, atype)), + ret = pexpect.spawn(('valgrind -q --log-file=%s-valgrind.log ' % atype) + reltopdir('tmp/%s.build/%s.elf' % (atype, atype)), logfile=sys.stdout, timeout=5) ret.expect('Waiting for connection') return ret