mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-23 08:13:56 -04:00
autotest: use buildlogs directory consistently
This commit is contained in:
parent
aaff670ec4
commit
068b862888
@ -37,7 +37,7 @@ def get_default_params(atype):
|
|||||||
mavproxy = util.start_MAVProxy_SIL(atype)
|
mavproxy = util.start_MAVProxy_SIL(atype)
|
||||||
idx = mavproxy.expect('Saved [0-9]+ parameters to (\S+)')
|
idx = mavproxy.expect('Saved [0-9]+ parameters to (\S+)')
|
||||||
parmfile = mavproxy.match.group(1)
|
parmfile = mavproxy.match.group(1)
|
||||||
dest = 'buildlogs/%s-defaults.parm' % atype
|
dest = util.reltopdir('../buildlogs/%s-defaults.parm' % atype)
|
||||||
shutil.copy(parmfile, dest)
|
shutil.copy(parmfile, dest)
|
||||||
util.pexpect_close(mavproxy)
|
util.pexpect_close(mavproxy)
|
||||||
util.pexpect_close(sil)
|
util.pexpect_close(sil)
|
||||||
@ -100,7 +100,7 @@ def build_parameters():
|
|||||||
def convert_gpx():
|
def convert_gpx():
|
||||||
'''convert any tlog files to GPX and KML'''
|
'''convert any tlog files to GPX and KML'''
|
||||||
import glob
|
import glob
|
||||||
mavlog = glob.glob("buildlogs/*.tlog")
|
mavlog = glob.glob(util.reltopdir("../buildlogs/*.tlog"))
|
||||||
for m in mavlog:
|
for m in mavlog:
|
||||||
util.run_cmd(util.reltopdir("../mavlink/pymavlink/tools/mavtogpx.py") + " --nofixcheck " + m)
|
util.run_cmd(util.reltopdir("../mavlink/pymavlink/tools/mavtogpx.py") + " --nofixcheck " + m)
|
||||||
gpx = m + '.gpx'
|
gpx = m + '.gpx'
|
||||||
@ -114,7 +114,7 @@ def convert_gpx():
|
|||||||
def test_prerequisites():
|
def test_prerequisites():
|
||||||
'''check we have the right directories and tools to run tests'''
|
'''check we have the right directories and tools to run tests'''
|
||||||
print("Testing prerequisites")
|
print("Testing prerequisites")
|
||||||
util.mkdir_p('buildlogs')
|
util.mkdir_p(util.reltopdir('../buildlogs'))
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def alarm_handler(signum, frame):
|
def alarm_handler(signum, frame):
|
||||||
@ -282,13 +282,13 @@ class TestResults(object):
|
|||||||
def addglob(self, name, pattern):
|
def addglob(self, name, pattern):
|
||||||
'''add a set of files'''
|
'''add a set of files'''
|
||||||
import glob
|
import glob
|
||||||
for f in glob.glob('buildlogs/%s' % pattern):
|
for f in glob.glob(util.reltopdir('../buildlogs/%s' % pattern)):
|
||||||
self.addfile(name, os.path.basename(f))
|
self.addfile(name, os.path.basename(f))
|
||||||
|
|
||||||
def addglobimage(self, name, pattern):
|
def addglobimage(self, name, pattern):
|
||||||
'''add a set of images'''
|
'''add a set of images'''
|
||||||
import glob
|
import glob
|
||||||
for f in glob.glob('buildlogs/%s' % pattern):
|
for f in glob.glob(util.reltopdir('../buildlogs/%s' % pattern)):
|
||||||
self.addimage(name, os.path.basename(f))
|
self.addimage(name, os.path.basename(f))
|
||||||
|
|
||||||
|
|
||||||
@ -299,11 +299,11 @@ def write_webresults(results):
|
|||||||
t = mavtemplate.MAVTemplate()
|
t = mavtemplate.MAVTemplate()
|
||||||
for h in glob.glob(util.reltopdir('Tools/autotest/web/*.html')):
|
for h in glob.glob(util.reltopdir('Tools/autotest/web/*.html')):
|
||||||
html = util.loadfile(h)
|
html = util.loadfile(h)
|
||||||
f = open("buildlogs/%s" % os.path.basename(h), mode='w')
|
f = open(util.reltopdir("../buildlogs/%s" % os.path.basename(h)), mode='w')
|
||||||
t.write(f, html, results)
|
t.write(f, html, results)
|
||||||
f.close()
|
f.close()
|
||||||
for f in glob.glob(util.reltopdir('Tools/autotest/web/*.png')):
|
for f in glob.glob(util.reltopdir('Tools/autotest/web/*.png')):
|
||||||
shutil.copy(f, 'buildlogs/%s' % os.path.basename(f))
|
shutil.copy(f, util.reltopdir('../buildlogs/%s' % os.path.basename(f)))
|
||||||
|
|
||||||
def write_fullresults():
|
def write_fullresults():
|
||||||
'''write out full results set'''
|
'''write out full results set'''
|
||||||
@ -359,13 +359,13 @@ def check_logs(step):
|
|||||||
logs = glob.glob("logs/*.BIN")
|
logs = glob.glob("logs/*.BIN")
|
||||||
for log in logs:
|
for log in logs:
|
||||||
bname = os.path.basename(log)
|
bname = os.path.basename(log)
|
||||||
newname = "buildlogs/%s-%s" % (vehicle, bname)
|
newname = util.reltopdir("../buildlogs/%s-%s" % (vehicle, bname))
|
||||||
print("Renaming %s to %s" % (log, newname))
|
print("Renaming %s to %s" % (log, newname))
|
||||||
os.rename(log, newname)
|
os.rename(log, newname)
|
||||||
|
|
||||||
corefile = "core"
|
corefile = "core"
|
||||||
if os.path.exists(corefile):
|
if os.path.exists(corefile):
|
||||||
newname = "buildlogs/%s.core" % vehicle
|
newname = util.reltopdir("../buildlogs/%s.core" % vehicle)
|
||||||
print("Renaming %s to %s" % (corefile, newname))
|
print("Renaming %s to %s" % (corefile, newname))
|
||||||
os.rename(corefile, newname)
|
os.rename(corefile, newname)
|
||||||
util.run_cmd('/bin/cp A*/A*.elf ../buildlogs', dir=util.reltopdir('.'))
|
util.run_cmd('/bin/cp A*/A*.elf ../buildlogs', dir=util.reltopdir('.'))
|
||||||
@ -411,9 +411,9 @@ def run_tests(steps):
|
|||||||
return passed
|
return passed
|
||||||
|
|
||||||
|
|
||||||
util.mkdir_p('buildlogs')
|
util.mkdir_p(util.reltopdir('../buildlogs'))
|
||||||
|
|
||||||
lck = util.lock_file('buildlogs/autotest.lck')
|
lck = util.lock_file(util.reltopdir('../buildlogs/autotest.lck'))
|
||||||
if lck is None:
|
if lck is None:
|
||||||
print("autotest is locked - exiting")
|
print("autotest is locked - exiting")
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
Loading…
Reference in New Issue
Block a user