aboutsummaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorSteven Murdoch <Steven.Murdoch@cl.cam.ac.uk>2010-10-11 23:22:52 +0100
committerSteven Murdoch <Steven.Murdoch@cl.cam.ac.uk>2010-10-11 23:29:52 +0100
commit06eafb3fccc9c2c924d796c8cab542ac2dd761c0 (patch)
treee51a369029b5dfd3046f3e72ebce31fdd96a7160 /configure.in
parent8ecb5abbe18b4273a420479f59b907b15403a64e (diff)
downloadtor-06eafb3fccc9c2c924d796c8cab542ac2dd761c0.tar
tor-06eafb3fccc9c2c924d796c8cab542ac2dd761c0.tar.gz
Fix running unit tests from outside of the build directory (fixes bug #2051)
Currently the unit tests test_util_spawn_background_* assume that they are run from the Tor build directory. This is not the case when running make distcheck, so the test will fail. This problem is fixed by autoconf setting BUILDDIR to be the root of the Tor build directory, and this preprocessor variable being used to specify the absolute path to test-child. Also, in test-child, do not print out argv[0] because this will no longer be predictable. Found by Sebastian Hahn.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in7
1 files changed, 7 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index ae5ed207e..dddc4b8c6 100644
--- a/configure.in
+++ b/configure.in
@@ -931,6 +931,13 @@ if test "x$exec_prefix" = "xNONE"; then
exec_prefix=$prefix
fi
+if test "x$BUILDDIR" = "x"; then
+ BUILDDIR=`pwd`
+fi
+AC_SUBST(BUILDDIR)
+AH_TEMPLATE([BUILDDIR],[tor's build directory])
+AC_DEFINE_UNQUOTED(BUILDDIR,"$BUILDDIR")
+
if test "x$CONFDIR" = "x"; then
CONFDIR=`eval echo $sysconfdir/tor`
fi