From e3524c66b230464fda73efe6ee620eb6ef13018c Mon Sep 17 00:00:00 2001 From: Taylor Hornby Date: Tue, 24 Nov 2015 14:36:46 -0700 Subject: [PATCH] Add zerocash-specific tests. --- qa/zerocash/ensure-no-dot-so-in-depends.py | 41 ++++++++++++++++++++++ qa/zerocash/full-test-suite.sh | 40 +++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100755 qa/zerocash/ensure-no-dot-so-in-depends.py create mode 100755 qa/zerocash/full-test-suite.sh diff --git a/qa/zerocash/ensure-no-dot-so-in-depends.py b/qa/zerocash/ensure-no-dot-so-in-depends.py new file mode 100755 index 00000000..beb4b9ec --- /dev/null +++ b/qa/zerocash/ensure-no-dot-so-in-depends.py @@ -0,0 +1,41 @@ +#! /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() diff --git a/qa/zerocash/full-test-suite.sh b/qa/zerocash/full-test-suite.sh new file mode 100755 index 00000000..7cce3e7b --- /dev/null +++ b/qa/zerocash/full-test-suite.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# +# Execute all of the automated tests related to zerocash. +# +# This script will someday define part of our acceptance criteria for +# pull requests. + +set -eu + +SUITE_EXIT_STATUS=0 +REPOROOT="$(readlink -f "$(dirname "$0")"/../../)" + +function run_test_phase +{ + echo "===== BEGIN: $*" + set +e + eval "$@" + if [ $? -eq 0 ] + then + echo "===== PASSED: $*" + else + echo "===== FAILED: $*" + SUITE_EXIT_STATUS=1 + fi + set -e +} + +cd "${REPOROOT}" + +# Test phases: +run_test_phase "${REPOROOT}/qa/zerocash/ensure-no-dot-so-in-depends.py" +run_test_phase make check + +exit $SUITE_EXIT_STATUS + + + + + +