summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-09-24 15:07:39 -0400
committerNick Mathewson <nickm@torproject.org>2015-09-24 15:07:39 -0400
commiteb2188168e2eca96692ec5f60f298f7bc287e990 (patch)
tree7c5bc481e124d80d6a08d7342642013726e8aa49
parent3f52a33739944c53ecb2fd516a7cdab9fc14b1ba (diff)
downloadtor-eb2188168e2eca96692ec5f60f298f7bc287e990.tar.gz
tor-eb2188168e2eca96692ec5f60f298f7bc287e990.zip
Stop trying to generate test scripts via autoconf substitution.
Use environment variables instead. This repairs 'make distcheck', which was running into trouble when it tried to chmod the generated scripts. Fixes 17148.
-rw-r--r--changes/testscripts6
-rw-r--r--configure.ac3
-rw-r--r--src/test/include.am18
-rwxr-xr-xsrc/test/test_bt.sh9
-rw-r--r--src/test/test_bt.sh.in9
-rwxr-xr-xsrc/test/test_ntor.sh9
-rw-r--r--src/test/test_ntor.sh.in9
-rwxr-xr-xsrc/test/test_zero_length_keys.sh10
-rw-r--r--src/test/test_zero_length_keys.sh.in10
9 files changed, 43 insertions, 40 deletions
diff --git a/changes/testscripts b/changes/testscripts
new file mode 100644
index 0000000000..d3ac79f521
--- /dev/null
+++ b/changes/testscripts
@@ -0,0 +1,6 @@
+ o Testing:
+ - Use environment variables rather than autoconf substitutions to send
+ variables from the build system to the test scripts. This change should
+ be easier to maintain, and cause 'make distcheck' to work better than
+ before. Fixes bug 17148.
+
diff --git a/configure.ac b/configure.ac
index 98f8d30ea7..798de27f82 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1647,9 +1647,6 @@ AC_CONFIG_FILES([
src/config/torrc.minimal
scripts/maint/checkOptionDocs.pl
scripts/maint/updateVersions.pl
- src/test/test_zero_length_keys.sh
- src/test/test_ntor.sh
- src/test/test_bt.sh
])
if test x$asciidoc = xtrue && test "$ASCIIDOC" = "none" ; then
diff --git a/src/test/include.am b/src/test/include.am
index f7c0204832..0b64299f42 100644
--- a/src/test/include.am
+++ b/src/test/include.am
@@ -1,4 +1,9 @@
+export PYTHON=@PYTHON@
+export SHELL=@SHELL@
+export abs_top_srcdir
+export builddir
+
TESTSCRIPTS = src/test/test_zero_length_keys.sh
if USEPYTHON
@@ -16,18 +21,11 @@ TEST_CHUTNEY_FLAVORS_IPV6 = bridges+ipv6-min ipv6-exit-min
TEST_CHUTNEY_FLAVORS_MIXED = mixed
### This is a lovely feature, but it requires automake >= 1.12, and Tor
-### doesn't require that yet. Below is a kludge to work around.
+### doesn't require that yet.
###
# TEST_EXTENSIONS = .sh
# SH_LOG_COMPILER = $(SHELL)
-check-am: set-test-permissions
-
-.PHONY: set-test-permissions
-set-test-permissions: $(TESTSCRIPTS)
- $(AM_V_at)chmod u+x $(TESTSCRIPTS)
-
-
noinst_PROGRAMS+= src/test/bench
if UNITTESTS_ENABLED
noinst_PROGRAMS+= \
@@ -194,4 +192,6 @@ EXTRA_DIST += \
src/test/ntor_ref.py \
src/test/slownacl_curve25519.py \
src/test/zero_length_keys.sh \
- src/test/test_keygen.sh
+ src/test/test_keygen.sh \
+ src/test/test_zero_length_keys.sh \
+ src/test/test_ntor.sh src/test/test_bt.sh
diff --git a/src/test/test_bt.sh b/src/test/test_bt.sh
new file mode 100755
index 0000000000..15d16cb4a6
--- /dev/null
+++ b/src/test/test_bt.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+# Test backtrace functionality.
+
+exitcode=0
+
+${builddir:-.}/src/test/test-bt-cl assert | ${PYTHON:-python} "${abs_top_srcdir:-.}/src/test/bt_test.py" || exitcode=1
+${builddir:-.}/src/test/test-bt-cl crash | ${PYTHON:-python} "${abs_top_srcdir:-.}/src/test/bt_test.py" || exitcode=1
+
+exit ${exitcode}
diff --git a/src/test/test_bt.sh.in b/src/test/test_bt.sh.in
deleted file mode 100644
index ca8be965d4..0000000000
--- a/src/test/test_bt.sh.in
+++ /dev/null
@@ -1,9 +0,0 @@
-#!@SHELL@
-# Test backtrace functionality.
-
-exitcode=0
-
-@builddir@/src/test/test-bt-cl assert | @PYTHON@ @abs_top_srcdir@/src/test/bt_test.py || exitcode=1
-@builddir@/src/test/test-bt-cl crash | @PYTHON@ @abs_top_srcdir@/src/test/bt_test.py || exitcode=1
-
-exit ${exitcode}
diff --git a/src/test/test_ntor.sh b/src/test/test_ntor.sh
new file mode 100755
index 0000000000..3d9ef7aaa9
--- /dev/null
+++ b/src/test/test_ntor.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+# Validate Tor's ntor implementation.
+
+exitcode=0
+
+${PYTHON:-python} "${abs_top_srcdir:-.}/src/test/ntor_ref.py" test-tor || exitcode=1
+${PYTHON:-python} "${abs_top_srcdir:-.}/src/test/ntor_ref.py" self-test || exitcode=1
+
+exit ${exitcode}
diff --git a/src/test/test_ntor.sh.in b/src/test/test_ntor.sh.in
deleted file mode 100644
index be35384ddf..0000000000
--- a/src/test/test_ntor.sh.in
+++ /dev/null
@@ -1,9 +0,0 @@
-#!@SHELL@
-# Validate Tor's ntor implementation.
-
-exitcode=0
-
-@PYTHON@ @abs_top_srcdir@/src/test/ntor_ref.py test-tor || exitcode=1
-@PYTHON@ @abs_top_srcdir@/src/test/ntor_ref.py self-test || exitcode=1
-
-exit ${exitcode}
diff --git a/src/test/test_zero_length_keys.sh b/src/test/test_zero_length_keys.sh
new file mode 100755
index 0000000000..5471cc9120
--- /dev/null
+++ b/src/test/test_zero_length_keys.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+# Check that tor regenerates keys when key files are zero-length
+
+exitcode=0
+
+${SHELL:-sh} "${abs_top_srcdir:-.}/src/test/zero_length_keys.sh" "${builddir:-.}/src/or/tor" -z || exitcode=1
+${SHELL:-sh} "${abs_top_srcdir:-.}/src/test/zero_length_keys.sh" "${builddir:-.}/src/or/tor" -d || exitcode=1
+${SHELL:-sh} "${abs_top_srcdir:-.}/src/test/zero_length_keys.sh" "${builddir:-.}/src/or/tor" -e || exitcode=1
+
+exit ${exitcode}
diff --git a/src/test/test_zero_length_keys.sh.in b/src/test/test_zero_length_keys.sh.in
deleted file mode 100644
index d1492d5e20..0000000000
--- a/src/test/test_zero_length_keys.sh.in
+++ /dev/null
@@ -1,10 +0,0 @@
-#!@SHELL@
-# Check that tor regenerates keys when key files are zero-length
-
-exitcode=0
-
-@SHELL@ @abs_top_srcdir@/src/test/zero_length_keys.sh "@builddir@/src/or/tor" -z || exitcode=1
-@SHELL@ @abs_top_srcdir@/src/test/zero_length_keys.sh "@builddir@/src/or/tor" -d || exitcode=1
-@SHELL@ @abs_top_srcdir@/src/test/zero_length_keys.sh "@builddir@/src/or/tor" -e || exitcode=1
-
-exit ${exitcode}