autotest: run SIL binary under valgrind

this lets us find uninitialised variables in the APM code, and other
common C/C++ errors
This commit is contained in:
Andrew Tridgell 2011-11-04 09:59:33 +11:00
parent cfe6e333c9
commit 76985029dd
2 changed files with 3 additions and 1 deletions

View File

@ -319,6 +319,8 @@ def fly_ArduCopter():
hquad.close() hquad.close()
shutil.copy(logfile, util.reltopdir("../buildlogs/ArduCopter-test.mavlog")) 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("../pymavlink/examples/mavtogpx.py") + " " + util.reltopdir("../buildlogs/ArduCopter-test.mavlog"))
util.run_cmd(util.reltopdir("../bin/gpxtokml") + " " + util.reltopdir("../buildlogs/ArduCopter-test.mavlog.gpx")) util.run_cmd(util.reltopdir("../bin/gpxtokml") + " " + util.reltopdir("../buildlogs/ArduCopter-test.mavlog.gpx"))

View File

@ -50,7 +50,7 @@ def build_SIL(atype):
def start_SIL(atype): def start_SIL(atype):
'''launch a SIL instance''' '''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) logfile=sys.stdout, timeout=5)
ret.expect('Waiting for connection') ret.expect('Waiting for connection')
return ret return ret