diff options
author | Paul Smith <psmith@gnu.org> | 1999-09-15 22:23:35 +0000 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 1999-09-15 22:23:35 +0000 |
commit | c8003673857919d2283e16c829325c9f14e10dfe (patch) | |
tree | ea63faf55b4f28c561444bc732c246b5345b17dc | |
parent | 0d366b668244112846554c42045ff1d9956276ed (diff) | |
download | gunmake-c8003673857919d2283e16c829325c9f14e10dfe.tar.gz |
* Cleanup the test suite.
-rw-r--r-- | ChangeLog | 16 | ||||
-rw-r--r-- | Makefile.DOS.template | 62 | ||||
-rw-r--r-- | Makefile.am | 16 | ||||
-rw-r--r-- | README.DOS.template | 6 | ||||
-rw-r--r-- | configure.in | 6 | ||||
-rw-r--r-- | main.c | 7 | ||||
-rw-r--r-- | tests/ChangeLog | 25 | ||||
-rw-r--r-- | tests/README | 4 | ||||
-rwxr-xr-x | tests/run_make_tests.pl | 52 | ||||
-rw-r--r-- | tests/scripts/features/parallelism | 6 | ||||
-rw-r--r-- | tests/scripts/features/reinvoke | 3 | ||||
-rw-r--r-- | tests/test_driver.pl | 10 |
12 files changed, 151 insertions, 62 deletions
@@ -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. diff --git a/Makefile.DOS.template b/Makefile.DOS.template index 7e22401..80cb22a 100644 --- a/Makefile.DOS.template +++ b/Makefile.DOS.template @@ -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 diff --git a/Makefile.am b/Makefile.am index b157f27..bb613c3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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; \ diff --git a/README.DOS.template b/README.DOS.template index 1a7cb44..40a6cbf 100644 --- a/README.DOS.template +++ b/README.DOS.template @@ -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: diff --git a/configure.in b/configure.in index 9e36112..52ce01a 100644 --- a/configure.in +++ b/configure.in @@ -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 @@ -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 index 0000000..ee4b4a3 --- /dev/null +++ b/tests/ChangeLog @@ -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. diff --git a/tests/README b/tests/README index a0e800c..12fa698 100644 --- a/tests/README +++ b/tests/README @@ -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 diff --git a/tests/run_make_tests.pl b/tests/run_make_tests.pl index 56902ca..484dbe1 100755 --- a/tests/run_make_tests.pl +++ b/tests/run_make_tests.pl @@ -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; diff --git a/tests/scripts/features/parallelism b/tests/scripts/features/parallelism index 17e800c..323eb5c 100644 --- a/tests/scripts/features/parallelism +++ b/tests/scripts/features/parallelism @@ -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'); diff --git a/tests/scripts/features/reinvoke b/tests/scripts/features/reinvoke index 1047d0e..99fb466 100644 --- a/tests/scripts/features/reinvoke +++ b/tests/scripts/features/reinvoke @@ -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 $@ diff --git a/tests/test_driver.pl b/tests/test_driver.pl index 914e0c6..7dd7fda 100644 --- a/tests/test_driver.pl +++ b/tests/test_driver.pl @@ -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 |