From 8207cf6b0fdf3e3ff95599b9d7e7a16f2f6859a8 Mon Sep 17 00:00:00 2001 From: Emil Mikulic Date: Mon, 10 Dec 2018 21:12:24 +1100 Subject: [PATCH] run-tests: try to use the default gcc and clang. --- devel/run-tests | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/devel/run-tests b/devel/run-tests index 12042ed..a8b66a1 100755 --- a/devel/run-tests +++ b/devel/run-tests @@ -5,12 +5,17 @@ cd $(dirname $0) declare -r DIR=tmp.httpd.tests declare -r PORT=12346 -declare -r CC=gcc if [ ! -e test.py ]; then echo "fatal: can't find test.py. are you in the right directory?" >&2 exit 1 fi +if [[ -z "$CC" ]]; then + CC="$(which gcc)" +fi +if [[ -z "$CLANG" ]]; then + CLANG="$(which clang)" +fi runtests() { if [ -e $DIR ]; then @@ -121,12 +126,9 @@ $CC -O2 -Wall -DNO_IPV6 ../darkhttpd.c || exit 1 # -fsanitize=memory produces stderr and crashes. # msan first. -if [[ -z "$CLANG" ]]; then - CLANG=~/llvm/install/bin/clang -fi -if [[ ! -e "$CLANG" ]]; then - echo "***WARNING*** \$CLANG ($CLANG) doesn't exist." - echo "Skipping memory sanitizer. Try setting the env var." +if ! $CLANG -v 2>/dev/null; then + echo "***WARNING*** Can't find clang." + echo "Skipping memory sanitizer. Try setting the \$CLANG env var." else echo "===> building a.out for msan" $CLANG -g -O2 -fsanitize=memory -DDEBUG -DAPBUF_INIT=1 \