mirror of https://github.com/ArduPilot/ardupilot
autotest: started adding tests for required tools
try to give useful error messages
This commit is contained in:
parent
8ac8ea9c1d
commit
4bad72f8ac
|
@ -27,6 +27,18 @@ def get_default_params(atype):
|
||||||
sil.close()
|
sil.close()
|
||||||
print("Saved defaults for %s to %s" % (atype, dest))
|
print("Saved defaults for %s to %s" % (atype, dest))
|
||||||
|
|
||||||
|
def test_prerequesites():
|
||||||
|
'''check we have the right directories and tools to run tests'''
|
||||||
|
print("Testing prerequesites")
|
||||||
|
util.mkdir_p(util.reltopdir('../buildlogs'))
|
||||||
|
if not os.path.exists(util.reltopdir('../HILTest/hil_quad.py')):
|
||||||
|
print('''
|
||||||
|
You need to install HILTest in %s
|
||||||
|
|
||||||
|
You can get it from git://git.samba.org/tridge/UAV/HILTest.git
|
||||||
|
|
||||||
|
''' % util.reltopdir('../HILTest'))
|
||||||
|
|
||||||
|
|
||||||
############## main program #############
|
############## main program #############
|
||||||
parser = optparse.OptionParser("autotest")
|
parser = optparse.OptionParser("autotest")
|
||||||
|
@ -56,6 +68,8 @@ def skip_step(step):
|
||||||
util.kill('ArduCopter.elf')
|
util.kill('ArduCopter.elf')
|
||||||
util.kill('ArduPilot.elf')
|
util.kill('ArduPilot.elf')
|
||||||
|
|
||||||
|
test_prerequesites()
|
||||||
|
|
||||||
for step in steps:
|
for step in steps:
|
||||||
if skip_step(step):
|
if skip_step(step):
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -86,3 +86,15 @@ def expect_setup_callback(e, callback):
|
||||||
e.expect_user_callback = callback
|
e.expect_user_callback = callback
|
||||||
e.expect_saved = e.expect
|
e.expect_saved = e.expect
|
||||||
e.expect = _expect_callback
|
e.expect = _expect_callback
|
||||||
|
|
||||||
|
def mkdir_p(dir):
|
||||||
|
'''like mkdir -p'''
|
||||||
|
if not dir:
|
||||||
|
return
|
||||||
|
if dir.endswith("/"):
|
||||||
|
mkdir_p(dir[:-1])
|
||||||
|
return
|
||||||
|
if os.path.isdir(dir):
|
||||||
|
return
|
||||||
|
mkdir_p(os.path.dirname(dir))
|
||||||
|
os.mkdir(dir)
|
||||||
|
|
Loading…
Reference in New Issue