Extremely basic integration of wvtest for testing.

And move test scripts into t/ subdir to keep things clean.

As part of that, make sure redo adds itself to the PATH on startup so that
subscripts can find it.
This commit is contained in:
Avery Pennarun 2010-11-12 17:16:03 -08:00
commit 07d3e3b13c
14 changed files with 342 additions and 5 deletions

4
t/CC.do Normal file
View file

@ -0,0 +1,4 @@
cat <<-EOF
gcc -Wall -o /dev/fd/1 -c "\$1"
EOF
chmod a+x $3

6
t/LD.do Normal file
View file

@ -0,0 +1,6 @@
cat <<-EOF
OUT="\$1"
shift
gcc -Wall -o "\$OUT" "\$@"
EOF
chmod a+x $3

7
t/hello.c Normal file
View file

@ -0,0 +1,7 @@
#include <stdio.h>
int main()
{
printf("hello, world!\n");
return 0;
}

2
t/hello.do Normal file
View file

@ -0,0 +1,2 @@
redo --ifchange LD hello.o
./LD hello hello.o

2
t/hello.o.do Normal file
View file

@ -0,0 +1,2 @@
redo --ifchange CC hello.c
./CC hello.c

1
t/it.do Normal file
View file

@ -0,0 +1 @@
redo --ifchange hello

2
t/runtests.do Normal file
View file

@ -0,0 +1,2 @@
redo --ifchange it
./hello >&2