Bug fixes, test feature
authorTom Tromey <tromey@redhat.com>
Wed, 28 Feb 1996 19:10:06 +0000 (19:10 +0000)
committerTom Tromey <tromey@redhat.com>
Wed, 28 Feb 1996 19:10:06 +0000 (19:10 +0000)
16 files changed:
ChangeLog
Makefile.am
Makefile.in
TODO
automake.in
automake.texi
configure
configure.in
lib/am/Makefile.am
lib/mdate-sh
mdate-sh
tests/ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/acoutqnl.test [new file with mode: 0755]
version.texi

index 30f106f..638836a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,33 @@
+Wed Feb 28 08:40:55 1996  Tom Tromey  <tromey@creche.cygnus.com>
+
+       * automake.in (handle_tests): New function.
+       (generate_makefile): Call it.
+       (handle_subdirs): Skip directories whose names look like configure
+       substitutions.
+       (handle_subdirs): Require intl and po, not @INTLSUB@ and @POSUB@,
+       when using gettext.
+       (scan_configure): Clear in_ac_output if "]" found.  Test
+       acoutqnl.test.
+
+Tue Feb 27 12:00:36 1996  Tom Tromey  <tromey@creche.cygnus.com>
+
+       * mdate-sh: New version from Ulrich Drepper.
+
+       * automake.in (handle_source_transform): Changed fill back to
+       empty string.
+       (handle_libraries): Ditto.
+       (handle_dist): Ditto.
+       (handle_dependencies): Ditto.
+       (handle_footer): Ditto.
+       (handle_phony): Ditto.
+
+       * Makefile.am (DIST_SUBDIRS): Removed.
+       (installcheck-local): Use Perl, not test -x.
+       (PERL): New macro.
+       (maintainer-check): Use $(PERL), not @PERL@.
+
+       * configure.in (VERSION): Upped to 0.31.
+
 Sat Feb 24 15:02:19 1996  Tom Tromey  <tromey@creche.cygnus.com>
 
        * automake.in (scan_configure): AC_CHECK_TOOL requires config.sub
index e085355..2b8270c 100644 (file)
@@ -2,6 +2,7 @@
 
 AUTOMAKE_OPTIONS = gnits
 MAINT_CHARSET = latin1
+PERL = @PERL@
 
 SUBDIRS = tests
 
@@ -29,20 +30,19 @@ pkgdata_SCRIPTS = config.guess config.sub install-sh mdate-sh mkinstalldirs
 
 CLEANFILES = automake
 
-# Gross.
-DIST_SUBDIRS = samples/cpio/*Makefile.am
-
 # The following requires a fixed version of the Emacs 19.30 etags.
 ETAGS_ARGS = automake.in --lang=none \
  --regex='/^@node[ \t]+\([^,]+\)/\1/' automake.texi
 
+## `test -x' is not portable.  So we use Perl instead.  If Perl
+## doesn't exist, then this test is meaningless anyway.
 # Check to make sure some installed files are executable.
 installcheck-local:
-       test -x $(pkgdatadir)/config.guess
-       test -x $(pkgdatadir)/config.sub
-       test -x $(pkgdatadir)/install-sh
-       test -x $(pkgdatadir)/mdate-sh
-       test -x $(pkgdatadir)/mkinstalldirs
+       $(PERL) -e "exit ! -x '$(pkgdatadir)/config.guess';"
+       $(PERL) -e "exit ! -x '$(pkgdatadir)/config.sub';"
+       $(PERL) -e "exit ! -x '$(pkgdatadir)/install-sh';"
+       $(PERL) -e "exit ! -x '$(pkgdatadir)/mdate-sh';"
+       $(PERL) -e "exit ! -x '$(pkgdatadir)/mkinstalldirs';"
 
 # Some simple checks:
 # * syntax check with perl4 and perl5.
@@ -50,7 +50,7 @@ installcheck-local:
 # * expect no instances of '${...}'
 # These are only really guaranteed to work on my machine.
 maintainer-check: automake check
-       @PERL@ -c -w automake
+       $(PERL) -c -w automake
        @if grep '^[^#].*true' $(srcdir)/[a-z]*.am; then \
          echo "can't use 'true' in GNU Makefile" 1>&2; \
          exit 1;                               \
index b019cbb..86863ad 100644 (file)
@@ -1,4 +1,4 @@
-# Makefile.in generated automatically by automake 0.30 from Makefile.am
+# Makefile.in generated automatically by automake 0.31 from Makefile.am
 
 # Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
@@ -40,6 +40,7 @@ transform = @program_transform_name@
 
 AUTOMAKE_OPTIONS = gnits
 MAINT_CHARSET = latin1
+PERL = @PERL@
 
 SUBDIRS = tests
 
@@ -66,9 +67,6 @@ pkgdata_SCRIPTS = config.guess config.sub install-sh mdate-sh mkinstalldirs
 
 CLEANFILES = automake
 
-# Gross.
-DIST_SUBDIRS = samples/cpio/*Makefile.am
-
 # The following requires a fixed version of the Emacs 19.30 etags.
 ETAGS_ARGS = automake.in --lang=none \
  --regex='/^@node[ \t]+\([^,]+\)/\1/' automake.texi
@@ -86,9 +84,9 @@ TEXINFOS = automake.texi
 DATA = $(pkgdata_DATA)
 
 DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \
-    Makefile.in NEWS README THANKS TODO aclocal.m4 automake.in \
-    config.guess config.sub configure configure.in install-sh mdate-sh \
-    mkinstalldirs stamp-vti texinfo.tex version.texi
+Makefile.in NEWS README THANKS TODO aclocal.m4 automake.in config.guess \
+config.sub configure configure.in install-sh mdate-sh mkinstalldirs \
+stamp-vti texinfo.tex version.texi
 
 
 PACKAGE = @PACKAGE@
@@ -278,10 +276,6 @@ dist: $(DEP_DISTFILES)
          chmod 777 $(distdir)/$$subdir;        \
          (cd $$subdir && $(MAKE) dist) || exit 1; \
        done
-       @for dir in $(DIST_SUBDIRS); do         \
-         echo copying directory $$dir;         \
-         tar chf - $$dir | (cd $(distdir) && tar xBpf -); \
-       done
        chmod -R a+r $(distdir)
        tar chozf $(distdir).tar.gz $(distdir)
        rm -rf $(distdir)
@@ -355,31 +349,29 @@ maintainer-clean:  maintainer-clean-am maintainer-clean-recursive
        rm -f config.status
 
 .PHONY: default uninstall-binSCRIPTS install-binSCRIPTS \
-    uninstall-pkgdataSCRIPTS install-pkgdataSCRIPTS mostlyclean-vti \
-    distclean-vti clean-vti maintainer-clean-vti install-info \
-    uninstall-info mostlyclean-info distclean-info clean-info \
-    maintainer-clean-info uninstall-pkgdataDATA install-pkgdataDATA \
-    install-data-recursive uninstall-data-recursive \
-    install-exec-recursive uninstall-exec-recursive \
-    installdirs-recursive uninstalldirs-recursive all-recursive \
-    check-recursive installcheck-recursive info-recursive dvi-recursive \
-    mostlyclean-recursive distclean-recursive clean-recursive \
-    maintainer-clean-recursive tags mostlyclean-tags distclean-tags \
-    clean-tags maintainer-clean-tags dist info dvi check \
-    installcheck-local installcheck all-am install-exec-am \
-    install-data-am uninstall-am install-exec install-data install \
-    uninstall all installdirs mostlyclean-generic distclean-generic \
-    clean-generic maintainer-clean-generic clean mostlyclean distclean \
-    maintainer-clean
+uninstall-pkgdataSCRIPTS install-pkgdataSCRIPTS mostlyclean-vti \
+distclean-vti clean-vti maintainer-clean-vti install-info \
+uninstall-info mostlyclean-info distclean-info clean-info \
+maintainer-clean-info uninstall-pkgdataDATA install-pkgdataDATA \
+install-data-recursive uninstall-data-recursive install-exec-recursive \
+uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
+all-recursive check-recursive installcheck-recursive info-recursive \
+dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
+maintainer-clean-recursive tags mostlyclean-tags distclean-tags \
+clean-tags maintainer-clean-tags dist info dvi check installcheck-local \
+installcheck all-am install-exec-am install-data-am uninstall-am \
+install-exec install-data install uninstall all installdirs \
+mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
 
 
 # Check to make sure some installed files are executable.
 installcheck-local:
-       test -x $(pkgdatadir)/config.guess
-       test -x $(pkgdatadir)/config.sub
-       test -x $(pkgdatadir)/install-sh
-       test -x $(pkgdatadir)/mdate-sh
-       test -x $(pkgdatadir)/mkinstalldirs
+       $(PERL) -e "exit ! -x '$(pkgdatadir)/config.guess';"
+       $(PERL) -e "exit ! -x '$(pkgdatadir)/config.sub';"
+       $(PERL) -e "exit ! -x '$(pkgdatadir)/install-sh';"
+       $(PERL) -e "exit ! -x '$(pkgdatadir)/mdate-sh';"
+       $(PERL) -e "exit ! -x '$(pkgdatadir)/mkinstalldirs';"
 
 # Some simple checks:
 # * syntax check with perl4 and perl5.
@@ -387,7 +379,7 @@ installcheck-local:
 # * expect no instances of '${...}'
 # These are only really guaranteed to work on my machine.
 maintainer-check: automake check
-       @PERL@ -c -w automake
+       $(PERL) -c -w automake
        @if grep '^[^#].*true' $(srcdir)/[a-z]*.am; then \
          echo "can't use 'true' in GNU Makefile" 1>&2; \
          exit 1;                               \
diff --git a/TODO b/TODO
index 87a069e..0b0b387 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,4 +1,9 @@
 Priorities for release:
+* Check all require_file errors to see if any should reference a line in
+  Makefile.am or configure.in.  [handle_configure does]
+* test gettext stuff for po/intl
+* test for AC_OUTPUT command -- send patch for this
+
 
 Other priorities:
 * Must rewrite am_install_var.  Should break into multiple functions.
@@ -6,12 +11,12 @@ Other priorities:
 * Rewrite clean targets.
 * Expand test suite.
 
-Check all require_file errors to see if any should reference a line in
-Makefile.am or configure.in.
+should allow something like this:
+  pkgdata_DATA = samples/access samples/config samples/motd samples/users
+
 
-Consider using Ulrich's test suite idea
-If so, also allow support for Cygnus-style dejagnu-based test suites
-via an option
+Testing: allow support for Cygnus-style dejagnu-based test suites via
+an option
 
 when in subdir that itself has subdirs, might need to do
 include-by-reference TAGS file.
index bb6a3e4..4b04145 100755 (executable)
@@ -329,6 +329,7 @@ sub generate_makefile
     &handle_tags;
     &handle_dist;
     &handle_dependencies;
+    &handle_tests;
     &handle_footer;
     &handle_merge_targets;
     &handle_installdirs;
@@ -498,7 +499,7 @@ sub handle_source_transform
                $dep_files{'$(srcdir)/.deps/' . $_} = 1;
            }
 
-           &pretty_print ($one_file . "_OBJECTS =", "    ", @result);
+           &pretty_print ($one_file . "_OBJECTS =", "", @result);
        }
        else
        {
@@ -586,7 +587,7 @@ sub handle_libraries
            {
                push (@outlist, 'lib' . $onelib . '.a');
            }
-           &pretty_print ($onedir . '_LIBFILES =', "    ", @outlist);
+           &pretty_print ($onedir . '_LIBFILES =', "", @outlist);
        }
     }
     push (@all, '$(LIBFILES)');
@@ -647,7 +648,7 @@ sub handle_libraries
 
     if (! defined $contents{'LIBFILES'})
     {
-       &pretty_print ('LIBFILES = ', "    ", @liblist);
+       &pretty_print ('LIBFILES = ', "", @liblist);
     }
     $output_vars .= &file_contents ('libraries-vars');
 }
@@ -1079,7 +1080,7 @@ sub handle_dist
     }
     push (@coms, sort keys %dist_common);
 
-    &pretty_print ("DIST_COMMON =", "    ", @coms);
+    &pretty_print ("DIST_COMMON =", "", @coms);
     $output_vars .= "\n";
 
     # Some boilerplate.
@@ -1111,7 +1112,7 @@ sub handle_dependencies
        # Include GNU-make-specific auto-dep code.
        if ($dir_holds_sources)
        {
-           &pretty_print ('DEP_FILES =', "    ", sort keys %dep_files);
+           &pretty_print ('DEP_FILES =', "", sort keys %dep_files);
            $output_rules .= &file_contents ('depend');
        }
     }
@@ -1158,15 +1159,12 @@ sub handle_subdirs
     {
        &am_line_error
            ('SUBDIRS',
-            "ud_GNU_GETTEXT in configure.in but \`\@POSUB\@' not in SUBDIRS")
-               if $contents{'SUBDIRS'} !~ /\b\@POSUB\@\b/;
+            "ud_GNU_GETTEXT in configure.in but \`po' not in SUBDIRS")
+               if $contents{'SUBDIRS'} !~ /\bpo\b/;
        &am_line_error
            ('SUBDIRS',
-            "ud_GNU_GETTEXT in configure.in but \`\@INTLSUB\@' not in SUBDIRS")
-               if $contents{'SUBDIRS'} !~ /\b\@INTLSUB\@\b/;
-
-       # FIXME consider warning if 'po' or 'intl' appear; they should
-       # always be substituted via configure.
+            "ud_GNU_GETTEXT in configure.in but \`intl' not in SUBDIRS")
+               if $contents{'SUBDIRS'} !~ /\bintl\b/;
     }
 
     &require_file ($NORMAL, 'ABOUT-NLS') if $seen_gettext;
@@ -1177,6 +1175,8 @@ sub handle_subdirs
     local ($dir);
     foreach $dir (split (/\s+/, $contents{'SUBDIRS'}))
     {
+       # Skip directories substituted by configure.
+       next if $dir =~ /^\@.*\@$/;
        &am_line_error ('SUBDIRS',
                        "required directory $relative_dir/$dir does not exist")
            if ! -d $relative_dir . '/' . $dir;
@@ -1331,12 +1331,12 @@ sub handle_footer
 {
     if ($contents{'SOURCES'})
     {
-       &pretty_print ('SOURCES =', "    ",
+       &pretty_print ('SOURCES =', "",
                       split (/\s+/, $contents{'SOURCES'}));
     }
     if ($contents{'OBJECTS'})
     {
-       &pretty_print ('OBJECTS =', "    ",
+       &pretty_print ('OBJECTS =', "",
                       split (/\s+/, $contents{'OBJECTS'}));
     }
     if ($contents{'SOURCES'} || $contents{'OBJECTS'})
@@ -1602,10 +1602,45 @@ sub do_one_clean_target
 # Handle .PHONY target.
 sub handle_phony
 {
-    &pretty_print_rule ('.PHONY:', "    ", @phony);
+    &pretty_print_rule ('.PHONY:', "", @phony);
     $output_rules .= "\n";
 }
 
+# Handle TESTS variable.
+sub handle_tests
+{
+    return if ! defined $contents{'TESTS'};
+
+    &push_dist_common (split (/\s+/, $contents{'TESTS'}));
+    push (@check, 'check-TESTS');
+    # FIXME use $(SHELL) here?  That is what Ulrich suggests.  Maybe a
+    # new macro, $(TEST_SHELL), a la $(CONFIG_SHELL)?  For now we just
+    # execute the file directly; this allows test files which are
+    # compiled -- a possibly useful feature.
+    $output_rules .= 'check-TESTS:
+       @failed=0; all=0; \\
+       srcdir=$(srcdir); export srcdir; \\
+       for tst in $(TESTS); do \\
+         all=`expr $$all + 1`; \\
+         if test -f $$tst; then dir=.; \\
+         else dir="$(srcdir)"; fi; \\
+         if $$dir/$$tst; then \\
+           echo "PASS: $$tst"; \\
+         else \\
+           failed=`expr $$failed + 1`; \\
+           echo "FAIL: $$tst"; \\
+         fi; \\
+       done; \\
+       if test "$$failed" -eq 0; then \\
+         echo "========================"; \\
+         echo "All $$all tests passed"; \\
+         echo "========================"; \\
+       else \\
+         echo "$$failed of $$all tests failed"; \\
+       fi
+';
+}
+
 ################################################################
 
 # Scan configure.in for interesting things.
@@ -1678,8 +1713,7 @@ sub scan_configure
        }
        if ($in_ac_output)
        {
-           s/\].*$//;
-           $in_ac_output = 0 if s/[\),].*$//;
+           $in_ac_output = 0 if s/[\]\),].*$//;
 
            # Look at potential Makefile.am's.
            foreach (split)
index 74dabdf..bac8cbd 100644 (file)
@@ -109,10 +109,11 @@ documents version @value{VERSION}.
 * Install::                     What gets installed
 * Clean::                       What gets cleaned
 * Dist::                        What goes in a distribution
+* Tests::                       Support for test suites
 * Options::                     Changing Automake's behavior
 * Miscellaneous::               Miscellaneous rules
 * Extending::                   Extending Automake
-* Distributing::                Distributing Makefile.in
+* Distributing::                Distributing the Makefile.in
 * Future::                      Some ideas for the future.
 * Variables::                   Index of variables
 * Configure variables::         Index of configure variables and macros
@@ -912,6 +913,22 @@ the @samp{DIST_OTHER} variable.
 @vindex DIST_OTHER
 
 
+@node Tests
+@chapter Support for test suites
+
+Automake supports a simple form of test suite.  If the variable
+@samp{TESTS} is defined, its value is taken to be a list of programs to
+run in order to do the testing.  The programs can either be derived
+objects or source objects; the generated rule will look both in
+@var{srcdir} and @file{.}.
+
+The testing is done via @code{make check}.  The number of failures will
+be printed at the end of the run.
+
+In the future there will be some support for test suites which use
+@code{DejaGnu}.
+
+
 @node Options
 @chapter Changing Automake's Behavior
 
index 8fb2d48..2d31167 100755 (executable)
--- a/configure
+++ b/configure
@@ -522,7 +522,7 @@ cat >> confdefs.h <<EOF
 #define PACKAGE "$PACKAGE"
 EOF
 
-VERSION=0.30
+VERSION=0.31
 
 cat >> confdefs.h <<EOF
 #define VERSION "$VERSION"
index e58d5ff..57fa726 100644 (file)
@@ -6,7 +6,7 @@ dnl AC_CONFIG_HEADER(config.h)
 PACKAGE=automake
 AC_SUBST(PACKAGE)
 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
-VERSION=0.30
+VERSION=0.31
 AC_SUBST(VERSION)
 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
 ALL_LINGUAS=
index e085355..2b8270c 100644 (file)
@@ -2,6 +2,7 @@
 
 AUTOMAKE_OPTIONS = gnits
 MAINT_CHARSET = latin1
+PERL = @PERL@
 
 SUBDIRS = tests
 
@@ -29,20 +30,19 @@ pkgdata_SCRIPTS = config.guess config.sub install-sh mdate-sh mkinstalldirs
 
 CLEANFILES = automake
 
-# Gross.
-DIST_SUBDIRS = samples/cpio/*Makefile.am
-
 # The following requires a fixed version of the Emacs 19.30 etags.
 ETAGS_ARGS = automake.in --lang=none \
  --regex='/^@node[ \t]+\([^,]+\)/\1/' automake.texi
 
+## `test -x' is not portable.  So we use Perl instead.  If Perl
+## doesn't exist, then this test is meaningless anyway.
 # Check to make sure some installed files are executable.
 installcheck-local:
-       test -x $(pkgdatadir)/config.guess
-       test -x $(pkgdatadir)/config.sub
-       test -x $(pkgdatadir)/install-sh
-       test -x $(pkgdatadir)/mdate-sh
-       test -x $(pkgdatadir)/mkinstalldirs
+       $(PERL) -e "exit ! -x '$(pkgdatadir)/config.guess';"
+       $(PERL) -e "exit ! -x '$(pkgdatadir)/config.sub';"
+       $(PERL) -e "exit ! -x '$(pkgdatadir)/install-sh';"
+       $(PERL) -e "exit ! -x '$(pkgdatadir)/mdate-sh';"
+       $(PERL) -e "exit ! -x '$(pkgdatadir)/mkinstalldirs';"
 
 # Some simple checks:
 # * syntax check with perl4 and perl5.
@@ -50,7 +50,7 @@ installcheck-local:
 # * expect no instances of '${...}'
 # These are only really guaranteed to work on my machine.
 maintainer-check: automake check
-       @PERL@ -c -w automake
+       $(PERL) -c -w automake
        @if grep '^[^#].*true' $(srcdir)/[a-z]*.am; then \
          echo "can't use 'true' in GNU Makefile" 1>&2; \
          exit 1;                               \
index 10e19ca..60293a1 100755 (executable)
@@ -1,23 +1,23 @@
 #!/bin/sh
-# mdate-sh - get modifaction time of a file and pretty-print it
+# mdate-sh - get modification time of a file and pretty-print it
 # Copyright (C) 1995 Software Foundation, Inc.
-# written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
+# Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
 #
 # 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
 # the Free Software Foundation; either version 2, or (at your option)
 # any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-# Prevent date giving response in another language
+# Prevent date giving response in another language.
 LANG=C
 export LANG
 LC_ALL=C
@@ -25,19 +25,19 @@ export LC_ALL
 LC_TIME=C
 export LC_TIME
 
-# Get the extended ls output of the file
+# Get the extended ls output of the file.
 if ls -L /dev/null 1>/dev/null 2>&1; then
   set - `ls -L -l $1`
 else
   set - `ls -l $1`
 fi
-# The month is at least the fourth argument
+# The month is at least the fourth argument.
 # (3 shifts here, the next inside the loop)
 shift
 shift
 shift
 
-# Find the month.  Next argument is day, followed by the year or time
+# Find the month.  Next argument is day, followed by the year or time.
 month=
 until test $month
 do
@@ -63,7 +63,7 @@ day=$2
 # Here we have to deal with the problem that the ls output gives either
 # the time of day or the year.
 case $3 in
-  *:*) set `date`; year=$7
+  *:*) set `date`; year=$6
        case $2 in
         Jan) nummonthtod=1;;
         Feb) nummonthtod=2;;
@@ -79,12 +79,11 @@ case $3 in
         Dec) nummonthtod=12;;
        esac
        # For the first six month of the year the time notation can also
-       # be used for file modified in the last year.
+       # be used for files modified in the last year.
        if (expr $nummonth \> $nummonthtod) > /dev/null;
        then
         year=`expr $year - 1`
-       fi
-       ;;
+       fi;;
   *) year=$3;;
 esac
 
index 10e19ca..60293a1 100755 (executable)
--- a/mdate-sh
+++ b/mdate-sh
@@ -1,23 +1,23 @@
 #!/bin/sh
-# mdate-sh - get modifaction time of a file and pretty-print it
+# mdate-sh - get modification time of a file and pretty-print it
 # Copyright (C) 1995 Software Foundation, Inc.
-# written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
+# Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
 #
 # 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
 # the Free Software Foundation; either version 2, or (at your option)
 # any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-# Prevent date giving response in another language
+# Prevent date giving response in another language.
 LANG=C
 export LANG
 LC_ALL=C
@@ -25,19 +25,19 @@ export LC_ALL
 LC_TIME=C
 export LC_TIME
 
-# Get the extended ls output of the file
+# Get the extended ls output of the file.
 if ls -L /dev/null 1>/dev/null 2>&1; then
   set - `ls -L -l $1`
 else
   set - `ls -l $1`
 fi
-# The month is at least the fourth argument
+# The month is at least the fourth argument.
 # (3 shifts here, the next inside the loop)
 shift
 shift
 shift
 
-# Find the month.  Next argument is day, followed by the year or time
+# Find the month.  Next argument is day, followed by the year or time.
 month=
 until test $month
 do
@@ -63,7 +63,7 @@ day=$2
 # Here we have to deal with the problem that the ls output gives either
 # the time of day or the year.
 case $3 in
-  *:*) set `date`; year=$7
+  *:*) set `date`; year=$6
        case $2 in
         Jan) nummonthtod=1;;
         Feb) nummonthtod=2;;
@@ -79,12 +79,11 @@ case $3 in
         Dec) nummonthtod=12;;
        esac
        # For the first six month of the year the time notation can also
-       # be used for file modified in the last year.
+       # be used for files modified in the last year.
        if (expr $nummonth \> $nummonthtod) > /dev/null;
        then
         year=`expr $year - 1`
-       fi
-       ;;
+       fi;;
   *) year=$3;;
 esac
 
index 7ed030b..171fc0a 100644 (file)
@@ -1,3 +1,8 @@
+Wed Feb 28 11:57:02 1996  Tom Tromey  <tromey@creche.cygnus.com>
+
+       * acoutqnl.test: New file.
+       * Makefile.am (TESTS): Include it.
+
 Tue Feb 27 10:52:58 1996  Tom Tromey  <tromey@creche.cygnus.com>
 
        * Makefile.am (DIST_OTHER): Include "defs".
index a0e49a3..ed05521 100644 (file)
@@ -5,28 +5,6 @@ AUTOMAKE_OPTIONS = gnits
 ## FIXME Ulrich has suggested implementing this in Automake.
 ## Perhaps he is right.
 TESTS = mdate.test vtexi.test acoutput.test instexec.test checkall.test \
-acoutnoq.test acouttbs.test libobj.test proginst.test
+acoutnoq.test acouttbs.test libobj.test proginst.test acoutqnl.test
 
-DIST_OTHER = $(TESTS) defs
-
-check-local:
-       @failed=0; all=0; \
-       srcdir=$(srcdir); export srcdir; \
-       for tst in $(TESTS); do \
-         all=`expr $$all + 1`; \
-## FIXME use $(SHELL) here?  That is what Ulrich suggests.  Maybe
-## a new macro, $(TEST_SHELL), a la $(CONFIG_SHELL)?
-## For now we just execute the file directly; this allows test files
-## which are compiled -- a possibly useful feature.
-         if test -f $$tst; then dir=.; \
-         else dir="$(srcdir)"; fi; \
-         $$dir/$$tst || { \
-           failed=`expr $$failed + 1`; \
-           echo "FAIL: $$tst"; \
-         } \
-       done; \
-       if test "$$failed" -eq 0; then \
-         echo "All $$all tests passed"; \
-       else \
-         echo "$$failed of $$all tests failed"; \
-       fi
+DIST_OTHER = defs
index 339512f..b35fa90 100644 (file)
@@ -1,4 +1,4 @@
-# Makefile.in generated automatically by automake 0.30 from Makefile.am
+# Makefile.in generated automatically by automake 0.31 from Makefile.am
 
 # Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
@@ -41,9 +41,9 @@ transform = @program_transform_name@
 AUTOMAKE_OPTIONS = gnits
 
 TESTS = mdate.test vtexi.test acoutput.test instexec.test checkall.test \
-acoutnoq.test acouttbs.test libobj.test proginst.test
+acoutnoq.test acouttbs.test libobj.test proginst.test acoutqnl.test
 
-DIST_OTHER = $(TESTS) defs
+DIST_OTHER = defs
 DIST_COMMON = ChangeLog Makefile.am Makefile.in
 
 
@@ -74,11 +74,32 @@ dist: $(DEP_DISTFILES)
          || ln $(srcdir)/$$file $(distdir)/$$file 2> /dev/null \
          || cp -p $(srcdir)/$$file $(distdir)/$$file; \
        done
+check-TESTS:
+       @failed=0; all=0; \
+       srcdir=$(srcdir); export srcdir; \
+       for tst in $(TESTS); do \
+         all=`expr $$all + 1`; \
+         if test -f $$tst; then dir=.; \
+         else dir="$(srcdir)"; fi; \
+         if $$dir/$$tst; then \
+           echo "PASS: $$tst"; \
+         else \
+           failed=`expr $$failed + 1`; \
+           echo "FAIL: $$tst"; \
+         fi; \
+       done; \
+       if test "$$failed" -eq 0; then \
+         echo "========================"; \
+         echo "All $$all tests passed"; \
+         echo "========================"; \
+       else \
+         echo "$$failed of $$all tests failed"; \
+       fi
 info:
 
 dvi:
 
-check: all check-local
+check: all check-TESTS
 
 installcheck:
 
@@ -120,30 +141,11 @@ maintainer-clean:  maintainer-clean-generic distclean
        @echo "This command is intended for maintainers to use;"
        @echo "it deletes files that may require special tools to rebuild."
 
-.PHONY: default tags dist info dvi check-local check installcheck \
-    install-exec install-data install uninstall all installdirs \
-    mostlyclean-generic distclean-generic clean-generic \
-    maintainer-clean-generic clean mostlyclean distclean \
-    maintainer-clean
-
+.PHONY: default tags dist info dvi check installcheck install-exec \
+install-data install uninstall all installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
 
-check-local:
-       @failed=0; all=0; \
-       srcdir=$(srcdir); export srcdir; \
-       for tst in $(TESTS); do \
-         all=`expr $$all + 1`; \
-         if test -f $$tst; then dir=.; \
-         else dir="$(srcdir)"; fi; \
-         $$dir/$$tst || { \
-           failed=`expr $$failed + 1`; \
-           echo "FAIL: $$tst"; \
-         } \
-       done; \
-       if test "$$failed" -eq 0; then \
-         echo "All $$all tests passed"; \
-       else \
-         echo "$$failed of $$all tests failed"; \
-       fi
 .SUFFIXES:
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/tests/acoutqnl.test b/tests/acoutqnl.test
new file mode 100755 (executable)
index 0000000..732a11a
--- /dev/null
@@ -0,0 +1,17 @@
+#! /bin/sh
+
+# Test for bug reported by François Pinard.
+
+. $srcdir/defs || exit 1
+
+cat > configure.in << 'END'
+AC_ARG_PROGRAM
+AC_PROG_INSTALL
+AC_OUTPUT([Makefile],
+[echo zardoz has spoken])
+END
+
+: > Makefile.am
+
+$AUTOMAKE
+
index dbcb941..e461abc 100644 (file)
@@ -1,3 +1,3 @@
-@set UPDATED 27 February
-@set EDITION 0.30
-@set VERSION 0.30
+@set UPDATED 28 February 1996
+@set EDITION 0.31
+@set VERSION 0.31