aboutsummaryrefslogtreecommitdiffstats
path: root/tools/test-common.sh
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2017-08-11 09:54:25 -0700
committerGerald Combs <gerald@wireshark.org>2017-08-11 17:32:53 +0000
commitc09538e48c6fe241cec0af29294f4f7eaf4a3b83 (patch)
tree7a01017cb803a01d3b607a2da51ad84f8adb43e3 /tools/test-common.sh
parentfd2777b13887a785bd2ce722b4795aab50752afa (diff)
Tools: Check for ASan directly.
Check for ASan by testing tshark directly instead of trying to infer it from the build environment. Change-Id: I05813161cd8c20f0c105d976706f8b62fd360cb9 Reviewed-on: https://code.wireshark.org/review/23047 Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'tools/test-common.sh')
-rwxr-xr-xtools/test-common.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/test-common.sh b/tools/test-common.sh
index 22987a28e2..c2b0db697e 100755
--- a/tools/test-common.sh
+++ b/tools/test-common.sh
@@ -125,10 +125,11 @@ export ASAN_OPTIONS=detect_leaks=0
# See if we were configured with gcc or clang's AddressSanitizer.
CONFIGURED_WITH_ASAN=0
-if [ -r "$WIRESHARK_BIN_DIR/Makefile" ] ; then
- grep -- "-fsanitize=address" "$WIRESHARK_BIN_DIR/Makefile" > /dev/null 2>&1 && CONFIGURED_WITH_ASAN=1
-elif [ -r "$WIRESHARK_BIN_DIR/../CMakeFiles/tshark.dir/flags.make" ] ; then
- grep -- "-fsanitize=address" "$WIRESHARK_BIN_DIR/../CMakeFiles/tshark.dir/flags.make" > /dev/null 2>&1 && CONFIGURED_WITH_ASAN=1
+# If tshark is built with ASAN this will generate an error. We could
+# also pass help=1 and look for help text.
+ASAN_OPTIONS=Invalid_Option_Flag $TSHARK -h > /devnull 2>&1
+if [ $? -ne 0 ] ; then
+ CONFIGURED_WITH_ASAN=1
fi
export CONFIGURED_WITH_ASAN