[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Autodetect CHUTNEY_PATH if chutney is next to tor



commit d9948dfc9d2b44de66e5a85a486c65a7e2781933
Author: teor (Tim Wilson-Brown) <teor2345@xxxxxxxxx>
Date:   Thu Aug 27 10:31:35 2015 +1000

    Autodetect CHUTNEY_PATH if chutney is next to tor
    
    If the chutney and tor sources are side-by-side in the same
    parent directory, autodetect the chutney path.
    
    Closes ticket 16903. Patch by "teor".
---
 Makefile.am                     |   11 ++++++++---
 changes/autodetect-chutney-path |    4 ++++
 src/test/test-network.sh        |    8 ++++++++
 3 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 9b68d27..b5e71aa 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -73,9 +73,14 @@ test: all
 
 need-chutney-path:
 	@if test ! -d "$$CHUTNEY_PATH"; then \
-		echo '$$CHUTNEY_PATH was not set.'; echo; \
-		echo "To run these tests, git clone https://git.torproject.org/chutney.git ; export CHUTNEY_PATH=\`pwd\`/chutney"; \
-		exit 1; \
+		echo '$$CHUTNEY_PATH was not set.'; \
+		if test -d $(top_srcdir)/../chutney -a -x $(top_srcdir)/../chutney/chutney; then \
+			echo "Assuming test-network.sh will find" $(top_srcdir)/../chutney; \
+		else \
+			echo; \
+			echo "To run these tests, git clone https://git.torproject.org/chutney.git ; export CHUTNEY_PATH=\`pwd\`/chutney"; \
+			exit 1; \
+		fi \
 	fi
 
 # Note that test-network requires a copy of Chutney in $CHUTNEY_PATH.
diff --git a/changes/autodetect-chutney-path b/changes/autodetect-chutney-path
new file mode 100644
index 0000000..4da6b24
--- /dev/null
+++ b/changes/autodetect-chutney-path
@@ -0,0 +1,4 @@
+  o Minor features (testing):
+    - Autodetect CHUTNEY_PATH if the chutney and tor sources are
+      side-by-side in the same parent directory.
+      Closes ticket 16903. Patch by "teor".
diff --git a/src/test/test-network.sh b/src/test/test-network.sh
index cc74c0f..806eb18 100755
--- a/src/test/test-network.sh
+++ b/src/test/test-network.sh
@@ -59,8 +59,16 @@ NETWORK_FLAVOUR=${NETWORK_FLAVOUR:-basic}
 CHUTNEY_NETWORK=networks/$NETWORK_FLAVOUR
 myname=$(basename $0)
 
+[ -n "$CHUTNEY_PATH" ] || {
+    echo "$myname: \$CHUTNEY_PATH not set, trying $TOR_DIR/../chutney"
+    CHUTNEY_PATH="$TOR_DIR/../chutney"
+}
+
 [ -d "$CHUTNEY_PATH" ] && [ -x "$CHUTNEY_PATH/chutney" ] || {
     echo "$myname: missing 'chutney' in CHUTNEY_PATH ($CHUTNEY_PATH)"
+    echo "$myname: Get chutney: git clone https://git.torproject.org/\
+chutney.git"
+    echo "$myname: Set \$CHUTNEY_PATH to a non-standard location: export CHUTNEY_PATH=\`pwd\`/chutney"
     exit 1
 }
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits