Whamcloud - gitweb
Add new Makefile target "make testnew" which will allow easy testcase
authorAndreas Dilger <adilger@clusterfs.com>
Mon, 7 Jan 2002 04:58:52 +0000 (21:58 -0700)
committerAndreas Dilger <adilger@clusterfs.com>
Mon, 7 Jan 2002 04:58:52 +0000 (21:58 -0700)
creation for e2fsck.

tests/ChangeLog
tests/Makefile.in

index 174130d..cf633d5 100644 (file)
@@ -1,6 +1,13 @@
+2002-01-06  Andreas Dilger  <adilger@turbolinux.com>
+
+       * Makefile: Add new target "make testnew" which will create a new
+               testcase for e2fsck with an empty 8MB filesystem.  After
+               the test filesystem is appropriately "broken" the new
+               target "make testend" will create expect files for it.
+
 2001-12-16  Theodore Tso  <tytso@valinux.com>
 
-       * f_ext_journal: Addnew test which checks e2fsck's ability to use
+       * f_ext_journal: Add new test which checks e2fsck's ability to use
                an external journal.
 
 2001-11-30  Gabriel Paubert <paubert@iram.es>
index 5e04dc8..5800a5f 100644 (file)
@@ -25,9 +25,35 @@ check:: test_script
        @echo " "
        @./test_script
 
+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
+       mke2fs -j -F -N 256 ${TDIR}/image
+       @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.
+testend: test_script ${TDIR}/image
+       gzip -9 ${TDIR}/image
+       @OUT1=${EXPECT1} OUT2=${EXPECT2} ./test_script ${TDIR}
+       @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}."
+
 clean::
        $(RM) -f *.log *.new *.failed *.ok test.img test_script
 
 distclean:: clean
        $(RM) -f Makefile
+       $(RM) -rf ${TDIR}