16
test_script: test_script.in Makefile mke2fs.conf
14
all:: @DO_TEST_SUITE@ test_one test_script
16
test_one: $(srcdir)/test_one.in Makefile mke2fs.conf
17
@echo "Creating test_one script..."
18
@echo "#!/bin/sh" > test_one
19
@HTREE_CMT@ @echo "HTREE=y" >> test_one
20
@echo "SRCDIR=@srcdir@" >> test_one
21
@echo "DIFF_OPTS=@UNI_DIFF_OPTS@" >> test_one
22
@cat $(srcdir)/test_one.in >> test_one
25
test_script: test_one test_script.in Makefile mke2fs.conf
17
26
@echo "Creating test_script..."
18
27
@echo "#!/bin/sh" > test_script
19
@HTREE_CMT@ @echo "HTREE=y" >> test_script
20
@echo 'EGREP="@EGREP@"' >> test_script
21
28
@echo "SRCDIR=@srcdir@" >> test_script
22
@echo "DIFF_OPTS=@UNI_DIFF_OPTS@" >> test_script
23
29
@cat $(srcdir)/test_script.in >> test_script
24
30
@chmod +x test_script
26
32
mke2fs.conf: $(srcdir)/mke2fs.conf.in
27
33
$(CP) $(srcdir)/mke2fs.conf.in mke2fs.conf
35
.PHONY : test_pre test_post check always_run
37
TESTS=$(wildcard $(srcdir)/[a-z]_*)
38
$(TESTS):: test_one always_run
30
43
@echo "Running e2fsprogs test suite..."
35
@a=`/bin/ls *.failed 2> /dev/null | sed -e 's/.failed//'`; \
36
if test "$$a"x == x ; then \
37
echo "No failed tests" ; \
46
test_post: test_pre $(TESTS)
49
check:: test_pre test_post test_script
51
check-failed: $(basename $(wildcard *.failed))
54
66
EXPECT1=${TDIR}/expect.1
55
67
EXPECT2=${TDIR}/expect.2
56
68
# Target which generates the expect files for the new testcase.
57
testend: test_script ${TDIR}/image
69
testend: test_one ${TDIR}/image
58
70
gzip -9 ${TDIR}/image
59
@OUT1=${EXPECT1} OUT2=${EXPECT2} ./test_script ${TDIR}
71
@OUT1=${EXPECT1} OUT2=${EXPECT2} ./test_one ${TDIR}
60
72
@echo; echo; echo "*** output from first e2fsck run (${EXPECT1}) ***"
62
74
@echo "*** output from second e2fsck run (${EXPECT2}) ***"