[tor-commits] [tor/master] Integreate test_keygen.sh into 'make check'.

nickm at torproject.org nickm at torproject.org
Wed Aug 19 17:37:40 UTC 2015


commit 4ce0b7e9163e255f2d71fb7111f032ca25acf22a
Author: Nick Mathewson <nickm at torproject.org>
Date:   Thu Aug 6 11:27:25 2015 -0400

    Integreate test_keygen.sh into 'make check'.
---
 Makefile.am             |    2 ++
 src/test/include.am     |    2 +-
 src/test/test_keygen.sh |   17 +++++++++++++----
 3 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 5b4d59c..8f6b38a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -25,6 +25,8 @@ include src/include.am
 include doc/include.am
 include contrib/include.am
 
+export TESTING_TOR_BINARY
+
 EXTRA_DIST+= \
 	ChangeLog					\
 	INSTALL						\
diff --git a/src/test/include.am b/src/test/include.am
index 7406c84..3fe4f50 100644
--- a/src/test/include.am
+++ b/src/test/include.am
@@ -1,5 +1,5 @@
 
-TESTSCRIPTS = src/test/test_zero_length_keys.sh
+TESTSCRIPTS = src/test/test_zero_length_keys.sh src/test/test_keygen.sh
 
 if USEPYTHON
 TESTSCRIPTS += src/test/test_ntor.sh src/test/test_bt.sh
diff --git a/src/test/test_keygen.sh b/src/test/test_keygen.sh
index 469b0ba..1f1cef5 100755
--- a/src/test/test_keygen.sh
+++ b/src/test/test_keygen.sh
@@ -7,11 +7,20 @@ umask 077
 set -e
 
 if [ $# -eq 0 ] || [ ! -f ${1} ] || [ ! -x ${1} ]; then
-  echo "Usage: ${0} PATH_TO_TOR [case-number]"
-  exit 1
-elif [ $# -ge 1 ]; then
+  if [ "$TESTING_TOR_BINARY" = ""] ; then
+    echo "Usage: ${0} PATH_TO_TOR [case-number]"
+    exit 1
+  fi
+fi
+
+if [ $# -ge 1 ]; then
   TOR_BINARY="${1}"
   shift
+else
+  TOR_BINARY="${TESTING_TOR_BINARY}"
+fi
+
+
 
   if [ $# -ge 1 ]; then
       dflt=0
@@ -35,7 +44,7 @@ elif [ $# -ge 1 ]; then
   if [ $# -ge 1 ]; then
      eval "CASE${1}"=1
   fi
-fi
+
 
 die() { echo "$1" >&2 ; exit 5; }
 check_dir() { [ -d "$1" ] || die "$1 did not exist"; }





More information about the tor-commits mailing list