mirror of
https://github.com/emikulic/darkhttpd.git
synced 2023-08-10 21:13:08 +03:00
run-tests: try to use the default gcc and clang.
This commit is contained in:
parent
6e8abe2324
commit
8207cf6b0f
@ -5,12 +5,17 @@
|
|||||||
cd $(dirname $0)
|
cd $(dirname $0)
|
||||||
declare -r DIR=tmp.httpd.tests
|
declare -r DIR=tmp.httpd.tests
|
||||||
declare -r PORT=12346
|
declare -r PORT=12346
|
||||||
declare -r CC=gcc
|
|
||||||
|
|
||||||
if [ ! -e test.py ]; then
|
if [ ! -e test.py ]; then
|
||||||
echo "fatal: can't find test.py. are you in the right directory?" >&2
|
echo "fatal: can't find test.py. are you in the right directory?" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
if [[ -z "$CC" ]]; then
|
||||||
|
CC="$(which gcc)"
|
||||||
|
fi
|
||||||
|
if [[ -z "$CLANG" ]]; then
|
||||||
|
CLANG="$(which clang)"
|
||||||
|
fi
|
||||||
|
|
||||||
runtests() {
|
runtests() {
|
||||||
if [ -e $DIR ]; then
|
if [ -e $DIR ]; then
|
||||||
@ -121,12 +126,9 @@ $CC -O2 -Wall -DNO_IPV6 ../darkhttpd.c || exit 1
|
|||||||
# -fsanitize=memory produces stderr and crashes.
|
# -fsanitize=memory produces stderr and crashes.
|
||||||
|
|
||||||
# msan first.
|
# msan first.
|
||||||
if [[ -z "$CLANG" ]]; then
|
if ! $CLANG -v 2>/dev/null; then
|
||||||
CLANG=~/llvm/install/bin/clang
|
echo "***WARNING*** Can't find clang."
|
||||||
fi
|
echo "Skipping memory sanitizer. Try setting the \$CLANG env var."
|
||||||
if [[ ! -e "$CLANG" ]]; then
|
|
||||||
echo "***WARNING*** \$CLANG ($CLANG) doesn't exist."
|
|
||||||
echo "Skipping memory sanitizer. Try setting the env var."
|
|
||||||
else
|
else
|
||||||
echo "===> building a.out for msan"
|
echo "===> building a.out for msan"
|
||||||
$CLANG -g -O2 -fsanitize=memory -DDEBUG -DAPBUF_INIT=1 \
|
$CLANG -g -O2 -fsanitize=memory -DDEBUG -DAPBUF_INIT=1 \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user