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.
This commit is contained in:
Nick Mathewson 2015-09-24 15:07:39 -04:00
parent 3f52a33739
commit eb2188168e
9 changed files with 43 additions and 40 deletions

6
changes/testscripts Normal file
View File

@ -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.

View File

@ -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

View File

@ -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

9
src/test/test_bt.sh Executable file
View File

@ -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}

View File

@ -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}

9
src/test/test_ntor.sh Executable file
View File

@ -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}

View File

@ -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}

View File

@ -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}

View File

@ -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}