Commit Diff


commit - 66390331e836daad55adb33b41b8eecee0a4fd6b
commit + bd3c3461ae2a15d147300a84b259799fb998e3b5
blob - b5e9a61d525eb0d72c5e28cc95b1817549a69aa9
blob + 0287cc3aa9e5734e1db1cc3edbdc5b0657537f20
--- Makefile
+++ Makefile
@@ -30,16 +30,13 @@ uninstall:
 dist: clean
 	mkdir -p rene-$(VERSION)
 	cp -rf TODO README Makefile config.mk t $(SRC) $(MAN) rene-$(VERSION)
-	tar -czf rene-$(VERSION).tar.gz rene-$(VERSION)
+	tar cf - rene-$(VERSION) | gzip >rene-$(VERSION).tar.gz
 	rm -rf rene-$(VERSION)
 
 clean:
-	-rm -f $(BIN) $(OBJ)
-	-rm -f rene-$(VERSION).tag.gz
-	-rm -f *.core
-	-rm -f vgcore.*
+	-rm -f $(BIN) $(OBJ) *.tar.gz *.core
 
-test:
-	-sh ./t/t.sh
+test: all
+	sh ./t/t.sh
 
 .PHONY: all install uninstall clean dist test
blob - 2241ed7407971cea3182a2144cc599bce75de4c3
blob + a44ac577e57ee109d0ce17120b35e89fd0992747
--- config.mk
+++ config.mk
@@ -6,3 +6,6 @@ MANPREFIX = $(PREFIX)/man
 CC = cc
 CFLAGS = -std=c99 -Wall -pedantic
 CPPFLAGS = -D_DEFAULT_SOURCE
+
+# Debug
+#CFLAGS = -std=c99 -Wall -pedantic -Wextra -O0 -g
blob - c3e4f5385af30cf0e58e43911bcb19eeb8b585f6 (mode 644)
blob + /dev/null
--- t/base.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh
-
-tests="$(find . -name '*.t')"
-
-for t in $tests; do
-	base=${t%%.t}
-	printf '%-10s ' "$(basename $base)"
-	sh $t >$base.out 2>$base.err
-	cmp $base.out $base.exp >/dev/null 2>&1
-	res=$?
-	cmp $base.err $base.err.exp >/dev/null 2>&1
-	eres=$?
-	if [ "$res" = 0 ] && [ "$eres" = 0 ]; then
-		echo OK
-	else
-		echo FAIL
-	fi
-done
blob - 9dae219cfe88e8e6dd00b95724eb31b8cf0d87cf
blob + 34f2aee89b70c50243ca1d164044abe6df73de7e
--- t/t.sh
+++ t/t.sh
@@ -1,8 +1,19 @@
-dir="$(dirname $0)"
+#!/bin/sh
 
-echo ---- BASE ----
-sh "$dir"/base.sh
-
-echo
-echo -- VALGRIND --
-sh "$dir"/val.sh
+ret=0
+for t in t/*.t; do
+	base=${t%%.t}
+	printf '%-10s ' $(basename $base)
+	sh $t >$base.out 2>$base.err
+	cmp $base.out $base.exp >/dev/null 2>&1
+	res=$?
+	cmp $base.err $base.err.exp >/dev/null 2>&1
+	eres=$?
+	if [ $res = 0 ] && [ $eres = 0 ]; then
+		echo OK
+	else
+		echo FAIL
+		ret=1
+	fi
+done
+return $ret
blob - 671cb90afbfd5a0edaf9b236945f07774252ce56 (mode 644)
blob + /dev/null
--- t/val.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-res() {
-	printf '%-10s ' "$1"
-	if [ $2 = $err ]; then
-		echo FAIL
-	else
-		echo OK
-	fi
-}
-err=1
-
-echo AVERAGE
-set -- foo bar foobar barfoo barfoobar foobarfoo foofoofoo foo bar
-valgrind --error-exitcode=$err ./rene "$@" >/dev/null 2>&1
-res normal $?
-valgrind --error-exitcode=$err ./rene -l "$@" >/dev/null 2>&1
-res last $?
-valgrind --error-exitcode=$err ./rene -a "$@" >/dev/null 2>&1
-res all $?
-
-echo
-echo SLASH
-set -- foo bar foobar/ barfoo/ barfoobar/ foobarfoo/ foofoofoo/ foo/ bar/
-valgrind --error-exitcode=$err ./rene "$@" >/dev/null 2>&1
-res normal $?
-valgrind --error-exitcode=$err ./rene -l "$@" >/dev/null 2>&1
-res last $?
-valgrind --error-exitcode=$err ./rene -a "$@" >/dev/null 2>&1
-res all $?
-
-echo
-echo NOFROM
-set -- foo bar bar abracadebra lol abcd
-valgrind --error-exitcode=$err ./rene "$@" >/dev/null 2>&1
-res normal $?
-valgrind --error-exitcode=$err ./rene -l "$@" >/dev/null 2>&1
-res last $?
-valgrind --error-exitcode=$err ./rene -a "$@" >/dev/null 2>&1
-res all $?