[Parted-commits] GNU Parted Official Repository: Changes to 'master'

Jim Meyering meyering at alioth.debian.org
Sat May 19 14:33:51 UTC 2007


 Makefile.maint      |   14 ++++++++++++++
 tests/Makefile.am   |    2 ++
 tests/t2000-mkfs.sh |    2 +-
 3 files changed, 17 insertions(+), 1 deletion(-)

New commits:
commit c1c80224d31fb1cfde26aa544790b307dccbb9a5
Author: Jim Meyering <jim at meyering.net>
Date:   Sat May 19 11:10:20 2007 +0200

    Make all tests get their initialization from the same place.
    * tests/t2000-mkfs.sh: Get initialization via ". ./init.sh",
    not via ". ./test-lib.sh".
    * Makefile.maint (sc_test_init): New test, to ensure we stay consistent.

diff --git a/Makefile.maint b/Makefile.maint
index ccb7370..40de154 100644
--- a/Makefile.maint
+++ b/Makefile.maint
@@ -179,6 +179,20 @@ sc_changelog:
 	  { echo '$(ME): found unexpected prefix in a ChangeLog' 1>&2;	\
 	    exit 1; } || :
 
+# Each test must source ./init.sh
+test_file_names = $(CVS_LIST_EXCEPT) | grep -E '/t[0-9].*\.sh$$'
+sc_test_init:
+	@if grep '^init\.sh:' tests/Makefile.am; then			\
+	  if $(test_file_names) > /dev/null; then			\
+	    grep -L '^\. \./init\.sh$$' $$($(test_file_names))		\
+	        | grep . &&						\
+	      { echo "$(ME): the above files lack '. ./init.sh'"	\
+		    1>&2; exit 1; } || :;				\
+	  else :;							\
+	  fi;								\
+	else :;								\
+	fi
+
 # Ensure that dd's definition of LONGEST_SYMBOL stays in sync
 # with the strings from the two affected variables.
 dd_c = $(srcdir)/src/dd.c
diff --git a/tests/t2000-mkfs.sh b/tests/t2000-mkfs.sh
index fb42f7a..79d327e 100755
--- a/tests/t2000-mkfs.sh
+++ b/tests/t2000-mkfs.sh
@@ -19,7 +19,7 @@
 
 test_description='Create some file systems using mkfs.'
 
-. ./test-lib.sh
+. ./init.sh
 
 N=40M
 dev=loop-file

commit 50ad995bbcc367efcb834175a9b28b70b194503e
Author: Jim Meyering <jim at meyering.net>
Date:   Sat May 19 08:49:40 2007 +0200

    * tests/Makefile.am (init.sh): Make this generated file read-only.

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 55e44e2..93247a0 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -14,5 +14,7 @@ EXTRA_DIST = \
 CLEANFILES = init.sh
 all: init.sh
 init.sh: Makefile.in
+	rm -f $@-t $@
 	( echo 'srcdir=$(srcdir)'; echo '. $$srcdir/test-lib.sh' ) > $@-t
+	chmod a-w $@-t
 	mv $@-t $@



More information about the Parted-commits mailing list