aboutsummaryrefslogtreecommitdiffstats
path: root/tools/test-common.sh
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2015-06-25 23:48:48 -0700
committerEvan Huus <eapache@gmail.com>2015-06-26 06:52:58 +0000
commit8f40e2cd8dc335fa9c927dba38000f8dde8e0b98 (patch)
tree88056d3047ae6a53e2a43d878a607a0673911c5b /tools/test-common.sh
parent4975c068b53d5061f032caf4d0e1094bce03096b (diff)
tools: permit setting BIN_DIR in the environment
For out-of-tree builds you have to pass the location of your build to our tools like the fuzz script, valgrind script etc. Modify them so that the value can be set in the environment rather than requiring a shell script flag. Set the environment variable in the vagrant provision step, so that the scripts Just Work (TM) in the VM. Change-Id: If8ce6b278176085ba6dd994137b82fc989b80124 Reviewed-on: https://code.wireshark.org/review/9168 Reviewed-by: Evan Huus <eapache@gmail.com>
Diffstat (limited to 'tools/test-common.sh')
-rw-r--r--tools/test-common.sh16
1 files changed, 9 insertions, 7 deletions
diff --git a/tools/test-common.sh b/tools/test-common.sh
index 002be98c1c..1b54cebbcc 100644
--- a/tools/test-common.sh
+++ b/tools/test-common.sh
@@ -32,7 +32,9 @@ DATE=/bin/date
BASE_NAME=$TEST_TYPE-`$DATE +%Y-%m-%d`-$$
# Directory containing binaries. Default current directory.
-BIN_DIR=.
+if [ -z "$WIRESHARK_BIN_DIR" ]; then
+ WIRESHARK_BIN_DIR=.
+fi
# Temporary file directory and names.
# (had problems with this on cygwin, tried TMP_DIR=./ which worked)
@@ -61,15 +63,15 @@ MAX_STACK=2033
# Insert z times an error into the capture file (0.02 seems to be a good value to find errors)
ERR_PROB=0.02
-# Call *after* any changes to BIN_DIR (e.g., via command-line options)
+# Call *after* any changes to WIRESHARK_BIN_DIR (e.g., via command-line options)
function ws_bind_exec_paths() {
# Tweak the following to your liking. Editcap must support "-E".
-TSHARK="$BIN_DIR/tshark"
-EDITCAP="$BIN_DIR/editcap"
-CAPINFOS="$BIN_DIR/capinfos"
-RANDPKT="$BIN_DIR/randpkt"
+TSHARK="$WIRESHARK_BIN_DIR/tshark"
+EDITCAP="$WIRESHARK_BIN_DIR/editcap"
+CAPINFOS="$WIRESHARK_BIN_DIR/capinfos"
+RANDPKT="$WIRESHARK_BIN_DIR/randpkt"
-if [ "$BIN_DIR" = "." ]; then
+if [ "$WIRESHARK_BIN_DIR" = "." ]; then
export WIRESHARK_RUN_FROM_BUILD_DIRECTORY=1
fi
}