diff --git a/tests/Makefile.am b/tests/Makefile.am index b372a70..ceb503b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -158,7 +158,7 @@ comment8.test \ comment9.test \ commen10.test \ commen11.test \ -comments-in-var-definition.test \ +comments-in-var-defn.test \ compile.test \ compile2.test \ compile_f90_c_cxx.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 5a815c9..7ecfcaa 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -425,7 +425,7 @@ comment8.test \ comment9.test \ commen10.test \ commen11.test \ -comments-in-var-definition.test \ +comments-in-var-defn.test \ compile.test \ compile2.test \ compile_f90_c_cxx.test \ diff --git a/tests/comments-in-var-definition.test b/tests/comments-in-var-defn.test similarity index 84% rename from tests/comments-in-var-definition.test rename to tests/comments-in-var-defn.test index 6d6a3e3..b00ee6b 100755 --- a/tests/comments-in-var-definition.test +++ b/tests/comments-in-var-defn.test @@ -21,11 +21,20 @@ set -e +cat >> configure.in <<'END' +AC_OUTPUT +END + # Use a slash in the comment, because automake takes the dirname # of TEXINFO_TEX to compute $(am__TEXINFO_TEX_DIR). cat > Makefile.am << 'END' TEXINFO_TEX = tex/texinfo.tex # some comment w/ a slash info_TEXINFOS = main.texi +.PHONY: test +test: + test tex/texinfo.tex = $(TEXINFO_TEX) + test -d '$(am__TEXINFO_TEX_DIR)' + case '$(am__TEXINFO_TEX_DIR)' in tex|./tex) :;; *) exit 1;; esac END cat > main.texi << 'END' @@ -41,7 +50,9 @@ $AUTOMAKE grep TEX Makefile.in # for debugging grep '^TEXINFO_TEX *= *tex/texinfo\.tex *# some comment w/ a slash *$' Makefile.in -grep '^am__TEXINFO_TEX_DIR *=.*[/ ]tex *$' Makefile.in -$EGREP 'am__TEXINFO_TEX_DIR.*=.*(comment|#)' Makefile.in && Exit 1 + +$AUTOCONF +./configure +$MAKE test : diff --git a/tests/vtexi3.test b/tests/vtexi3.test index 7f5b92f..34f46c5 100755 --- a/tests/vtexi3.test +++ b/tests/vtexi3.test @@ -73,29 +73,29 @@ $AUTOMAKE day='([1-9]|1[0-9]|2[0-9]|3[01])' month='(January|February|March|April|May|June|July|August|September|October|November|December)' -year='20[0-9][0-9]' # hopefully automake will be obsolete in 80 years ;-) +year='20[0-9][0-9]' # Hopefully automake will be obsolete in 80 years ;-) date="$day $month $year" do_check () { - # basename of the vers*.texi file + # Basename of the vers*.texi file. vfile=$1 - # $(srcdir) of the current build + # The $(srcdir) of the current build. srcdir=$2 - # vers*.texi must be created in $(srcdir) + # The vers*.texi file must be created in $(srcdir). $MAKE $srcdir/$vfile.texi cat $srcdir/$vfile.texi - # EDITION and VERSION are synonyms, as per documentation + # EDITION and VERSION are synonyms, as per documentation. grep "address@hidden EDITION 7\\.45\\.3a$" $srcdir/$vfile.texi grep "address@hidden VERSION 7\\.45\\.3a$" $srcdir/$vfile.texi - # check that UPDATED seems right, and that UPDATED and UPDATED-MONTH - # are consistent + # Check that UPDATED seems right, and that UPDATED and UPDATED-MONTH + # are consistent. $EGREP "address@hidden UPDATED $date$" $srcdir/$vfile.texi vmonth=`grep 'address@hidden UPDATED ' $srcdir/$vfile.texi | awk '{print $4, $5}'` grep "address@hidden UPDATED-MONTH $vmonth$" $srcdir/$vfile.texi - # check that the vers*.texi file is distributed according - # to $(DISTFILES) - $MAKE echo-distfiles # for debugging + # Check that the vers*.texi file is distributed according + # to $(DISTFILES). + $MAKE echo-distfiles # For debugging. $MAKE -s echo-distfiles | grep "[ /]$vfile\\.texi" } @@ -111,10 +111,10 @@ do_check vers1a_2b .. # and they must be newer than version.texi, so that make won't try # to rebuild them. $sleep -: > ../foobar.info -: > ../quux.info -: > ../zardoz.info -# check that the vers*.texi files are really distributed. +touch ../foobar.info +touch ../quux.info +touch ../zardoz.info +# Check that the vers*.texi files are really distributed. $MAKE distdir ls -l $distdir diff ../version.texi $distdir/version.texi diff --git a/tests/vtexi4.test b/tests/vtexi4.test index 1e5e3b0..69dffb5 100755 --- a/tests/vtexi4.test +++ b/tests/vtexi4.test @@ -26,20 +26,22 @@ required='makeinfo tex texi2dvi-o' set -e -day=`LC_ALL=C date '+%d'` || Exit 77 -month=`LC_ALL=C date '+%B'` || Exit 77 -year=`LC_ALL=C date '+%Y'` || Exit 77 - +case `LC_ALL=C date '+%u'` in + [1-7]) date_is_posix=:;; + *) date_is_posx=false;; +esac +$date_is_posix \ + && day=`LC_ALL=C date '+%d'` && test -n "$day" \ + && month=`LC_ALL=C date '+%B'` && test -n "$month" \ + && year=`LC_ALL=C date '+%Y'`&& test -n "$year" \ + || { echo "$me: 'date' is not POSIX-complaint enough"; Exit 77; } day=`echo "$day" | sed 's/^0//'` -# This test requires a grep the can parse nonprinting characters. -# BSD 'grep' works from a pipe, but not a seekable file. -# GNU or BSD 'grep -a' works on files, but is not portable. -tst='' -case `echo "$tst" | grep .` in - "$tst") ;; - *) echo "$me: grep can't parse nonprinting characters" >&2; Exit 77;; -esac +# This test requires a grep program that can work on non-text input. +(echo 'x' | grep x) || { + echo "$me: grep doesn't work on input that is not pure text" >&2 + Exit 77 +} cat > configure.in << END AC_INIT([$me], [123.456]) @@ -58,7 +60,8 @@ cat > Makefile.am << 'END' include defs.am info_TEXINFOS = foo.texi test-grepinfo: -## Not useless uses of cat; see above comments about grep. +## Not useless uses of cat: we only tested that grep worked on +## non-text input when that's given from a pipe. cat $(srcdir)/foo.info | grep 'GREPVERSION=$(my_version_rx)=' cat $(srcdir)/foo.info | grep 'GREPEDITION=$(my_version_rx)=' cat $(srcdir)/foo.info | grep 'GREPDATE=$(my_date_rx)='