blob: c82698d0c5fb47530f9670f0c5b2bccefdb7ebaa [file] [log] [blame]
Theodore Ts'oa418d3a1997-04-26 14:00:26 +00001#
2# Makefile for the tests directory
3#
4
5srcdir = @srcdir@
6top_srcdir = @top_srcdir@
7VPATH = @srcdir@
8top_builddir = ..
Theodore Ts'o1e3472c1997-04-29 14:53:37 +00009my_dir = tests
Theodore Ts'oa418d3a1997-04-26 14:00:26 +000010INSTALL = @INSTALL@
11
Theodore Ts'o1e3472c1997-04-29 14:53:37 +000012@MCONFIG@
13
Theodore Ts'oa418d3a1997-04-26 14:00:26 +000014all:: @DO_TEST_SUITE@
15
Theodore Ts'o1e3472c1997-04-29 14:53:37 +000016test_script: test_script.in Makefile
17 @echo "Creating test_script..."
18 @echo "#!/bin/sh" > test_script
Theodore Ts'o8fdc9982002-06-25 23:26:34 -040019@HTREE_CMT@ @echo "HTREE=y" >> test_script
Theodore Ts'o32237012005-01-17 19:13:39 -050020 @echo 'EGREP="@EGREP@"' >> test_script
Theodore Ts'o1e3472c1997-04-29 14:53:37 +000021 @echo "SRCDIR=@srcdir@" >> test_script
22 @cat $(srcdir)/test_script.in >> test_script
23 @chmod +x test_script
24
25check:: test_script
Theodore Ts'oa418d3a1997-04-26 14:00:26 +000026 @echo "Running e2fsprogs test suite..."
27 @echo " "
Theodore Ts'o1e3472c1997-04-29 14:53:37 +000028 @./test_script
Theodore Ts'oa418d3a1997-04-26 14:00:26 +000029
Andreas Dilgerf10ff642002-01-06 21:58:52 -070030TDIR=f_testnew
31# Target which creates a new testcase to simplify adding new regression tests.
32testnew:
33 @echo "Creating a new e2fsck testcase in ${TDIR}"
34 @mkdir -p ${TDIR}
35 dd if=/dev/zero of=${TDIR}/image bs=1k count=8k
36 mke2fs -j -F -N 256 ${TDIR}/image
37 @echo "new test description" > ${TDIR}/name
38 @echo; echo; echo "New test filesystem at ${TDIR}/image."
39 @echo "Now, break the filesystem as appropriate, and run 'make testend'"
40
41EXPECT1=${TDIR}/expect.1
42EXPECT2=${TDIR}/expect.2
43# Target which generates the expect files for the new testcase.
44testend: test_script ${TDIR}/image
45 gzip -9 ${TDIR}/image
46 @OUT1=${EXPECT1} OUT2=${EXPECT2} ./test_script ${TDIR}
47 @echo; echo; echo "*** output from first e2fsck run (${EXPECT1}) ***"
48 @cat ${EXPECT1}
49 @echo "*** output from second e2fsck run (${EXPECT2}) ***"
50 @cat ${EXPECT2}
51 @echo "*** end of e2fsck output ***"
52 @echo; echo "Hopefully e2fsck now fixes this problem properly."
53 @echo "If all is well, edit ${TDIR}/name and rename ${TDIR}."
54
Theodore Ts'oa418d3a1997-04-26 14:00:26 +000055clean::
Theodore Ts'ob7aa0d62005-02-05 15:48:49 -050056 $(RM) -f *~ *.log *.new *.failed *.ok test.img test_script
Theodore Ts'oa418d3a1997-04-26 14:00:26 +000057
58distclean:: clean
59 $(RM) -f Makefile
Andreas Dilgerf10ff642002-01-06 21:58:52 -070060 $(RM) -rf ${TDIR}