1997-04-26 18:00:26 +04:00
|
|
|
#
|
|
|
|
# Makefile for the tests directory
|
|
|
|
#
|
|
|
|
|
|
|
|
srcdir = @srcdir@
|
|
|
|
top_srcdir = @top_srcdir@
|
|
|
|
VPATH = @srcdir@
|
|
|
|
top_builddir = ..
|
1997-04-29 18:53:37 +04:00
|
|
|
my_dir = tests
|
1997-04-26 18:00:26 +04:00
|
|
|
INSTALL = @INSTALL@
|
|
|
|
|
1997-04-29 18:53:37 +04:00
|
|
|
@MCONFIG@
|
|
|
|
|
2012-05-29 02:58:24 +04:00
|
|
|
all:: @DO_TEST_SUITE@ test_one test_script
|
1997-04-26 18:00:26 +04:00
|
|
|
|
2012-05-29 02:58:24 +04:00
|
|
|
test_one: $(srcdir)/test_one.in Makefile mke2fs.conf
|
|
|
|
@echo "Creating test_one script..."
|
|
|
|
@echo "#!/bin/sh" > test_one
|
2015-07-03 23:29:35 +03:00
|
|
|
@echo "HTREE=y" >> test_one
|
2015-07-04 05:02:30 +03:00
|
|
|
@echo "QUOTA=y" >> test_one
|
2012-05-29 02:58:24 +04:00
|
|
|
@echo "SRCDIR=@srcdir@" >> test_one
|
|
|
|
@echo "DIFF_OPTS=@UNI_DIFF_OPTS@" >> test_one
|
2016-05-29 08:07:40 +03:00
|
|
|
@echo "SIZEOF_TIME_T=@SIZEOF_TIME_T@" >> test_one
|
2012-05-29 02:58:24 +04:00
|
|
|
@cat $(srcdir)/test_one.in >> test_one
|
|
|
|
@chmod +x test_one
|
|
|
|
|
|
|
|
test_script: test_one test_script.in Makefile mke2fs.conf
|
1997-04-29 18:53:37 +04:00
|
|
|
@echo "Creating test_script..."
|
|
|
|
@echo "#!/bin/sh" > test_script
|
|
|
|
@echo "SRCDIR=@srcdir@" >> test_script
|
|
|
|
@cat $(srcdir)/test_script.in >> test_script
|
|
|
|
@chmod +x test_script
|
|
|
|
|
2010-05-15 04:18:11 +04:00
|
|
|
mke2fs.conf: $(srcdir)/mke2fs.conf.in
|
|
|
|
$(CP) $(srcdir)/mke2fs.conf.in mke2fs.conf
|
2008-02-19 16:32:58 +03:00
|
|
|
|
2012-05-29 02:58:24 +04:00
|
|
|
.PHONY : test_pre test_post check always_run
|
|
|
|
|
Fix build system to be compatible with BSD pmake
This fixes a number of incompatibilities which caused maint branch to
fail to build on on FreeBSD. Also fix the Makefile in the tests
directory so that "make -jN check" works correctly on FreeBSD.
Previously the Makefile in the tests directory used a construct which
was specific to GNU Make, which which silently expanded to an empty
list, which caused "make check" to be a no-op when running using BSD's
pmake. This Makefile has been changed to use the != macro assignment
syntax which is common to GNU make and BSD pmake. It's technically
not completely portable (it will not be recognized by Solaris's ccs
make, for example), but most other operating systems ship GNU make
(Solaris, AIX), or BSD pmake (*BSD, Mac OS) as either the primary or
alternative make utility that this should an acceptable compromise,
since it makes running all of tests using something like "make -j8
check" or "make -j16 check" run *much* faster.
There are still some caveats if using BSD pmake; in particular, if the
configure script is run on a system which has GNU make (installed as
gmake on FreeBSD for example), the configure script will find it, and
enable some GNU make features in the Makefile, and the generated
makefiles *must* be built using gmake. However, if isolated build
jail / chroot is used which only has pmake, the Makefiles should now
work with pmake.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-01-02 05:44:12 +03:00
|
|
|
always_run:
|
|
|
|
|
2016-03-22 07:01:19 +03:00
|
|
|
@ifGNUmake@TESTS=$(wildcard $(srcdir)/[a-z]_*)
|
|
|
|
@ifNotGNUmake@TESTS != echo $(srcdir)/[a-z]_*
|
Fix build system to be compatible with BSD pmake
This fixes a number of incompatibilities which caused maint branch to
fail to build on on FreeBSD. Also fix the Makefile in the tests
directory so that "make -jN check" works correctly on FreeBSD.
Previously the Makefile in the tests directory used a construct which
was specific to GNU Make, which which silently expanded to an empty
list, which caused "make check" to be a no-op when running using BSD's
pmake. This Makefile has been changed to use the != macro assignment
syntax which is common to GNU make and BSD pmake. It's technically
not completely portable (it will not be recognized by Solaris's ccs
make, for example), but most other operating systems ship GNU make
(Solaris, AIX), or BSD pmake (*BSD, Mac OS) as either the primary or
alternative make utility that this should an acceptable compromise,
since it makes running all of tests using something like "make -j8
check" or "make -j16 check" run *much* faster.
There are still some caveats if using BSD pmake; in particular, if the
configure script is run on a system which has GNU make (installed as
gmake on FreeBSD for example), the configure script will find it, and
enable some GNU make features in the Makefile, and the generated
makefiles *must* be built using gmake. However, if isolated build
jail / chroot is used which only has pmake, the Makefiles should now
work with pmake.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-01-02 05:44:12 +03:00
|
|
|
|
2012-05-29 02:58:24 +04:00
|
|
|
$(TESTS):: test_one always_run
|
|
|
|
@./test_one $@
|
|
|
|
|
Fix build system to be compatible with BSD pmake
This fixes a number of incompatibilities which caused maint branch to
fail to build on on FreeBSD. Also fix the Makefile in the tests
directory so that "make -jN check" works correctly on FreeBSD.
Previously the Makefile in the tests directory used a construct which
was specific to GNU Make, which which silently expanded to an empty
list, which caused "make check" to be a no-op when running using BSD's
pmake. This Makefile has been changed to use the != macro assignment
syntax which is common to GNU make and BSD pmake. It's technically
not completely portable (it will not be recognized by Solaris's ccs
make, for example), but most other operating systems ship GNU make
(Solaris, AIX), or BSD pmake (*BSD, Mac OS) as either the primary or
alternative make utility that this should an acceptable compromise,
since it makes running all of tests using something like "make -j8
check" or "make -j16 check" run *much* faster.
There are still some caveats if using BSD pmake; in particular, if the
configure script is run on a system which has GNU make (installed as
gmake on FreeBSD for example), the configure script will find it, and
enable some GNU make features in the Makefile, and the generated
makefiles *must* be built using gmake. However, if isolated build
jail / chroot is used which only has pmake, the Makefiles should now
work with pmake.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-01-02 05:44:12 +03:00
|
|
|
foo:
|
|
|
|
echo $(TESTS)
|
|
|
|
|
2012-05-29 02:58:24 +04:00
|
|
|
test_pre:
|
|
|
|
@$(RM) -f *.failed
|
1997-04-26 18:00:26 +04:00
|
|
|
@echo "Running e2fsprogs test suite..."
|
|
|
|
@echo " "
|
|
|
|
|
2012-05-29 02:58:24 +04:00
|
|
|
test_post: test_pre $(TESTS)
|
|
|
|
@$(srcdir)/test_post
|
|
|
|
|
|
|
|
check:: test_pre test_post test_script
|
|
|
|
|
|
|
|
check-failed: $(basename $(wildcard *.failed))
|
|
|
|
@$(srcdir)/test_post
|
2006-11-11 17:45:50 +03:00
|
|
|
|
|
|
|
|
2002-01-07 07:58:52 +03:00
|
|
|
TDIR=f_testnew
|
|
|
|
# Target which creates a new testcase to simplify adding new regression tests.
|
|
|
|
testnew:
|
|
|
|
@echo "Creating a new e2fsck testcase in ${TDIR}"
|
|
|
|
@mkdir -p ${TDIR}
|
|
|
|
dd if=/dev/zero of=${TDIR}/image bs=1k count=8k
|
2012-03-19 07:48:45 +04:00
|
|
|
$(top_srcdir)/misc/mke2fs -j -F -N 256 ${TDIR}/image
|
2002-01-07 07:58:52 +03:00
|
|
|
@echo "new test description" > ${TDIR}/name
|
|
|
|
@echo; echo; echo "New test filesystem at ${TDIR}/image."
|
|
|
|
@echo "Now, break the filesystem as appropriate, and run 'make testend'"
|
|
|
|
|
|
|
|
EXPECT1=${TDIR}/expect.1
|
|
|
|
EXPECT2=${TDIR}/expect.2
|
|
|
|
# Target which generates the expect files for the new testcase.
|
2012-05-29 02:58:24 +04:00
|
|
|
testend: test_one ${TDIR}/image
|
2002-01-07 07:58:52 +03:00
|
|
|
gzip -9 ${TDIR}/image
|
2012-05-29 02:58:24 +04:00
|
|
|
@OUT1=${EXPECT1} OUT2=${EXPECT2} ./test_one ${TDIR}
|
2002-01-07 07:58:52 +03:00
|
|
|
@echo; echo; echo "*** output from first e2fsck run (${EXPECT1}) ***"
|
|
|
|
@cat ${EXPECT1}
|
|
|
|
@echo "*** output from second e2fsck run (${EXPECT2}) ***"
|
|
|
|
@cat ${EXPECT2}
|
|
|
|
@echo "*** end of e2fsck output ***"
|
|
|
|
@echo; echo "Hopefully e2fsck now fixes this problem properly."
|
|
|
|
@echo "If all is well, edit ${TDIR}/name and rename ${TDIR}."
|
|
|
|
|
1997-04-26 18:00:26 +04:00
|
|
|
clean::
|
2012-05-29 02:58:24 +04:00
|
|
|
$(RM) -f *~ *.log *.new *.failed *.ok *.tmp test_one test_script mke2fs.conf
|
1997-04-26 18:00:26 +04:00
|
|
|
|
|
|
|
distclean:: clean
|
|
|
|
$(RM) -f Makefile
|
2002-01-07 07:58:52 +03:00
|
|
|
$(RM) -rf ${TDIR}
|