]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tests: test mdate-sh with /bin/sh too
authorStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 13 Jun 2011 10:21:52 +0000 (12:21 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 13 Jun 2011 10:21:52 +0000 (12:21 +0200)
* tests/mdate5.test: Fetch the `mdate-sh' script using the
`get_shell_script' function, and run it directly instead of
using `$SHELL'.
* tests/mdate6.test: Likewise.  Since we are at it, make checks
on the `mdate-sh' output stricter, remove now unneeded calls to
aclocal and automake and creation/extension of `configure.in',
`Makefile.am' and `textutils.tex' files, and add a trailing `:'
command.
* tests/Makefile.am (config_shell_tests): Add `mdate5-w.shtst'
and `mdate6-w.shtst'.

ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/mdate5.test
tests/mdate6.test

index 9c88d7db325f548552be9cee15591a06c00ba954..c202a6d48f51bbc37f5547af43559b519489a610 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2011-06-13  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       tests: test mdate-sh with /bin/sh too
+       * tests/mdate5.test: Fetch the `mdate-sh' script using the
+       `get_shell_script' function, and run it directly instead of
+       using `$SHELL'.
+       * tests/mdate6.test: Likewise.  Since we are at it, make checks
+       on the `mdate-sh' output stricter, remove now unneeded calls to
+       aclocal and automake and creation/extension of `configure.in',
+       `Makefile.am' and `textutils.tex' files, and add a trailing `:'
+       command.
+       * tests/Makefile.am (config_shell_tests): Add `mdate5-w.shtst'
+       and `mdate6-w.shtst'.
+
 2011-06-07  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        tests: `lib/' shell scripts transparently tested also with $SHELL
index 91f1a9b5f70977f7ba4ed5e8d3807ee5bf660c7b..77c4570eec5e179d604071fd48f4a000ca424615 100644 (file)
@@ -110,6 +110,8 @@ config_shell_tests = \
   instsh2-w.shtst \
   instsh3-w.shtst \
   mkinst3-w.shtst \
+  mdate5-w.shtst \
+  mdate6-w.shtst \
   missing-w.shtst \
   missing2-w.shtst \
   missing3-w.shtst \
index eba4d1c9c9f354401e9118f305e08cbb447a7708..532765e824bac444670709d406815f7b1f646abc 100644 (file)
@@ -401,6 +401,8 @@ config_shell_tests = \
   instsh2-w.shtst \
   instsh3-w.shtst \
   mkinst3-w.shtst \
+  mdate5-w.shtst \
+  mdate6-w.shtst \
   missing-w.shtst \
   missing2-w.shtst \
   missing3-w.shtst \
index dc6ede12508b203014ae0b42b8121c66880d9808..f7c7cfed7c760bf30e2ddf769462b6d66bd4a748 100755 (executable)
 # Test to make sure mdate-sh works correctly.
 
 . ./defs || Exit 1
-cat >> configure.in << 'END'
-AC_OUTPUT
-END
 
-cat > Makefile.am << 'END'
-info_TEXINFOS = textutils.texi
-END
+get_shell_script mdate-sh
 
-cat > textutils.texi << 'END'
-@include version.texi
-@setfilename textutils.info
-END
-
-$ACLOCAL
-$AUTOMAKE --add-missing
-
-set x `$SHELL ./mdate-sh Makefile.am`
+set x `./mdate-sh install-sh`
 shift
+echo "$*" # For debugging.
+
 # Check that mdate output looks like a date:
 test $# = 3
 case $1$3 in *[!0-9]*) Exit 1;; esac
 test $1 -lt 32
+# Hopefully automake will be obsolete in 80 years ;-)
+case $3 in 20[0-9][0-9]) :;; *) Exit 1;; esac
+case $2 in
+  January|February|March|April|May|June|July|August) ;;
+  September|October|November|December) ;;
+  *) Exit 1
+esac
+
+# Stricter checks on the year required a POSIX date(1) command.
+if year=`date +%Y` && test $year -gt 2010; then
+  test $year = $3 || Exit 1
+fi
+
+:
index 94ddb4dc504c77ba50f79f73ae3c06ca064a030c..70360e721285bcf8bb835e609abdd298bd07c909 100755 (executable)
@@ -23,8 +23,9 @@ file='file  name $a'
 ( : > "$file" ) \
   || skip_ "file name with spaces and metacharacters not accepted"
 
-cp "$top_testsrcdir/lib/mdate-sh" .
-$SHELL ./mdate-sh "$file" >stdout 2>stderr ||
+get_shell_script mdate-sh
+
+./mdate-sh "$file" >stdout 2>stderr ||
   { cat stdout; cat stderr >&2; Exit 1; }
 cat stdout
 cat stderr >&2