diff options
author | Evan Huus <eapache@gmail.com> | 2013-08-16 01:52:51 +0000 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2013-08-16 01:52:51 +0000 |
commit | 5d8b79cff5a9a3939876330046c1d75cd3ca4e55 (patch) | |
tree | 948ba04f9a69612a479fd69d2725d6c202ee649a | |
parent | 6538787c92075f207749da7a3c8a566ec703d0ea (diff) |
Try to use smarter path resolution and detection in order to work in
environments that are not the build tree (namely the fuzz-bot, but this might
make normal out-of-tree builds easier too).
svn path=/trunk/; revision=51387
-rwxr-xr-x | tools/fuzz-test.sh | 2 | ||||
-rwxr-xr-x | tools/valgrind-wireshark.sh | 15 |
2 files changed, 15 insertions, 2 deletions
diff --git a/tools/fuzz-test.sh b/tools/fuzz-test.sh index bc876d9bdf..c471777770 100755 --- a/tools/fuzz-test.sh +++ b/tools/fuzz-test.sh @@ -73,7 +73,7 @@ shift $(($OPTIND - 1)) ### usually you won't have to change anything below this line ### if [ $VALGRIND -eq 1 ]; then - RUNNER="$BIN_DIR/tools/valgrind-wireshark.sh" + RUNNER="`dirname $0`/valgrind-wireshark.sh" declare -a RUNNER_ARGS=("${CONFIG_PROFILE}${TWO_PASS}" "${CONFIG_PROFILE}${TWO_PASS}-T") else # Not using valgrind, use regular tshark. diff --git a/tools/valgrind-wireshark.sh b/tools/valgrind-wireshark.sh index bfd88843ce..84f823e5a6 100755 --- a/tools/valgrind-wireshark.sh +++ b/tools/valgrind-wireshark.sh @@ -89,4 +89,17 @@ export WIRESHARK_DEBUG_SE_NO_CHUNKS= export WIRESHARK_DEBUG_WMEM_OVERRIDE=simple export G_SLICE=always-malloc # or debug-blocks -./libtool --mode=execute valgrind $TOOL $VERBOSE $LEAK_CHECK $REACHABLE $TRACK_ORIGINS $BIN_DIR/$COMMAND $COMMAND_ARGS $PCAP $COMMAND_ARGS2 > /dev/null +COMMAND="$BIN_DIR/$COMMAND" + +if file $COMMAND | grep -q "ASCII text"; then + if [ -x "`dirname $0`/../libtool" ]; then + LIBTOOL="`dirname $0`/../libtool" + else + LIBTOOL="libtool" + fi + LIBTOOL="$LIBTOOL --mode=execute" +else + LIBTOOL="" +fi + +$LIBTOOL valgrind $TOOL $VERBOSE $LEAK_CHECK $REACHABLE $TRACK_ORIGINS $COMMAND $COMMAND_ARGS $PCAP $COMMAND_ARGS2 > /dev/null |