From 670affa792e7613f6e6b5d960805418359ac0ec7 Mon Sep 17 00:00:00 2001 From: cypherpunks Date: Fri, 25 Sep 2015 16:39:11 +0200 Subject: [PATCH 1/3] Only setup environment variables for tests Using the AM_TESTS_ENVIRONMENT variable ensures the environment variables are only set during test execution and not during the compilation phase. --- Makefile.am | 7 +++++++ src/or/include.am | 3 --- src/test/include.am | 11 ++++++----- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Makefile.am b/Makefile.am index c226113cc8..beea69d95e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,6 +21,13 @@ bin_SCRIPTS= AM_CPPFLAGS= AM_CFLAGS = @TOR_SYSTEMD_CFLAGS@ SHELL = @SHELL@ + +if COVERAGE_ENABLED +TESTING_TOR_BINARY="$(top_builddir)/src/or/tor-cov" +else +TESTING_TOR_BINARY="$(top_builddir)/src/or/tor" +endif + include src/include.am include doc/include.am include contrib/include.am diff --git a/src/or/include.am b/src/or/include.am index d0e955f495..a3ac49c5d6 100644 --- a/src/or/include.am +++ b/src/or/include.am @@ -123,9 +123,6 @@ src_or_tor_cov_LDADD = src/or/libtor-testing.a src/common/libor-testing.a \ src/common/libor-event-testing.a src/trunnel/libor-trunnel-testing.a \ @TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ @TOR_OPENSSL_LIBS@ \ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ @TOR_SYSTEMD_LIBS@ -export TESTING_TOR_BINARY=$(top_builddir)/src/or/tor-cov -else -export TESTING_TOR_BINARY=$(top_builddir)/src/or/tor endif ORHEADERS = \ diff --git a/src/test/include.am b/src/test/include.am index a37fe23db8..a24c5bb1b4 100644 --- a/src/test/include.am +++ b/src/test/include.am @@ -1,8 +1,9 @@ - -export PYTHON=@PYTHON@ -export SHELL=@SHELL@ -export abs_top_srcdir=@abs_top_srcdir@ -export builddir=@builddir@ +AM_TESTS_ENVIRONMENT = \ + export PYTHON=@PYTHON@; \ + export SHELL=@SHELL@; \ + export abs_top_srcdir=@abs_top_srcdir@; \ + export builddir=@builddir@; \ + export TESTING_TOR_BINARY="$(TESTING_TOR_BINARY)"; TESTSCRIPTS = src/test/test_zero_length_keys.sh From 01a9575ad049643656254911167da901f0f7b04c Mon Sep 17 00:00:00 2001 From: cypherpunks Date: Fri, 11 Dec 2015 23:51:17 +0100 Subject: [PATCH 2/3] Use variables instead of substitutions Using variables removes the ambiguity about when to use variables and when to use substitutions. Variables always work. Substitutions only work when Autoconf knows about them which is not always the case. The variables are also placed between quotes to ensures spaces in the variables are handled properly. --- src/test/include.am | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/include.am b/src/test/include.am index a24c5bb1b4..9577e1e80f 100644 --- a/src/test/include.am +++ b/src/test/include.am @@ -1,8 +1,8 @@ AM_TESTS_ENVIRONMENT = \ - export PYTHON=@PYTHON@; \ - export SHELL=@SHELL@; \ - export abs_top_srcdir=@abs_top_srcdir@; \ - export builddir=@builddir@; \ + export PYTHON="$(PYTHON)"; \ + export SHELL="$(SHELL)"; \ + export abs_top_srcdir="$(abs_top_srcdir)"; \ + export builddir="$(builddir)"; \ export TESTING_TOR_BINARY="$(TESTING_TOR_BINARY)"; TESTSCRIPTS = src/test/test_zero_length_keys.sh From ff843ed39f78ac9762c80261ade580d31fb3a9a9 Mon Sep 17 00:00:00 2001 From: cypherpunks Date: Sat, 12 Dec 2015 00:06:41 +0100 Subject: [PATCH 3/3] Add changes file for 17818 --- changes/bug17818 | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changes/bug17818 diff --git a/changes/bug17818 b/changes/bug17818 new file mode 100644 index 0000000000..3d9afe329e --- /dev/null +++ b/changes/bug17818 @@ -0,0 +1,3 @@ + o Minor bugfixes (compilation): + - Isolate environment variables meant for tests from the rest of the + build system. Fixes bug 17818; bugfix on tor-0.2.7.3-rc.