From 8d78e43dba6d7a3ffe6e4e778036cc69d0bce98a Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sat, 25 May 1996 16:38:07 +0000 Subject: [PATCH] Added support for DejaGNU --- ChangeLog | 7 +++++++ Makefile.am | 19 +++++++------------ Makefile.in | 19 +++++++------------ NEWS | 1 + TODO | 3 --- automake.in | 38 ++++++++++++++++++++++++++----------- automake.texi | 35 +++++++++++++++++++++++----------- dejagnu.am | 47 ++++++++++++++++++++++++++++++++++++++++++++++ lib/am/Makefile.am | 19 +++++++------------ lib/am/dejagnu.am | 47 ++++++++++++++++++++++++++++++++++++++++++++++ version.texi | 2 +- 11 files changed, 175 insertions(+), 62 deletions(-) create mode 100644 dejagnu.am create mode 100644 lib/am/dejagnu.am diff --git a/ChangeLog b/ChangeLog index a3d46900..fe6f1b12 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Sat May 25 10:19:53 1996 Tom Tromey + + * automake.in (handle_tests): Handle dejagnu. + (handle_options): Recognize dejagnu option. + + * dejagnu.am: New file. + Thu May 23 10:01:13 1996 Tom Tromey * automake.in (handle_dist): Run installcheck target from diff --git a/Makefile.am b/Makefile.am index b89d3162..39c660a3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -12,18 +12,13 @@ info_TEXINFOS = automake.texi # CONFIG_HEADER = config.h pkgdata_DATA = clean-kr.am clean.am compile-kr.am compile-vars.am \ -compile.am data.am depend.am \ -dist-vars.am footer.am header.am header-vars.am \ -kr-vars.am \ -libraries.am library.am mans-vars.am \ -program.am programs.am remake-hdr.am \ -remake-subd.am remake.am scripts.am subdirs.am tags.am tags-subd.am \ -tags-clean.am \ -texi-version.am texinfos-vars.am texinfos.am \ -libraries-clean.am programs-clean.am data-clean.am \ -COPYING INSTALL texinfo.tex \ -ansi2knr.c ansi2knr.1 \ -aclocal.m4 +compile.am data.am dejagnu.am depend.am dist-vars.am footer.am \ +header.am header-vars.am kr-vars.am libraries.am library.am \ +mans-vars.am program.am programs.am remake-hdr.am remake-subd.am \ +remake.am scripts.am subdirs.am tags.am tags-subd.am tags-clean.am \ +texi-version.am texinfos-vars.am texinfos.am libraries-clean.am \ +programs-clean.am data-clean.am COPYING INSTALL texinfo.tex ansi2knr.c \ +ansi2knr.1 aclocal.m4 ## These must all be executable when installed. pkgdata_SCRIPTS = config.guess config.sub install-sh mdate-sh mkinstalldirs diff --git a/Makefile.in b/Makefile.in index 9dc966cc..315a6787 100644 --- a/Makefile.in +++ b/Makefile.in @@ -50,18 +50,13 @@ info_TEXINFOS = automake.texi # CONFIG_HEADER = config.h pkgdata_DATA = clean-kr.am clean.am compile-kr.am compile-vars.am \ -compile.am data.am depend.am \ -dist-vars.am footer.am header.am header-vars.am \ -kr-vars.am \ -libraries.am library.am mans-vars.am \ -program.am programs.am remake-hdr.am \ -remake-subd.am remake.am scripts.am subdirs.am tags.am tags-subd.am \ -tags-clean.am \ -texi-version.am texinfos-vars.am texinfos.am \ -libraries-clean.am programs-clean.am data-clean.am \ -COPYING INSTALL texinfo.tex \ -ansi2knr.c ansi2knr.1 \ -aclocal.m4 +compile.am data.am dejagnu.am depend.am dist-vars.am footer.am \ +header.am header-vars.am kr-vars.am libraries.am library.am \ +mans-vars.am program.am programs.am remake-hdr.am remake-subd.am \ +remake.am scripts.am subdirs.am tags.am tags-subd.am tags-clean.am \ +texi-version.am texinfos-vars.am texinfos.am libraries-clean.am \ +programs-clean.am data-clean.am COPYING INSTALL texinfo.tex ansi2knr.c \ +ansi2knr.1 aclocal.m4 pkgdata_SCRIPTS = config.guess config.sub install-sh mdate-sh mkinstalldirs diff --git a/NEWS b/NEWS index 1f67887c..c35db300 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ New in 0.34: * Bug fixes * distcheck target runs install and installcheck targets +* Added support for DejaGNU. New in 0.33: * More bug fixes diff --git a/TODO b/TODO index 02a11893..6f1c0d44 100644 --- a/TODO +++ b/TODO @@ -86,9 +86,6 @@ Need way to say there are no suffixes in a Makefile (Franc,ois' Check to make sure various scripts are executable (IE when looking for them in a directory) -Testing: allow support for Cygnus-style dejagnu-based test suites via -an option - Think about ways to make automake fit better with Cygnus-style trees. Use recode in dist target when MAINT_CHARSET specified. Read caveats diff --git a/automake.in b/automake.in index 8abc526d..5cda40a5 100755 --- a/automake.in +++ b/automake.in @@ -430,7 +430,8 @@ sub handle_options &set_strictness ($_); } elsif ($_ eq 'no-installman' || $_ eq 'ansi2knr' - || $_ eq 'dist-shar' || $_ eq 'dist-zip') + || $_ eq 'dist-shar' || $_ eq 'dist-zip' + || $_ eq 'dejagnu') { # Explicitly recognize these. } @@ -1890,18 +1891,32 @@ sub handle_phony $output_rules .= "\n"; } -# Handle TESTS variable. +# Handle TESTS variable and other checks. sub handle_tests { - return if ! &variable_defined ('TESTS'); - - push (@check, 'check-TESTS'); - push (@phony, '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: $(TESTS) + if (&variable_defined ('DEJATOOL') && ! defined $options{'dejagnu'}) + { + # Error. + &am_line_error ('DEJATOOL', + "\`DEJATOOL' defined but \`dejagnu' not in \`AUTOMAKE_OPTIONS'"); + return; + } + + if (defined $options{'dejagnu'}) + { + push (@check, 'check-DEJAGNU'); + push (@phony, 'check-DEJAGNU'); + $output_rules .= &file_contents ('dejagnu'); + } + elsif (&variable_defined ('TESTS')) + { + push (@check, 'check-TESTS'); + push (@phony, '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: $(TESTS) @failed=0; all=0; \\ srcdir=$(srcdir); export srcdir; \\ for tst in $(TESTS); do \\ @@ -1923,6 +1938,7 @@ sub handle_tests echo "$$failed of $$all tests failed"; \\ fi '; + } } ################################################################ diff --git a/automake.texi b/automake.texi index cd58189d..5533ce81 100644 --- a/automake.texi +++ b/automake.texi @@ -1070,17 +1070,30 @@ makes a distribution, and then tries to do a @code{VPATH} build. @node Tests @chapter Support for test suites -Automake supports a simple form 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 testing is done via @samp{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}. +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. + +If @samp{dejagnu} appears in @code{AUTOMAKE_OPTIONS}, then the a +@code{dejagnu}-based test suite is assumed. The value of the variable +@code{DEJATOOL} is passed as the @code{--tool} argument to +@code{runtest}. The variables @code{EXPECT}, @code{RUNTEST} and +@code{RUNTESTFLAGS} can also be overridden to provide project-specific +values. For instance, you will need to do this if you are testing a +compiler toolchain, because the default values do not take into account +host and target names. +@opindex dejagnu +@vindex DEJATOOL +@vindex EXPECT +@vindex RUNTEST +@vindex RUNTESTFLAGS +@c FIXME xref dejagnu + +In either case, the testing is done via @samp{make check}. @node Options diff --git a/dejagnu.am b/dejagnu.am new file mode 100644 index 00000000..cbd86b2b --- /dev/null +++ b/dejagnu.am @@ -0,0 +1,47 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. + +## 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. + +## Work if expect is in our tree. +EXPECT = ` \ + if [ -f $$rootme/../expect/expect ] ; then \ + echo $$rootme/../expect/expect ; \ + else echo expect ; fi` + +## If DejaGNU is in our tree, we must run it out of srcdir. +RUNTEST = ` \ + if [ -f $(top_srcdir)/../dejagnu/runtest ] ; then \ + echo $(top_srcdir)/../dejagnu/runtest ; \ + else echo runtest ; fi` + +## Flags for DejaGNU. +RUNTESTFLAGS = + +## Name of tool to use. Default is the same as the package. +DEJATOOL = $(PACKAGE) + +check-DEJAGNU: + rootme=`cd $(top_builddir) && pwd`; \ +## Life is easiest with an absolute srcdir, so do that. + srcdir=`cd $(srcdir) && pwd`; export srcdir; \ + EXPECT=$(EXPECT); export EXPECT; \ +## Allow this to work when expect and DejaGNU are in tree. + if [ -f $$rootme/../expect/expect ]; then \ + TCL_LIBRARY=`cd $(top_srcdir)/../tcl/library && pwd`; \ + export TCL_LIBRARY; \ + fi; \ + $(RUNTEST) --tool $(DEJATOOL) --srcdir $$srcdir $(RUNTESTFLAGS) diff --git a/lib/am/Makefile.am b/lib/am/Makefile.am index b89d3162..39c660a3 100644 --- a/lib/am/Makefile.am +++ b/lib/am/Makefile.am @@ -12,18 +12,13 @@ info_TEXINFOS = automake.texi # CONFIG_HEADER = config.h pkgdata_DATA = clean-kr.am clean.am compile-kr.am compile-vars.am \ -compile.am data.am depend.am \ -dist-vars.am footer.am header.am header-vars.am \ -kr-vars.am \ -libraries.am library.am mans-vars.am \ -program.am programs.am remake-hdr.am \ -remake-subd.am remake.am scripts.am subdirs.am tags.am tags-subd.am \ -tags-clean.am \ -texi-version.am texinfos-vars.am texinfos.am \ -libraries-clean.am programs-clean.am data-clean.am \ -COPYING INSTALL texinfo.tex \ -ansi2knr.c ansi2knr.1 \ -aclocal.m4 +compile.am data.am dejagnu.am depend.am dist-vars.am footer.am \ +header.am header-vars.am kr-vars.am libraries.am library.am \ +mans-vars.am program.am programs.am remake-hdr.am remake-subd.am \ +remake.am scripts.am subdirs.am tags.am tags-subd.am tags-clean.am \ +texi-version.am texinfos-vars.am texinfos.am libraries-clean.am \ +programs-clean.am data-clean.am COPYING INSTALL texinfo.tex ansi2knr.c \ +ansi2knr.1 aclocal.m4 ## These must all be executable when installed. pkgdata_SCRIPTS = config.guess config.sub install-sh mdate-sh mkinstalldirs diff --git a/lib/am/dejagnu.am b/lib/am/dejagnu.am new file mode 100644 index 00000000..cbd86b2b --- /dev/null +++ b/lib/am/dejagnu.am @@ -0,0 +1,47 @@ +## automake - create Makefile.in from Makefile.am +## Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. + +## 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. + +## Work if expect is in our tree. +EXPECT = ` \ + if [ -f $$rootme/../expect/expect ] ; then \ + echo $$rootme/../expect/expect ; \ + else echo expect ; fi` + +## If DejaGNU is in our tree, we must run it out of srcdir. +RUNTEST = ` \ + if [ -f $(top_srcdir)/../dejagnu/runtest ] ; then \ + echo $(top_srcdir)/../dejagnu/runtest ; \ + else echo runtest ; fi` + +## Flags for DejaGNU. +RUNTESTFLAGS = + +## Name of tool to use. Default is the same as the package. +DEJATOOL = $(PACKAGE) + +check-DEJAGNU: + rootme=`cd $(top_builddir) && pwd`; \ +## Life is easiest with an absolute srcdir, so do that. + srcdir=`cd $(srcdir) && pwd`; export srcdir; \ + EXPECT=$(EXPECT); export EXPECT; \ +## Allow this to work when expect and DejaGNU are in tree. + if [ -f $$rootme/../expect/expect ]; then \ + TCL_LIBRARY=`cd $(top_srcdir)/../tcl/library && pwd`; \ + export TCL_LIBRARY; \ + fi; \ + $(RUNTEST) --tool $(DEJATOOL) --srcdir $$srcdir $(RUNTESTFLAGS) diff --git a/version.texi b/version.texi index 59e8eed7..a0b200a0 100644 --- a/version.texi +++ b/version.texi @@ -1,3 +1,3 @@ -@set UPDATED 17 May 1996 +@set UPDATED 25 May 1996 @set EDITION 0.34 @set VERSION 0.34 -- 2.43.5