t/*: rearrange tests into numbered directories.

It was getting way too ad-hoc in there.  Let's reorganize the tests so that
there's a good, obvious, suggested sequence to run them in.
This commit is contained in:
Avery Pennarun 2012-02-08 00:33:00 -05:00
commit 7822f5a5bb
170 changed files with 100 additions and 80 deletions

3
t/111-compile/.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
*.o
CC
hello

11
t/111-compile/CC.do Normal file
View file

@ -0,0 +1,11 @@
redo-ifchange config.sh
. ./config.sh
exec >$3
cat <<-EOF
redo-ifchange \$2.c
gcc $CFLAGS -MD -MF \$3.deps -o \$3 -c \$2.c
read DEPS <\$3.deps
rm -f \$3.deps
redo-ifchange \${DEPS#*:}
EOF
chmod +x $3

6
t/111-compile/Makefile Normal file
View file

@ -0,0 +1,6 @@
all:
%: FORCE
+redo $@
.PHONY: FORCE

1
t/111-compile/all.do Normal file
View file

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

1
t/111-compile/clean.do Normal file
View file

@ -0,0 +1 @@
rm -f *.tmp *~ *.o hello CC

1
t/111-compile/config.sh Normal file
View file

@ -0,0 +1 @@
CFLAGS="-Wall"

View file

@ -0,0 +1,2 @@
redo-ifchange CC
. ./CC "$@"

4
t/111-compile/hello.do Normal file
View file

@ -0,0 +1,4 @@
DEPS="main.o
mystr.o"
redo-ifchange $DEPS
gcc -o $3 $DEPS

8
t/111-compile/main.c Normal file
View file

@ -0,0 +1,8 @@
#include <stdio.h>
#include "mystr.h"
int main()
{
printf("%s\n", mystr);
return 0;
}

4
t/111-compile/mystr.c Normal file
View file

@ -0,0 +1,4 @@
#include "mystr.h"
char *mystr = "Hello, world!";

6
t/111-compile/mystr.h Normal file
View file

@ -0,0 +1,6 @@
#ifndef __MYSTR_H
#define __MYSTR_H
extern char *mystr;
#endif