Testsuite: Use `$PATH_SEPARATOR', not `:', when extending PATH.
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 25 Sep 2010 19:31:06 +0000 (21:31 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 25 Sep 2010 19:31:06 +0000 (21:31 +0200)
* tests/compile2.test: Do no uselessly (implicitly) repeat the
computation of PATH_SEPARATOR again.
* tests/instmany-mans.test: Use `$PATH_SEPARATOR', not `:', when
extending/redefining PATH.
* tests/instmany-python.test: Likewise.
* tests/instmany.test: Likewise.
* tests/man4.test: Likewise.
* tests/mkinst3.test: Likewise.
* tests/mmodely.test: Likewise.
* tests/multlib.test: Likewise.
* tests/txinfo30.test: Likewise.
* tests/README (Section "Writing test cases" subsection "Do"):
Updated.
* Makefile.am (sc_tests_PATH_SEPARATOR): New maintainer check.
(syntax_check_rules): Updated.

13 files changed:
ChangeLog
Makefile.am
Makefile.in
tests/README
tests/compile2.test
tests/instmany-mans.test
tests/instmany-python.test
tests/instmany.test
tests/man4.test
tests/mkinst3.test
tests/mmodely.test
tests/multlib.test
tests/txinfo30.test

index b96918c..6855f9a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,22 @@
 2010-09-25  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
+       Testsuite: Use `$PATH_SEPARATOR', not `:', when extending PATH.
+       * tests/compile2.test: Do no uselessly (implicitly) repeat the
+       computation of PATH_SEPARATOR again.
+       * tests/instmany-mans.test: Use `$PATH_SEPARATOR', not `:', when
+       extending/redefining PATH.
+       * tests/instmany-python.test: Likewise.
+       * tests/instmany.test: Likewise.
+       * tests/man4.test: Likewise.
+       * tests/mkinst3.test: Likewise.
+       * tests/mmodely.test: Likewise.
+       * tests/multlib.test: Likewise.
+       * tests/txinfo30.test: Likewise.
+       * tests/README (Section "Writing test cases" subsection "Do"):
+       Updated.
+       * Makefile.am (sc_tests_PATH_SEPARATOR): New maintainer check.
+       (syntax_check_rules): Updated.
+
        Testsuite: new variables `$PATH_SEPARATOR' and `$APIVERSION'.
        * tests/defs.in ($APIVERSION):  New AC_SUBST'd variable.
        ($ACLOCAL, $AUTOMAKE): Use it.
index 3aead75..d19d974 100644 (file)
@@ -140,6 +140,7 @@ sc_tests_required_after_defs \
 sc_tests_overriding_macros_on_cmdline \
 sc_tests_plain_sleep \
 sc_tests_plain_egrep_fgrep \
+sc_tests_PATH_SEPARATOR \
 sc_mkdir_p \
 sc_perl_at_substs \
 sc_unquoted_DESTDIR \
@@ -409,6 +410,13 @@ sc_tests_plain_egrep_fgrep:
          exit 1; \
        fi
 
+## Using `:' as a PATH separator is not portable.
+sc_tests_PATH_SEPARATOR:
+       @if grep -E '\bPATH=.*:.*' $(srcdir)/tests/*.test ; then \
+         echo "Use \`$$PATH_SEPARATOR', not \`:', in PATH definitions above." 1>&2; \
+         exit 1; \
+       fi
+
 sc_mkdir_p:
        @if grep 'mkdir_p' $(srcdir)/automake.in \
              $(srcdir)/lib/am/*.am $(srcdir)/tests/*.test; then \
index 528b80e..649565b 100644 (file)
@@ -298,6 +298,7 @@ sc_tests_required_after_defs \
 sc_tests_overriding_macros_on_cmdline \
 sc_tests_plain_sleep \
 sc_tests_plain_egrep_fgrep \
+sc_tests_PATH_SEPARATOR \
 sc_mkdir_p \
 sc_perl_at_substs \
 sc_unquoted_DESTDIR \
@@ -1090,6 +1091,12 @@ sc_tests_plain_egrep_fgrep:
          exit 1; \
        fi
 
+sc_tests_PATH_SEPARATOR:
+       @if grep -E '\bPATH=.*:.*' $(srcdir)/tests/*.test ; then \
+         echo "Use \`$$PATH_SEPARATOR', not \`:', in PATH definitions above." 1>&2; \
+         exit 1; \
+       fi
+
 sc_mkdir_p:
        @if grep 'mkdir_p' $(srcdir)/automake.in \
              $(srcdir)/lib/am/*.am $(srcdir)/tests/*.test; then \
index a063348..93f9cbf 100644 (file)
@@ -136,6 +136,9 @@ Do
 
   Use `Exit' rather than `exit' to abort a test.
 
+  Use `$PATH_SEPARATOR', not hard-coded `:', as the separator of
+  PATH's entries.
+
   It's more important to make sure that a feature works, than
   make sure that Automake's output looks correct.  It might look
   correct and still fail to work.  In other words, prefer
index fe4574a..334f154 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2009  Free Software Foundation, Inc.
+# Copyright (C) 2009, 2010 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -66,11 +66,7 @@ test -f "$amtest_object"
 # Absolute w32 paths should be accepted.
 # Do not actually run this test on anything that could be w32.
 test -d "C:\\" && Exit 77
-# This test is taken from Autoconf's _AS_PATH_SEPARATOR_PREPARE.
-(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
-  (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
-    Exit 77
-}
+case $PATH_SEPARATOR in ';'|':');; *) Exit 77;; esac
 
 amtest_source='C:\libltdl\libltdl\slist.c'
 amtest_object='C:\libltdl\libltdl\libltdl_libltdl_la-slist.obj'
index fcee60b..fe55be4 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2008, 2009  Free Software Foundation, Inc.
+# Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -123,7 +123,7 @@ test `find "$instdir" -type f -print | wc -l` = 0
 
 # Try whether we don't exceed the low limit.
 INSTALL='$(SHELL) $(top_builddir)/myinstall' $MAKE -e install
-env save_PATH="$PATH" PATH="`pwd`/..:$PATH" $MAKE uninstall
+env save_PATH="$PATH" PATH="`pwd`/..$PATH_SEPARATOR$PATH" $MAKE uninstall
 
 cd $subdir
 srcdir=../../$subdir
@@ -146,4 +146,5 @@ for file in page3.man page$nfiles.man npage3.man npage$nfiles.man; do
   $MAKE install-man3 && Exit 1
   chmod u+r $srcdir/$file
 done
+
 :
index 6831c9e..7648e1b 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2008, 2009  Free Software Foundation, Inc.
+# Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -113,7 +113,7 @@ test `find "$instdir" -type f -print | wc -l` = 0
 
 # Try whether we don't exceed the low limit.
 INSTALL='$(SHELL) $(top_builddir)/myinstall' $MAKE -e install
-env save_PATH="$PATH" PATH="`pwd`/..:$PATH" $MAKE uninstall
+env save_PATH="$PATH" PATH="`pwd`/..$PATH_SEPARATOR$PATH" $MAKE uninstall
 
 cd $subdir
 srcdir=../../$subdir
index a3b10cb..2de026d 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2008, 2009  Free Software Foundation, Inc.
+# Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -137,7 +137,7 @@ test `find "$instdir" -type f -print | wc -l` = 0
 
 # Try whether we don't exceed the low limit.
 INSTALL='$(SHELL) $(top_builddir)/myinstall' $MAKE -e install
-env save_PATH="$PATH" PATH="`pwd`/..:$PATH" $MAKE uninstall
+env save_PATH="$PATH" PATH="`pwd`/..$PATH_SEPARATOR$PATH" $MAKE uninstall
 
 cd $subdir
 srcdir=../../$subdir
index aa86a9e..de75f83 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2008  Free Software Foundation, Inc.
+# Copyright (C) 2008, 2010 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -73,7 +73,7 @@ END
 
 chmod +x foo bar help2man
 save_PATH=$PATH
-PATH=`pwd`:$PATH
+PATH=`pwd`$PATH_SEPARATOR$PATH
 
 $ACLOCAL
 $AUTOMAKE
index 18f18fb..20b9b04 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2005, 2006  Free Software Foundation, Inc.
+# Copyright (C) 2005, 2006, 2010 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -52,7 +52,7 @@ EOF
 chmod +x bin/mkdir
 AM_PATH=$PATH
 export AM_PATH
-PATH=`pwd`/bin:$PATH
+PATH=`pwd`/bin$PATH_SEPARATOR$PATH
 export PATH
 
 # Test mkinstalldirs without mkdir -p.
index 0f9bb3b..fc94d37 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 2004, 2006, 2007, 2009  Free Software Foundation, Inc.
+# Copyright (C) 2004, 2006, 2007, 2009, 2010 Free Software Foundation,
+# Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -82,7 +83,7 @@ cat >mylex.sh <<'END'
 echo "$@" >lex.yy.c
 END
 chmod +x myyacc.sh mylex.sh
-PATH="`pwd`:$PATH"
+PATH="`pwd`$PATH_SEPARATOR$PATH"
 
 # make maintainer-clean; ./configure; make should always work,
 # per GNU Standard.
index 5ff19d7..3f88be3 100755 (executable)
@@ -45,7 +45,7 @@ gcc ${1+"$@"}
 END
 
 chmod +x mycc
-PATH=`pwd`:$PATH
+PATH=`pwd`$PATH_SEPARATOR$PATH
 
 cat >Makefile.am <<'EOF'
 SUBDIRS = @subdirs@
index 8db42d9..296180d 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2005  Free Software Foundation, Inc.
+# Copyright (C) 2005, 2010 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -41,7 +41,7 @@ EOF
 
 chmod +x makeinfo
 
-PATH=`pwd`:$PATH
+PATH=`pwd`$PATH_SEPARATOR$PATH
 export PATH
 
 $ACLOCAL