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>
This commit is contained in:
Evan Huus 2015-01-02 11:11:21 -05:00
parent 5cb96a0eb5
commit 887d198361
1 changed files with 5 additions and 4 deletions

View File

@ -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