aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2015-01-02 11:11:21 -0500
committerEvan Huus <eapache@gmail.com>2015-01-02 16:12:45 +0000
commit887d1983611e8134cabb773ee1ae7f262807f256 (patch)
tree90835ea06396f17a774da806e7b1b31f091f7a74
parent5cb96a0eb556400f373d1fbf35c62dbdbd2cef93 (diff)
test: improve check for out-of-tree tests
Rather than running `cd` and letting it potentially fail, just use the `-d` flag to test that `run` exists and is a directory. Avoids useless stderr output. Change-Id: Iab8b63681db6256aa1a6fc389d2536acbd491aba Reviewed-on: https://code.wireshark.org/review/6239 Reviewed-by: Evan Huus <eapache@gmail.com>
-rwxr-xr-xtest/test.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/test.sh b/test/test.sh
index b3651f5591..1a542a5043 100755
--- a/test/test.sh
+++ b/test/test.sh
@@ -62,10 +62,11 @@ FIN
fi
MYDIR=$(dirname $0)
-THISBINDIR=$(cd run && pwd)
-if [ -e $THISBINDIR/tshark -o -e $THISBINDIR/dumpcap -o -e $THISBINDIR/rawshark ]; then
- WS_BIN_PATH=${WS_BIN_PATH:-$THISBINDIR}
- WS_QT_BIN_PATH=${WS_QT_BIN_PATH:-$THISBINDIR}
+if [ -d run ]; then
+ if [ -e run/tshark -o -e run/dumpcap -o -e run/rawshark ]; then
+ WS_BIN_PATH=${WS_BIN_PATH:-$(cd run && pwd)}
+ WS_QT_BIN_PATH=${WS_QT_BIN_PATH:-$WS_BIN_PATH}
+ fi
fi
source $MYDIR/test-backend.sh
source $MYDIR/config.sh