From cb71d661ecbbbd964fff74312675e6f0dd6953d2 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 23 Jun 1997 01:37:30 +0000 Subject: [PATCH] test fixes --- ChangeLog | 5 +++++ Makefile.in | 4 ++-- automake.in | 19 +++++++++++-------- automake.texi | 19 ++++++++++++------- m4/Makefile.in | 2 +- tests/Makefile.in | 21 ++++++++++++--------- 6 files changed, 43 insertions(+), 27 deletions(-) diff --git a/ChangeLog b/ChangeLog index dd0459a9..65cbca15 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,13 @@ Sun Jun 22 14:01:59 1997 Tom Tromey + * automake.in (handle_tests): Exit status `77' means `ignore + test'. From François Pinard. + (handle_tests) Also, make banner same size as text. + * automake.in (handle_configure): Don't handle PRE_BUILT_SOURCES. (handle_built_sources): Likewise; don't have `all' depend on BUILT_SOURCES. + * depend.am (DEPS_MAGIC): New variable. (.deps/.P): Depend on BUILT_SOURCES again. diff --git a/Makefile.in b/Makefile.in index 47b9467c..e70903ae 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,6 +1,6 @@ # Makefile.in generated automatically by automake 1.1q from Makefile.am -# Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. @@ -239,7 +239,7 @@ install-info-am: $(INFO_DEPS) @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ for file in $(INFO_DEPS); do \ echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\ - install-info --info-dir=$(infodir) $(infodir)/$$file; :;\ + install-info --info-dir=$(infodir) $(infodir)/$$file || :;\ done; \ else : ; fi diff --git a/automake.in b/automake.in index a96184f5..7ef4c894 100755 --- a/automake.in +++ b/automake.in @@ -3690,24 +3690,27 @@ sub handle_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 $(TESTS_ENVIRONMENT) $$dir/$$tst; then \\ + all=`expr $$all + 1`; \\ echo "PASS: $$tst"; \\ - else \\ + elif test $$? -ne 77; then \\ + all=`expr $$all + 1`; \\ failed=`expr $$failed + 1`; \\ echo "FAIL: $$tst"; \\ fi; \\ done; \\ if test "$$failed" -eq 0; then \\ - echo "========================"; \\ - echo "All $$all tests passed"; \\ - echo "========================"; \\ + banner="All $$all tests passed"; \\ else \\ - echo "$$failed of $$all tests failed"; \\ - exit 1; \\ - fi + banner="$$failed of $$all tests failed"; \\ + fi; \\ + dashes=`echo "$$banner" | sed s/./=/g`; \\ + echo "$$dashes"; \\ + echo "$$banner"; \\ + echo "$$dashes"; \\ + test "$$failed" -eq 0 '; } } diff --git a/automake.texi b/automake.texi index 2d0b30a6..67302651 100644 --- a/automake.texi +++ b/automake.texi @@ -2093,13 +2093,18 @@ Automake supports a two forms of test suite. If the variable @code{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 number of failures will be printed at -the end of the run. The variable @code{TESTS_ENVIRONMENT} can be used -to set environment variables for the test run; the environment variable -@code{srcdir} is set in the rule. If all your test programs are -scripts, you can also set @code{TESTS_ENVIRONMENT} to an invocation of -the shell (eg @samp{$(SHELL) -x}); this can be useful for debugging the -tests. +in @var{srcdir} and @file{.}. + +The number of failures will be printed at the end of the run. If a +given test program exits with a status of 77, then its result is ignored +in the final count. This feature allows non-portable tests to be +ignored in environments where they don't make sense. + +The variable @code{TESTS_ENVIRONMENT} can be used to set environment +variables for the test run; the environment variable @code{srcdir} is +set in the rule. If all your test programs are scripts, you can also +set @code{TESTS_ENVIRONMENT} to an invocation of the shell (eg +@samp{$(SHELL) -x}); this can be useful for debugging the tests. @vindex TESTS @vindex TESTS_ENVIRONMENT diff --git a/m4/Makefile.in b/m4/Makefile.in index 4034aa69..fef75e3d 100644 --- a/m4/Makefile.in +++ b/m4/Makefile.in @@ -1,6 +1,6 @@ # Makefile.in generated automatically by automake 1.1q from Makefile.am -# Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. diff --git a/tests/Makefile.in b/tests/Makefile.in index ed85ae8e..1227a731 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -1,6 +1,6 @@ # Makefile.in generated automatically by automake 1.1q from Makefile.am -# Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. @@ -124,24 +124,27 @@ check-TESTS: $(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 $(TESTS_ENVIRONMENT) $$dir/$$tst; then \ + all=`expr $$all + 1`; \ echo "PASS: $$tst"; \ - else \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ failed=`expr $$failed + 1`; \ echo "FAIL: $$tst"; \ fi; \ done; \ if test "$$failed" -eq 0; then \ - echo "========================"; \ - echo "All $$all tests passed"; \ - echo "========================"; \ + banner="All $$all tests passed"; \ else \ - echo "$$failed of $$all tests failed"; \ - exit 1; \ - fi + banner="$$failed of $$all tests failed"; \ + fi; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0 info: dvi: check: all -- 2.43.5