2 TEST_SRCS:=$(shell find cases/ -name \*.t | sort -n -t/ -k2)
3 EXTRAPROGS:=cases/8.p cases/10.p
4 PARTPROGS:=$(filter-out $(EXTRAPROGS), $(patsubst %.t,%.p,$(TEST_SRCS)))
5 PROGS:=$(PARTPROGS) $(EXTRAPROGS)
9 CFLAGS+=-Wall -Werror -I../src -g -O2
12 # gcc-11 does not like the test case in 3.t that
13 # passes an invalid pointer (-1) to the kernel, so
14 # tell the compiler we do not need a warning here
15 cases/3.p: CFLAGS+=-Wno-stringop-overflow
17 # Change this on the build line to run tests against the installed libraries:
18 # make LIBAIO=-laio partcheck
19 LIBAIO?=../src/libaio.a
23 $(PROGS): %.p: %.t $(HARNESS_SRCS)
24 $(CC) $(CFLAGS) -DTEST_NAME=\"$<\" -o $@ main.c $(LIBAIO) -lpthread
27 rm -f $(PROGS) *.o runtests.out rofile wofile rwfile
31 testdir/rofile: testdir .PHONY
36 testdir/wofile: testdir .PHONY
41 testdir/rwfile: testdir .PHONY
46 testdir testdir.enospc testdir.ext2:
50 @if [ `id -u` -ne 0 ]; then echo Need root for check, try partcheck >&2; exit 1; fi
52 partcheck: $(PARTPROGS) testdir/rofile testdir/rwfile testdir/wofile
53 ./runtests.sh $(PARTPROGS)
56 dd if=/dev/zero bs=1M count=10 of=$@
59 extracheck: $(EXTRAPROGS) root testdir.ext2 testdir.enospc ext2.img
60 mount -o loop -t ext2 ext2-enospc.img testdir.enospc
61 ./runtests.sh cases/10.p; ret=$$?; umount testdir.enospc; exit $$ret
62 mount -o loop -t ext2 ext2.img testdir.ext2
63 ./runtests.sh cases/8.p; ret=$$?; umount testdir.ext2; exit $$ret
65 check: partcheck extracheck