Whamcloud - gitweb
tests, mke2fs: add option to suppress xattr copying to fix f_extent_htree
[tools/e2fsprogs.git] / tests / Makefile.in
1 #
2 # Makefile for the tests directory
3 #
4
5 srcdir = @srcdir@
6 top_srcdir = @top_srcdir@
7 VPATH = @srcdir@
8 top_builddir = ..
9 my_dir = tests
10 INSTALL = @INSTALL@
11
12 @MCONFIG@
13
14 all:: @DO_TEST_SUITE@ test_one test_script
15
16 test_one: $(srcdir)/test_one.in Makefile mke2fs.conf
17         @echo "Creating test_one script..."
18         @echo "#!/bin/sh" > test_one
19         @echo "HTREE=y" >> test_one
20         @echo "QUOTA=y" >> test_one
21         @echo "SRCDIR=@srcdir@" >> test_one
22         @echo "DIFF_OPTS=@UNI_DIFF_OPTS@" >> test_one
23         @echo "SIZEOF_TIME_T=@SIZEOF_TIME_T@" >> test_one
24         @echo "DD=@DD@" >>test_one
25         @cat $(srcdir)/test_one.in >> test_one
26         @chmod +x test_one
27
28 test_script: test_one test_script.in Makefile mke2fs.conf
29         @echo "Creating test_script..."
30         @echo "#!/bin/sh" > test_script
31         @echo "SRCDIR=@srcdir@" >> test_script
32         @cat $(srcdir)/test_script.in >> test_script
33         @chmod +x test_script
34
35 mke2fs.conf: $(srcdir)/mke2fs.conf.in
36         $(CP) $(srcdir)/mke2fs.conf.in mke2fs.conf
37
38 .PHONY : test_pre test_post check always_run
39
40 always_run:
41
42 @ifGNUmake@TESTS=$(wildcard $(srcdir)/[a-z]_*)
43 @ifNotGNUmake@TESTS != echo $(srcdir)/[a-z]_*
44
45 SKIP_SLOW_TESTS=--skip-slow-tests
46
47 $(TESTS):: test_one always_run
48         @./test_one $(SKIP_SLOW_TESTS) $@
49
50 foo:
51         echo $(TESTS)
52
53 test_pre:
54         @$(RM) -f *.failed
55         @echo "Running e2fsprogs test suite..."
56         @echo " "
57
58 test_post: test_pre $(TESTS)
59         @$(srcdir)/test_post
60
61 check:: test_pre test_post test_script
62
63 fullcheck::
64         $(MAKE) SKIP_SLOW_TESTS= check
65
66 check-failed: $(basename $(wildcard *.failed))
67         @$(srcdir)/test_post
68
69
70 TDIR=f_testnew
71 # Target which creates a new testcase to simplify adding new regression tests.
72 testnew:
73         @echo "Creating a new e2fsck testcase in ${TDIR}"
74         @mkdir -p ${TDIR}
75         dd if=/dev/zero of=${TDIR}/image bs=1k count=8k
76         $(top_srcdir)/misc/mke2fs -j -F -N 256 ${TDIR}/image
77         @echo "new test description" > ${TDIR}/name
78         @echo; echo; echo "New test filesystem at ${TDIR}/image."
79         @echo "Now, break the filesystem as appropriate, and run 'make testend'"
80
81 EXPECT1=${TDIR}/expect.1
82 EXPECT2=${TDIR}/expect.2
83 # Target which generates the expect files for the new testcase.
84 testend: test_one ${TDIR}/image
85         gzip -9 ${TDIR}/image
86         @OUT1=${EXPECT1} OUT2=${EXPECT2} ./test_one ${TDIR}
87         @echo; echo; echo "*** output from first e2fsck run (${EXPECT1}) ***"
88         @cat ${EXPECT1}
89         @echo "*** output from second e2fsck run (${EXPECT2}) ***"
90         @cat ${EXPECT2}
91         @echo "*** end of e2fsck output ***"
92         @echo; echo "Hopefully e2fsck now fixes this problem properly."
93         @echo "If all is well, edit ${TDIR}/name and rename ${TDIR}."
94
95 clean::
96         $(RM) -f *~ *.log *.new *.failed *.ok *.tmp *.slow
97         $(RM) -f test_one test_script mke2fs.conf test_data.tmp
98
99 distclean:: clean
100         $(RM) -f Makefile
101         $(RM) -rf ${TDIR}