Move ensure-no-dot-so-in-depends.py into full_test_suite.py

This commit is contained in:
Jack Grigg 2017-10-06 00:39:05 +01:00
parent aadf3aa159
commit 105b2b6248
No known key found for this signature in database
GPG Key ID: 665DBCD284F7DAFF
2 changed files with 42 additions and 44 deletions

View File

@ -1,41 +0,0 @@
#! /usr/bin/env python2
import sys
import os
def main():
this_script = os.path.abspath(sys.argv[0])
basedir = os.path.dirname(this_script)
arch_dir = os.path.join(
basedir,
'..',
'..',
'depends',
'x86_64-unknown-linux-gnu',
)
exit_code = 0
if os.path.isdir(arch_dir):
lib_dir = os.path.join(arch_dir, 'lib')
libraries = os.listdir(lib_dir)
for lib in libraries:
if lib.find(".so") != -1:
print lib
exit_code = 1
else:
exit_code = 2
print "arch-specific build dir not present: {}".format(arch_dir)
print "Did you build the ./depends tree?"
print "Are you on a currently unsupported architecture?"
if exit_code == 0:
print "PASS."
else:
print "FAIL."
sys.exit(exit_code)
if __name__ == '__main__':
main()

View File

@ -20,6 +20,41 @@ def repofile(filename):
return os.path.join(REPOROOT, filename)
#
# Custom test runners
#
def ensure_no_dot_so_in_depends():
arch_dir = os.path.join(
REPOROOT,
'depends',
'x86_64-unknown-linux-gnu',
)
exit_code = 0
if os.path.isdir(arch_dir):
lib_dir = os.path.join(arch_dir, 'lib')
libraries = os.listdir(lib_dir)
for lib in libraries:
if lib.find(".so") != -1:
print lib
exit_code = 1
else:
exit_code = 2
print "arch-specific build dir not present: {}".format(arch_dir)
print "Did you build the ./depends tree?"
print "Are you on a currently unsupported architecture?"
if exit_code == 0:
print "PASS."
else:
print "FAIL."
return exit_code == 0
#
# Tests
#
@ -38,7 +73,7 @@ STAGE_COMMANDS = {
'btest': [repofile('src/test/test_bitcoin'), '-p'],
'gtest': [repofile('src/zcash-gtest')],
'sec-hard': [repofile('qa/zcash/check-security-hardening.sh')],
'no-dot-so': [repofile('qa/zcash/ensure-no-dot-so-in-depends.py')],
'no-dot-so': ensure_no_dot_so_in_depends,
'secp256k1': ['make', '-C', repofile('src/secp256k1'), 'check'],
'univalue': ['make', '-C', repofile('src/univalue'), 'check'],
'rpc': [repofile('qa/pull-tester/rpc-tests.sh')],
@ -54,14 +89,18 @@ def run_stage(stage):
print('=' * (len(stage) + 14))
print
ret = subprocess.call(STAGE_COMMANDS[stage])
cmd = STAGE_COMMANDS[stage]
if type(cmd) == type([]):
ret = subprocess.call(cmd) == 0
else:
ret = cmd()
print
print('-' * (len(stage) + 15))
print('Finished stage %s' % stage)
print
return ret == 0
return ret
def main():
parser = argparse.ArgumentParser()