Run test_make_safe_uri. Retire broken run-tests.sh
authorEmil Mikulic <emikulic@gmail.com>
Fri, 14 Mar 2014 11:50:44 +0000 (22:50 +1100)
committerEmil Mikulic <emikulic@gmail.com>
Fri, 14 Mar 2014 11:50:44 +0000 (22:50 +1100)
devel/cover
run-tests.sh [deleted file]

index b431d24..1d47ed5 100755 (executable)
@@ -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
 
diff --git a/run-tests.sh b/run-tests.sh
deleted file mode 100755 (executable)
index 3c53a99..0000000
+++ /dev/null
@@ -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)