[tor-commits] [tor/master] Fix tests when building out-of-tree

nickm at torproject.org nickm at torproject.org
Wed Jul 16 19:07:53 UTC 2014


commit facecce176c8fe15653676557c6151c4ea1ca994
Author: Nick Mathewson <nickm at torproject.org>
Date:   Wed Jul 16 21:07:22 2014 +0200

    Fix tests when building out-of-tree
    
    (This was too hard. Silly autoconf.)
---
 configure.ac               |    8 ++++++++
 src/test/test_entrynodes.c |    2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 414c72a..40e2558 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1407,6 +1407,14 @@ AC_SUBST(BINDIR)
 LOCALSTATEDIR=`eval echo $localstatedir`
 AC_SUBST(LOCALSTATEDIR)
 
+case "$srcdir" in
+  /*) TOP_SRCDIR=$srcdir;;
+  *) TOP_SRCDIR=$PWD/$srcdir;;
+esac
+
+AH_TEMPLATE([TOP_SRCDIR],[source directory we're building from])
+AC_DEFINE_UNQUOTED(TOP_SRCDIR,"$TOP_SRCDIR")
+
 if test "$bwin32" = true; then
   # Test if the linker supports the --nxcompat and --dynamicbase options
   # for Windows
diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c
index 1be0ce1..285a5ae 100644
--- a/src/test/test_entrynodes.c
+++ b/src/test/test_entrynodes.c
@@ -115,7 +115,7 @@ static void *
 fake_network_setup(const struct testcase_t *testcase)
 {
   /* This is the file containing our test descriptors. */
-  const char *fname = BUILDDIR "/src/test/test_descriptors.txt";
+  const char *fname = TOP_SRCDIR "/src/test/test_descriptors.txt";
 
   (void) testcase;
 



More information about the tor-commits mailing list