summaryrefslogtreecommitdiff
path: root/harness/Makefile
blob: d2483fdda2331b6e18dc099ca95bb61b2897c716 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# foo.
TEST_SRCS:=$(shell find cases/ -name \*.t | sort -n -t/ -k2)
PROGS:=$(patsubst %.t,%.p,$(TEST_SRCS))
HARNESS_SRCS:=main.c
# io_queue.c

CFLAGS=-Wall -Werror -g -O -laio
#-lpthread -lrt

all: $(PROGS)

$(PROGS): %.p: %.t $(HARNESS_SRCS)
	$(CC) $(CFLAGS) -DTEST_NAME=\"$<\" -o $@ main.c

clean:
	rm -f $(PROGS) *.o runtests.out rofile wofile rwfile

.PHONY:

testdir/rofile: .PHONY
	rm -f $@
	echo "test" >$@
	chmod 400 $@

testdir/wofile: .PHONY
	rm -f $@
	echo "test" >$@
	chmod 200 $@

testdir/rwfile: .PHONY
	rm -f $@
	echo "test" >$@
	chmod 600 $@

check: $(PROGS) testdir/rofile testdir/rwfile testdir/wofile
	./runtests.sh $(PROGS)