* Cleanup the test suite.
authorPaul Smith <psmith@gnu.org>
Wed, 15 Sep 1999 22:23:35 +0000 (22:23 +0000)
committerPaul Smith <psmith@gnu.org>
Wed, 15 Sep 1999 22:23:35 +0000 (22:23 +0000)
12 files changed:
ChangeLog
Makefile.DOS.template
Makefile.am
README.DOS.template
configure.in
main.c
tests/ChangeLog [new file with mode: 0644]
tests/README
tests/run_make_tests.pl
tests/scripts/features/parallelism
tests/scripts/features/reinvoke
tests/test_driver.pl

index 46db1a84bd239a31575c80452d248fd078e2870a..425445b570dc787f2610630d5b9495a8c613e2c4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+1999-09-15  Paul D. Smith  <psmith@gnu.org>
+
+       * configure.in (MAKE_HOST): AC_SUBST this so it will go into the
+       makefile.
+       * Makefile.am (check-local): Print a success banner if the check
+       succeeds.
+       (check-regression): A bit of fine-tuning.
+
+1999-09-15  Eli Zaretskii  <eliz@is.elta.co.il>
+
+       * README.DOS.template: Document requirements for the test suite.
+       * Makefile.DOS.template: Updates to allow the test suite to run
+       from "make check".
+
+       * main.c (main): Handle it if argv[0] isn't an absolute path.
+
 1999-09-13  Paul D. Smith  <psmith@gnu.org>
 
        * Version 3.77.96 released.
index 7e224013a404a04b34d3a35c45de474b3b4f6f70..80cb22a111c7660c3e3c9659b4778ffb4dd6278a 100644 (file)
@@ -53,6 +53,7 @@ CPP = gcc -E
 LIBOBJS =
 MAKEINFO = ${bindir}/makeinfo
 PACKAGE = make
+PERL = perl
 RANLIB = ranlib
 REMOTE = stub
 VERSION = %VERSION%
@@ -81,6 +82,8 @@ CONFIG_HEADER = config.h
 CONFIG_CLEAN_FILES =  build.sh
 PROGRAMS =  $(bin_PROGRAMS)
 
+MAKE_HOST = i386-pc-msdosdjgpp
+
 
 DEFS =  -I. -I$(srcdir) -I.
 CPPFLAGS = -DHAVE_CONFIG_H
@@ -295,7 +298,8 @@ libglob.a: $(libglob_a_OBJECTS)
        $(AR) cru libglob.a $(libglob_a_OBJECTS) $(libglob_a_LIBADD)
        $(RANLIB) libglob.a
 
-mostlyclean-recursive clean-recursive distclean-recursive  maintainer-clean-recursive:
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive check-recursive:
 ifeq ($(words $(SUBDIRS)), 1)
        @echo Making $(shell echo $@ | sed s/-recursive//) in $(SUBDIRS)
        $(MAKE) -C $(SUBDIRS) -f ../Makefile $(shell echo $@ | sed s/-recursive//)-am
@@ -364,8 +368,8 @@ distdir: $(DISTFILES)
 
 info: $(INFO_DEPS) info-recursive
 dvi: $(DVIS) dvi-recursive
-check: all-am
-       $(MAKE) check-recursive check-local
+check: all-am check-recursive check-local
+       @:
 installcheck: installcheck-recursive
 all-recursive-am: config.h
        $(MAKE) all-recursive
@@ -439,7 +443,7 @@ maintainer-clean-compile install-info-am uninstall-info \
 mostlyclean-aminfo distclean-aminfo clean-aminfo \
 maintainer-clean-aminfo install-data-recursive uninstall-data-recursive \
 install-exec-recursive uninstall-exec-recursive installdirs-recursive \
-uninstalldirs-recursive all-recursive check-recursive \
+uninstalldirs-recursive all-recursive check-recursive check-am \
 installcheck-recursive info-recursive dvi-recursive \
 mostlyclean-recursive distclean-recursive clean-recursive \
 maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
@@ -464,8 +468,23 @@ dist-hook:
 
 # --------------- Local CHECK Section
 
+# Note: check-loadavg is NOT a prerequisite of check-local, since
+# there's no uptime utility, and the test it does doesn't make sense
+# on MSDOS anyway.
 check-local: check-loadavg check-regression
-.PHONY: check-loadavg check-regression
+       @echo "=========================" \
+       echo "Regression passed: GNU Make $(VERSION) ($(MAKE_HOST)) built with $(CC)"; \
+       echo "========================="
+
+.PHONY: check-loadavg check-shell check-regression
+
+# > check-shell
+#
+# check-shell is designed to fail if they don't have a Unixy shell
+# installed.  The test suite requires such a shell.
+check-shell:
+       @echo If Make says Error -1, you do not have Unix-style shell installed
+       @foo=bar.exe :
 
 # > check-loadavg
 #
@@ -490,23 +509,22 @@ check-loadavg: loadavg
 # parents.
 #
 check-regression:
-       here=`pwd`; testdir=""; \
-         case "$(MAKE_TEST)" in "") \
-           for d1 in $$here $(srcdir); do \
-             for d2 in ../.. .. .; do \
-               all=`echo $$d1/$$d2/make-test-[0-9]*/run_make_tests`; \
-               case "$$all" in \
-                 "$$d1/$$d2/make-test-[0-9]*/run_make_tests") : ;; \
-                 *) try=`for x in $$all; do echo $$x; done | sort | tail -1`;\
-                    testdir=`dirname $$try` ;; esac; \
-            done; done ;; \
-           *) testdir="$(MAKE_TEST)" ;; \
-         esac; \
-         case "$$testdir" in \
-           "") echo "Couldn't find make-test-* test suite."; exit 0;; \
-         esac; \
-         echo "cd $$testdir && ./run_make_tests -make_path $$here/make"; \
-         cd $$testdir && ./run_make_tests -make_path $$here/make
+       @if test -f "$(srcdir)/tests/run_make_tests"; then \
+         if $(PERL) -v >/dev/null 2>&1; then \
+           case `cd $(srcdir); pwd` in `pwd`) : ;; \
+             *) test -d tests || mkdir tests; \
+                for f in run_make_tests run_make_tests.pl test_driver.pl scripts; do \
+                  rm -rf tests/$$f; cp -pr $(srcdir)/tests/$$f tests; \
+                done ;; \
+           esac; \
+           echo "cd tests && $(PERL) ./run_make_tests.pl -make ../make.exe $(MAKETESTFLAGS)"; \
+           cd tests && $(PERL) ./run_make_tests.pl -make ../make.exe $(MAKETESTFLAGS); \
+         else \
+           echo "Can't find a working Perl ($(PERL)); the test suite requires Perl."; \
+         fi; \
+        else \
+         echo "Can't find the GNU Make test suite ($(srcdir)/tests)."; \
+        fi
 
 # --------------- Maintainer's Section
 
index b157f27c2257903e3137e1a1c8b501ed512a30ae..bb613c3f82947d83234e375f1010e03890ab7026 100644 (file)
@@ -30,6 +30,8 @@ SUBDIRS =     glob
 MOSTLYCLEANFILES = loadavg.c
 CLEANFILES =   loadavg
 
+MAKE_HOST = @MAKE_HOST@
+
 
 # --------------- Local INSTALL Section
 
@@ -66,7 +68,7 @@ install-exec-local:
 #
 dist-hook:
        (cd $(srcdir); \
-        sub=`find w32 tests -follow \( -name CVS -prune \) -o \( -name \*.orig -o -name \*.rej -o -name \*~ -prune \) -o -type f -print`; \
+        sub=`find w32 tests -follow \( -name CVS -prune -o -name work -prune \) -o \( -name \*.orig -o -name \*.rej -o -name \*~ -prune \) -o -type f -print`; \
         tar chf - $$sub) \
        | (cd $(distdir); tar xfBp -)
 
@@ -74,6 +76,12 @@ dist-hook:
 # --------------- Local CHECK Section
 
 check-local: check-regression check-loadavg
+       @banner="Regression passed: GNU Make $(VERSION) ($(MAKE_HOST)) built with $(CC)"; \
+       dashes=`echo "$$banner" | sed s/./=/g`; \
+       echo "$$dashes"; \
+       echo "$$banner"; \
+       echo "$$dashes"
+
 .PHONY: check-loadavg check-regression
 
 # > check-loadavg
@@ -107,14 +115,14 @@ check-regression:
        @if test -f "$(srcdir)/tests/run_make_tests"; then \
          if $(PERL) -v >/dev/null 2>&1; then \
            case `cd $(srcdir); pwd` in `pwd`) : ;; \
-             *) mkdir tests; \
+             *) test -d tests || mkdir tests; \
                 if ln -s "$(srcdir)/tests" srctests; then \
                   for f in run_make_tests run_make_tests.pl test_driver.pl scripts; do \
                     rm -f tests/$$f; ln -s ../srctests/$$f tests; \
                   done; fi ;; \
            esac; \
-           echo "cd tests && ./run_make_tests -make ../make $(MAKETESTFLAGS)"; \
-           cd tests && ./run_make_tests -make ../make $(MAKETESTFLAGS); \
+           echo "cd tests && $(PERL) ./run_make_tests.pl -make ../make $(MAKETESTFLAGS)"; \
+           cd tests && $(PERL) ./run_make_tests.pl -make ../make $(MAKETESTFLAGS); \
          else \
            echo "Can't find a working Perl ($(PERL)); the test suite requires Perl."; \
          fi; \
index 1a7cb44fbb3fa317a98fa2076d0cf2709d1e8776..40a6cbf62541eeeb0d1476e0f1310d39becfc925 100644 (file)
@@ -30,6 +30,9 @@ New (since 3.74) DOS-specific features:
       targets like "install:" and "clean:" still need additional
       programs, though, see below.)
 
+  10. Beginning with v3.78, the test suite works in the DJGPP
+      environment (requires Perl and auxiliary tools; see below).
+
 
 To build:
 
@@ -100,6 +103,9 @@ To build:
    7. The `clean' targets also require Unix-style shell, and GNU Sed
       and `rm' programs (the latter from Fileutils).
 
+   8. To run the test suite, type "make check".  This requires a Unix
+      shell (I used the DJGPP port of Bash 2.03), Perl, Fileutils and
+      Sh-utils.
 
 
 Notes:
index 9e361120d7c9de16fad38c42cb63a0e03eaf74df..52ce01a586b2f5936604e7d5d314fdb8dea78d70 100644 (file)
@@ -3,7 +3,7 @@ AC_REVISION([$Id$])
 AC_PREREQ(2.13)dnl             dnl Minimum Autoconf version required.
 AC_INIT(vpath.c)dnl            dnl A distinctive file to look for in srcdir.
 
-AM_INIT_AUTOMAKE(make, 3.77.96)
+AM_INIT_AUTOMAKE(make, 3.77.97)
 AM_CONFIG_HEADER(config.h)
 
 dnl Regular configure stuff
@@ -211,9 +211,9 @@ case "$make_cv_sys_gnu_glob" in
        ;;
 esac
 
-
 AC_DEFINE_UNQUOTED(MAKE_HOST,"$host",[Build host information.])
-
+MAKE_HOST="$host"
+AC_SUBST(MAKE_HOST)
 
 MAINT_MAKEFILE=/dev/null
 if test -r "$srcdir/maintMakefile"; then
diff --git a/main.c b/main.c
index f3e1135aaa7b049f02d8b7ba448461b945688bb9..0810a9259de6d813d91db0a1992d86c80cb482d7 100644 (file)
--- a/main.c
+++ b/main.c
@@ -974,6 +974,13 @@ int main (int argc, char ** argv)
        if (*p == '\\')
          *p = '/';
     }
+  /* If argv[0] is not in absolute form, prepend the current
+     directory.  This can happen when Make is invoked by another DJGPP
+     program that uses a non-absolute name.  */
+  if (current_directory[0] != '\0'
+      && argv[0] != 0
+      && (argv[0][0] != '/' && (argv[0][0] == '\0' || argv[0][1] != ':')))
+    argv[0] = concat (current_directory, "/", argv[0]);
 #else  /* !__MSDOS__ */
   if (current_directory[0] != '\0'
       && argv[0] != 0 && argv[0][0] != '/' && index (argv[0], '/') != 0)
diff --git a/tests/ChangeLog b/tests/ChangeLog
new file mode 100644 (file)
index 0000000..ee4b4a3
--- /dev/null
@@ -0,0 +1,25 @@
+1999-09-15  Paul D. Smith  <psmith@gnu.org>
+
+       * scripts/features/parallelism: The second test output could
+       change depending on how fast some scripts completed; use "sleep"
+       to force the order we want.
+
+       * test_driver.pl (toplevel): A bug in Perl 5.000 to Perl 5.004
+       means that "%ENV = ();" doesn't do the right thing.  This worked
+       in Perl 4 and was fixed in Perl 5.004_01, but use a loop to delete
+       the environment rather than require specific versions.
+
+       * run_make_tests.pl (set_more_defaults): Don't use Perl 5 s///
+       modifier "s", so the tests will run with Perl 4.
+       (set_more_defaults): Set $pure_log to empty if there's no -logfile
+       option in PURIFYOPTIONS.
+       (setup_for_test): Don't remove any logs unless $pure_log is set.
+
+1999-09-15  Eli Zaretskii  <eliz@is.elta.co.il>
+
+       * scripts/features/reinvoke: Put the SHELL definition in the right
+       test makefile.
+
+1999-09-15  Paul D. Smith  <psmith@gnu.org>
+
+       ChangeLog file for the test suite created.
index a0e800ca6362a444ca16b1e9ad9077ef3991071f..12fa6983b84206107fd63ff30e5fd447a307f80c 100644 (file)
@@ -8,8 +8,8 @@ infrastructure changes I've added a number of new tests.
 
 Rob Tulloh has contributed changes to get the suite running on NT.
 
-Eli Zaretski and Esa A E Peuha <peuha@cc.helsinki.fi> have contributed
-changes to the get the suite running on DJGPP/DOS.
+Eli Zaretskii and Esa A E Peuha <peuha@cc.helsinki.fi> have contributed
+changes to get the suite running on DJGPP/DOS.
 
 This package has a number of problems which preclude me from
 distributing it with make as a default "make check" test suite.  The
index 56902cab488432c656d5e8b80c06c55c71bdbdc0..484dbe1d99c1902a5ddf2b0acf266ca7b67ab29f 100755 (executable)
@@ -101,18 +101,16 @@ sub print_help
 }
 
 sub get_this_pwd {
-   if ($vos)
-   {
-      $delete_command = "delete_file";
-      $__pwd = `++(current_dir)`;
-   }
-   else
-   {
-      $delete_command = "rm";
-      chop ($__pwd = `pwd`);
-   }
-
-   return $__pwd;
+  if ($vos) {
+    $delete_command = "delete_file";
+    $__pwd = `++(current_dir)`;
+  }
+  else {
+    $delete_command = "rm";
+    chop ($__pwd = `pwd`);
+  }
+
+  return $__pwd;
 }
 
 sub set_defaults
@@ -141,8 +139,8 @@ sub set_more_defaults
 
    $string = `$make_path -v -f /dev/null 2> /dev/null`;
 
-   $string =~ s/[,\n].*/\n/s;
-   $testee_version = $string;
+   $string =~ /^(GNU Make [^,\n]*)/;
+   $testee_version = "$1\n";
 
    $string = `sh -c "$make_path -f /dev/null 2>&1"`;
    if ($string =~ /(.*): \*\*\* No targets\.  Stop\./) {
@@ -172,7 +170,8 @@ sub set_more_defaults
 
    # Get Purify log info--if any.
 
-   ($pure_log = $ENV{PURIFYOPTIONS}) =~ s,.*-logfile=([^ ]+) .*,\1,;
+   $ENV{PURIFYOPTIONS} =~ /.*-logfile=([^ ]+)/;
+   $pure_log = $1 || '';
    $pure_log =~ s/%v/$make_name/;
    $purify_errors = 0;
 
@@ -187,17 +186,18 @@ sub set_more_defaults
 
 sub setup_for_test
 {
-   $makefile = &get_tmpfile;
-   if (-f $makefile)
-   {
-      unlink $makefile;
-   }
-
-   # Get rid of any Purify logs.
-   ($pure_testname = $testname) =~ tr,/,_,;
-   $pure_testname = "$pure_log.$pure_testname";
-   system("rm -f $pure_testname*");
-   print("Purify testfiles are: $pure_testname*\n") if $debug;
+  $makefile = &get_tmpfile;
+  if (-f $makefile) {
+    unlink $makefile;
+  }
+
+  # Get rid of any Purify logs.
+  if ($pure_log) {
+    ($pure_testname = $testname) =~ tr,/,_,;
+    $pure_testname = "$pure_log.$pure_testname";
+    system("rm -f $pure_testname*");
+    print("Purify testfiles are: $pure_testname*\n") if $debug;
+  }
 }
 
 exit !&toplevel;
index 17e800c6e4f4d6474db174a34ed30765dc15b388..323eb5c60f6f09d368e8deb21bc356e103638ef9 100644 (file)
@@ -60,15 +60,15 @@ all: 1 2 3; @echo success
 
 -include 1.inc 2.inc 3.inc
 
-    1.inc: ; @sleep 1; echo 1; echo "1: ; @echo $@ has been included" > $@
+1.inc: ; @sleep 1; echo 1; echo "1: ; @sleep 2; echo $@ has been included" > $@
 2.inc: ; @sleep 2; echo 2; echo "2: ; @echo $@ has been included" > $@
-3.inc: ; @echo 3; echo "3: ; @echo $@ has been included" > $@
+3.inc: ; @echo 3; echo "3: ; @sleep 1; echo $@ has been included" > $@
 EOF
 
 close(MAKEFILE);
 
 &run_make_with_options("$makefile2", "-j 4", &get_logfile);
-$answer = "3\n1\n2\n1.inc has been included\n2.inc has been included\n3.inc has been included\nsuccess\n";
+$answer = "3\n1\n2\n2.inc has been included\n3.inc has been included\n1.inc has been included\nsuccess\n";
 &compare_output($answer, &get_logfile(1));
 
 unlink('1.inc', '2.inc', '3.inc');
index 1047d0e903cbe4123eb37dfe8bab7a37ac08fbd8..99fb46644611397133347279f1d201066d593b40 100644 (file)
@@ -13,7 +13,6 @@ $makefile_orig = &get_tmpfile;
 open(MAKEFILE,"> $makefile");
 
 print MAKEFILE <<EOM;
-SHELL = /bin/sh
 
 all: ; \@echo 'running rules.'
 
@@ -51,6 +50,8 @@ $makefile3 = &get_tmpfile;
 
 open(MAKEFILE, "> $makefile3");
 print MAKEFILE <<'EOM';
+SHELL = /bin/sh
+
 all: ; @echo hello
 
 a : b ; touch $@
index 914e0c6130dd861a6e57cd983f085f301c0f8000..7dd7fda1b0259219c30635485e4f9f9f48548243 100644 (file)
@@ -36,7 +36,15 @@ sub toplevel
   # Replace the environment with the new one
   #
   %origENV = %ENV;
-  %ENV = ();
+
+  # We used to say "%ENV = ();" but this doesn't work in Perl 5.000
+  # through Perl 5.004.  It was fixed in Perl 5.004_01, but we don't
+  # want to require that here, so just delete each one individually.
+
+  foreach $v (keys %ENV) {
+    delete $ENV{$v};
+  }
+
   %ENV = %makeENV;
 
   $| = 1;                     # unbuffered output