Run test_make_safe_uri. Retire broken run-tests.sh

This commit is contained in:
Emil Mikulic 2014-03-14 22:50:44 +11:00
parent a8bc378777
commit 9fe3ed4fc1
2 changed files with 9 additions and 8 deletions

View File

@ -5,6 +5,7 @@
cd $(dirname $0)
DIR=tmp.httpd.tests
PORT=12346
CC=gcc
if [ ! -e test.py ]; then
echo "can't find test.py, aborting" >&2
@ -12,7 +13,7 @@ if [ ! -e test.py ]; then
fi
if [ \( ! -x a.out \) -o \( ../darkhttpd.c -nt a.out \) ]; then
echo "===> building a.out, darkhttpd.gcno"
gcc -g -fprofile-arcs -ftest-coverage ../darkhttpd.c || exit 1
$CC -g -O2 -fprofile-arcs -ftest-coverage ../darkhttpd.c || exit 1
fi
if [ -e $DIR ]; then
rm -rf $DIR || exit 1
@ -20,6 +21,13 @@ fi
mkdir $DIR || exit 1
rm -f darkhttpd.gcda darkhttpd.log
echo "===> test_make_safe_uri"
$CC -g -O2 test_make_safe_uri.c -o test_make_safe_uri || exit 1
if ./test_make_safe_uri | egrep '^FAIL:'; then
echo test_make_safe_uri failed >&2
exit 1
fi
echo "===> run usage statement"
./a.out >/dev/null

View File

@ -1,7 +0,0 @@
#!/bin/sh
BDECFLAGS="-W -Wall -ansi -pedantic -Wbad-function-cast -Wcast-align \
-Wcast-qual -Wchar-subscripts -Winline -Wmissing-prototypes -Wnested-externs \
-Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings"
(cc $BDECFLAGS -g -O -DDEBUG test_make_safe_uri.c -o test_make_safe_uri &&
./test_make_safe_uri)