From 20f1185dd84bcadf4b238d1d2ca18f5ca79157d4 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Mon, 5 Feb 2001 04:14:59 +0000 Subject: Initial revision --- contrib/README | 16 + contrib/bluegnu2.0.3/Makefile.in | 185 +++ contrib/bluegnu2.0.3/README.bluegnu | 325 +++++ contrib/bluegnu2.0.3/README.dejagnu | 283 ++++ contrib/bluegnu2.0.3/TODO.dejagnu | 7 + contrib/bluegnu2.0.3/aclocal.m4 | 605 ++++++++ contrib/bluegnu2.0.3/bluegnu | 136 ++ contrib/bluegnu2.0.3/bluegnutk | 5 + contrib/bluegnu2.0.3/bluegnutk.itcl | 216 +++ contrib/bluegnu2.0.3/bluegnutk.rc | 29 + contrib/bluegnu2.0.3/bluegnutkUtils.itcl | 436 ++++++ contrib/bluegnu2.0.3/config.guess | 592 ++++++++ contrib/bluegnu2.0.3/configure | 974 +++++++++++++ contrib/bluegnu2.0.3/configure.in | 9 + contrib/bluegnu2.0.3/contents | 232 ++++ contrib/bluegnu2.0.3/contrib/README | 16 + contrib/bluegnu2.0.3/contrib/test-g++ | 84 ++ contrib/bluegnu2.0.3/contrib/test-tool | 346 +++++ contrib/bluegnu2.0.3/contrib/testit | 1149 +++++++++++++++ contrib/bluegnu2.0.3/dejagnu | 93 ++ contrib/bluegnu2.0.3/doc/Makefile.in | 170 +++ contrib/bluegnu2.0.3/doc/README.tex | 253 ++++ contrib/bluegnu2.0.3/doc/READMEdvi.dvi | Bin 0 -> 10840 bytes contrib/bluegnu2.0.3/doc/READMEdvi.tex | 5 + contrib/bluegnu2.0.3/doc/READMEdvi.title | 1 + contrib/bluegnu2.0.3/doc/READMEtxt.dvi | Bin 0 -> 9344 bytes contrib/bluegnu2.0.3/doc/READMEtxt.tex | 6 + contrib/bluegnu2.0.3/doc/configure | 657 +++++++++ contrib/bluegnu2.0.3/doc/configure.in | 4 + contrib/bluegnu2.0.3/doc/dejagnu.1 | 120 ++ contrib/bluegnu2.0.3/doc/dejagnu.dvi | Bin 0 -> 263684 bytes contrib/bluegnu2.0.3/doc/dejagnu.info | 77 ++ contrib/bluegnu2.0.3/doc/dejagnu.info-1 | 1163 ++++++++++++++++ contrib/bluegnu2.0.3/doc/dejagnu.info-2 | 1137 +++++++++++++++ contrib/bluegnu2.0.3/doc/dejagnu.info-3 | 1016 ++++++++++++++ contrib/bluegnu2.0.3/install-sh | 238 ++++ contrib/bluegnu2.0.3/mkinstalldirs | 32 + contrib/bluegnu2.0.3/runtest | 90 ++ contrib/bluegnu2.0.3/runtest.exp | 1146 +++++++++++++++ contrib/bluegnu2.0.3/site.tmpl | 307 +++++ contrib/bluegnu2.0.3/tcl-mode.el | 2223 ++++++++++++++++++++++++++++++ contrib/test-g++ | 89 ++ contrib/test-tool | 378 +++++ contrib/testit | 1149 +++++++++++++++ 44 files changed, 15999 insertions(+) create mode 100644 contrib/README create mode 100644 contrib/bluegnu2.0.3/Makefile.in create mode 100644 contrib/bluegnu2.0.3/README.bluegnu create mode 100644 contrib/bluegnu2.0.3/README.dejagnu create mode 100644 contrib/bluegnu2.0.3/TODO.dejagnu create mode 100644 contrib/bluegnu2.0.3/aclocal.m4 create mode 100755 contrib/bluegnu2.0.3/bluegnu create mode 100755 contrib/bluegnu2.0.3/bluegnutk create mode 100644 contrib/bluegnu2.0.3/bluegnutk.itcl create mode 100644 contrib/bluegnu2.0.3/bluegnutk.rc create mode 100644 contrib/bluegnu2.0.3/bluegnutkUtils.itcl create mode 100755 contrib/bluegnu2.0.3/config.guess create mode 100755 contrib/bluegnu2.0.3/configure create mode 100644 contrib/bluegnu2.0.3/configure.in create mode 100644 contrib/bluegnu2.0.3/contents create mode 100644 contrib/bluegnu2.0.3/contrib/README create mode 100755 contrib/bluegnu2.0.3/contrib/test-g++ create mode 100755 contrib/bluegnu2.0.3/contrib/test-tool create mode 100755 contrib/bluegnu2.0.3/contrib/testit create mode 100755 contrib/bluegnu2.0.3/dejagnu create mode 100644 contrib/bluegnu2.0.3/doc/Makefile.in create mode 100644 contrib/bluegnu2.0.3/doc/README.tex create mode 100644 contrib/bluegnu2.0.3/doc/READMEdvi.dvi create mode 100644 contrib/bluegnu2.0.3/doc/READMEdvi.tex create mode 100644 contrib/bluegnu2.0.3/doc/READMEdvi.title create mode 100644 contrib/bluegnu2.0.3/doc/READMEtxt.dvi create mode 100644 contrib/bluegnu2.0.3/doc/READMEtxt.tex create mode 100755 contrib/bluegnu2.0.3/doc/configure create mode 100644 contrib/bluegnu2.0.3/doc/configure.in create mode 100644 contrib/bluegnu2.0.3/doc/dejagnu.1 create mode 100644 contrib/bluegnu2.0.3/doc/dejagnu.dvi create mode 100644 contrib/bluegnu2.0.3/doc/dejagnu.info create mode 100644 contrib/bluegnu2.0.3/doc/dejagnu.info-1 create mode 100644 contrib/bluegnu2.0.3/doc/dejagnu.info-2 create mode 100644 contrib/bluegnu2.0.3/doc/dejagnu.info-3 create mode 100755 contrib/bluegnu2.0.3/install-sh create mode 100755 contrib/bluegnu2.0.3/mkinstalldirs create mode 100755 contrib/bluegnu2.0.3/runtest create mode 100755 contrib/bluegnu2.0.3/runtest.exp create mode 100644 contrib/bluegnu2.0.3/site.tmpl create mode 100644 contrib/bluegnu2.0.3/tcl-mode.el create mode 100755 contrib/test-g++ create mode 100755 contrib/test-tool create mode 100755 contrib/testit (limited to 'contrib') diff --git a/contrib/README b/contrib/README new file mode 100644 index 0000000..d776f6e --- /dev/null +++ b/contrib/README @@ -0,0 +1,16 @@ +These are "user" contributed scripts that automate testing. These all +depend on using "make check", so they are included here as an aid to +helping others automate their own testing. All of these script do +report filtering on the output from DejaGnu. test-tool and test-g++ +are basically the same script. test-target is the script I use for our +quarterly release and it is the most sophisticated. It still uses +"make check" (a make target that start runtest) to produce the +results, but tests our entire tool chain for native and crosses. It +also produces a short summary report that gets emailed, as well as +summary reports. It does regression analysis using the previous test +run. testit is a very crude and simple Tk GUI for accessing all the +testing results. Hope these are helpful to anyone, I'd like to collect +more from the net as they get developed. + + - rob - + diff --git a/contrib/bluegnu2.0.3/Makefile.in b/contrib/bluegnu2.0.3/Makefile.in new file mode 100644 index 0000000..430648e --- /dev/null +++ b/contrib/bluegnu2.0.3/Makefile.in @@ -0,0 +1,185 @@ +## @configure_input@ +# Makefile for BlueGnu Testing Framework. +# Copyright (C) 1988, 1990, 1991, 1992, 1994, 1995 Free Software Foundation, # Copyright (C) 1998 jotOmega dsc, Inc. + +#This file is part of BlueGnu. + +#BlueGnu is open 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. + +#BlueGnu 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 BlueGnu; see the file COPYING. If not, write to +#the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + +VPATH = @srcdir@ +srcdir = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = $(exec_prefix)/bin +libdir = $(exec_prefix)/lib + +datadir = $(libdir)/bluegnu +infodir = $(prefix)/info +includedir = $(prefix)/include +gxx_includedir = $(tooldir)/g++-include +docdir = $(datadir)/doc + +SHELL = /bin/sh + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ + +CC = @CC@ +CFLAGS = -g + +SUBDIRS = @subdirs@ + +# These let the BlueGnu test suite run when BlueGnu isn't +# installed yet, so run it from the srcdir and objdir. +EXPECT = ` \ + if [ -f $${rootme}/../expect/expect ] ; then \ + echo $${rootme}/../expect/expect ; \ + else echo expect ; fi` + +BLUEGNUFLAGS = +BLUEGNU = ` \ + if [ -f ${srcdir}/bluegnu ] ; then \ + echo ${srcdir}/bluegnu ; \ + else echo bluegnu ; fi` + +TCLIBRARY = `if [ -f $${rootme}/expect/expect ] ; \ + then echo TCL_LIBRARY=$${srcdir}/../tcl/library ; \ + else echo "" ; fi` + +FLAGS_TO_PASS = \ + "CC=$(CC)" \ + "CFLAGS=$(CFLAGS)" \ + "INSTALL=$(INSTALL)" \ + "INSTALL_DATA=$(INSTALL_DATA)" \ + "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ + "LDFLAGS=$(LDFLAGS)" \ + "MAKEINFO=$(MAKEINFO)" \ + "EXPECT=$(EXPECT)" \ + "TCLIBRARY=$(TCLIBRARY)" \ + "BLUEGNU=$(BLUEGNU)" \ + "BLUEGNUFLAGS=$(BLUEGNUFLAGS)" \ + "exec_prefix=$(exec_prefix)" \ + "prefix=$(prefix)" \ + "tooldir=$(tooldir)" + +all: force + @$(MAKE) subdir_do DO=$@ $(FLAGS_TO_PASS) + +contents: force + ls -lLAR -I CVS -I Makefile \ + -I config.status -I config.log -I config.cache \ + -I READMEdvi -I calc.h > $@ + +.PHONY: check installcheck +installcheck: + +.NOEXPORT: + +MAKEOVERRIDES= + +INFODIRS=doc +dvi info: + @rootme=`pwd`/ ; export rootme ; \ + rootsrc=`cd $(srcdir); pwd`/ ; export rootsrc ; \ + $(MAKE) subdir_do DO=$@ "DODIRS=$(INFODIRS)" $(FLAGS_TO_PASS) + +install-info: + @rootme=`pwd`/ ; export rootme ; \ + $(MAKE) subdir_do DO=install-info $(FLAGS_TO_PASS) + +install: + ${srcdir}/mkinstalldirs $(bindir) $(datadir) + $(INSTALL_PROGRAM) $(srcdir)/runtest $(bindir)/runtest + $(INSTALL_PROGRAM) $(srcdir)/runtest.exp $(datadir)/runtest.exp + $(INSTALL_PROGRAM) $(srcdir)/dejagnu $(bindir)/dejagnu + $(INSTALL_PROGRAM) $(srcdir)/bluegnu $(bindir)/bluegnu + $(INSTALL_PROGRAM) $(srcdir)/bluegnutk $(bindir) + $(INSTALL_PROGRAM) $(srcdir)/bluegnutk.itcl $(bindir) + $(INSTALL_PROGRAM) $(srcdir)/bluegnutk.rc $(bindir) + $(INSTALL_PROGRAM) $(srcdir)/bluegnutkUtils.itcl $(bindir) + $(INSTALL_PROGRAM) $(srcdir)/config.guess $(datadir)/config.guess + -for file in $(srcdir)/lib/*.exp; \ + do \ + $(INSTALL_DATA) $$file $(datadir) ; \ + done + -for file in $(srcdir)/lib/*.tcl; \ + do \ + $(INSTALL_DATA) $$file $(datadir) ; \ + done + -for file in $(srcdir)/lib/*.itcl; \ + do \ + $(INSTALL_DATA) $$file $(datadir) ; \ + done + $(INSTALL_DATA) $(srcdir)/lib/tclIndex $(datadir) + @$(MAKE) subdir_do DO=install $(FLAGS_TO_PASS) + +subdir_do: force + @for i in $(SUBDIRS); do \ + echo "Making $(DO) in $${i}..." ; \ + if [ -d ./$$i ] ; then \ + if (rootme=`pwd`/ ; export rootme ; \ + rootsrc=`cd $(srcdir); pwd`/ ; export rootsrc ; \ + cd ./$$i; \ + $(MAKE) $(FLAGS_TO_PASS) $(DO)) ; then true ; \ + else exit 1 ; fi ; \ + else true ; fi ; \ + done +force: + +clean mostlyclean: + @echo "Doing clean mosttlyclean +++++" + -rm -f \#* *~ core *.o a.out xgdb *.x + $(MAKE) subdir_do DO=$@ $(FLAGS_TO_PASS) + @for l in `find . -name logs`; do rm -fr $$l; done + @for f in `find . -name '*~'`; do rm -fr $$f; done + +distclean: clean + @echo "Doing distclean +++++" + $(MAKE) subdir_do DO=$@ $(FLAGS_TO_PASS) + -rm -f Makefile *-init.exp site.bak site.exp conftest.c + -rm -f config.status config.log config.cache + -rm -fr *.log summary detail *.sum blockit + +maintainer-clean realclean: + @echo "Doing maintainer-clean realclean +++++" + $(MAKE) subdir_do DO=$@ $(FLAGS_TO_PASS) + -rm -f Makefile *-init.exp site.bak site.exp conftest.c + -rm -f config.status config.log config.cache + -rm -fr *.log summary detail *.sum blockit + -rm -f README.bluegnu contents + +check: + @if [ -f testsuite/Makefile ]; then \ + rootme=`pwd`; export rootme; \ + cd testsuite; \ + $(MAKE) $(FLAGS_TO_PASS) check; \ + else true; fi + +Makefile: $(srcdir)/Makefile.in config.status + @echo "Rebuilding the Makefile..." + $(SHELL) ./config.status + +configure: $(srcdir)/configure.in $(srcdir)/Makefile.in $(srcdir)/aclocal.m4 + @echo "Rebuilding configure..." + @if [ x"${srcdir}" = x"@srcdir@" ] ; then \ + srcdir=. ; export srcdir ; \ + else true ; fi ; \ + (cd $${srcdir}; autoconf) + +config.status: + @echo "Rebuilding config.status..." + $(SHELL) ./config.status --recheck diff --git a/contrib/bluegnu2.0.3/README.bluegnu b/contrib/bluegnu2.0.3/README.bluegnu new file mode 100644 index 0000000..2c1e4d8 --- /dev/null +++ b/contrib/bluegnu2.0.3/README.bluegnu @@ -0,0 +1,325 @@ + + + + + + + + + Release Notice + + BlueGnu Testing Framework + + Version 2.0.3 + + Jan-Willem Neurdenburg + + jotOmega dsc + + + 56 Brigham Hill Road + + Grafton MA 01519-1135 + + neurdenburgj@acm.org + + + Tel: (508) 839-0276 + + Fax: (508) 839-7267 + + September 19, 1999 + + +1 Introduction + +BlueGnu is a framework for testing other programs. It has been +created to be compatible with DejaGnu. Its purpose is to provide +a single front end for all tests. Beyond this, BlueGnu offers +several advantages for testing: + + * The flexibility and consistency of the BlueGnu framework + makes it easy to write tests for any program, with the + exception of GUI applications. + + * BlueGnu provides a layer of abstraction, which makes all + tests (if correctly written) portable to any host or target + where a program must be tested. + * BlueGnu is written in [incr Tcl], which in turn is based on + Tcl (Tool Command Language). The framework comprises two + parts: + + + + 1 + + + + + + 1. the testing framework, + + 2. the test-suites or test-sets themselves. + * BlueGnu will work with any Tcl based interpreter as long as + [incr Tcl] has been included. You can include 'expect', + 'Tk', and/or other extensions. + + * Includes DejaGnu release 1.6 + + +2 Requirements +The following modules should have been installed, before you can +install and/or use BlueGnu: + + * Tcl release 8.0 or higher, + + * incr Tcl release 3.0 or higher. + + Any other extensions that is compatible with Tcl release 8.0 +can be used as well. + + +3 Structure and Contents of the Release +The root directory of the release contains the README files +with installation instructions and the files needed to build and +install this product. It also contains the executable scripts of +the BlueGnu testing framework. + The top-level directories are listed below: + +lib: the packages and procedures that make the BlueGnu and + DejaGnu testing framework. This also includes the default + target definition files. + +testsets: the BlueGnu test-suites and test examples. It contains + the following subdirectories. + + BlueGnu: test scripts to test the testing framework itself. + examples: test suite and test script examples. + config, lib, tools: currently empty, but can be used for + test-set dependent configuration files, library files, + and tools. + +config: currently empty. + + + + + + 2 + + + + + +doc: the DejaGnu texinfo source and the documentation in + 'info', 'dvi', 'ps', and 'pdf' representation, respectively + dejagnu.info*, dejagnu.dvi, dejagnu.ps, and dejagnu.pdf. A + DejaGnu man page is also available. + + It also contains the TeX version (README.tex) of this + document as well as the 'dvi', 'ps' 'html', and + 'pdf' representation, respectively notice.dvi, notice.ps, + notice.html, and notice.pdf. +testsuite: contains a mixture of DejaGnu and BlueGnu test + scripts. + +contrib: contains examples how DejaGnu is used at Cygnus. +example: contains a full DejaGnu test framework example for + testing the program 'calc' which is also included. + + +4 Installation and use under Unix + +Before you can install and use BlueGnu you need to have installed +the following three packages: + * Tcl version 8.0.3 + + * Tk version 8.0.3 + * incr Tcl version 3.0.1 + +The source for these packages should all be located in one +directory. The subdirectory in the directory should be: + * tcl8.0.3 + * tk8.0.3 + + * itcl3.0.1 + The following examples use the command `./configure -- +prefix=/tools/...`. This will install all packages in a +directory ``/tools''. When you omit the ``--prefix''-switch then +the installation default will be the directory ``/usr/local''. + + +4.1 Installation of needed Packages +When you have not installed Tcl and the other needed +extensions, then you need to retrieve the sources from +``www.tcltk.com/itcl''. You need to `gunzip` the files and do a +`tar xf` of all these packages in one directory, let's call this +directory ``TclTk''. + From the directory ``TclTk'', you should do the following to +install the packages: + + + 3 + + + + + +% cd tcl8.0.3/unix +% ./configure --prefix=/tools/tcl8.0.3 --enable-gcc --enable- +shared +% make +% mkdir /tools/tcl8.0.3 +% make install +% cd ../../tk8.0.3/unix +% ./configure --prefix=/tools/tk8.0.3 --enable-gcc --enable- +shared +% make +% mkdir /tools/tk8.0.3 +% make install +% cd ../../itcl3.0.1 +% ./configure --prefix=/tools/itcl3.0.1 --enable-gcc --enable- +shared +% make +% mkdir /tools/itcl3.0.1 +% make install + + +4.2 Installing BlueGnu +You can now `gunzip` and `tar xf` the BlueGnu version 2.0.3 +in the directory ``TckTk''. This will create the directory +``bluegnu2.0.3''. Now do the following: + +% cd bluegnu2.0.3 +% ./configure --prefix=/tools/bluegnu2.0.3 +% make +% mkdir /tools/bluegnu2.0.3 +% make install + + This will install BlueGnu in the directories: + * /tools/bluegnu2.0.3/bin + + * /tools/bluegnu2.0.3/lib/bluegnu + + * /tools/bluegnu2.0.3/info + * /tools/bluegnu2.0.3/man + + +4.3 Using BlueGnu +When you have installed [incr Tcl] and BlueGnu and you have the +respective ``bin'' directories in your PATH variable, then you +can start running some tests. You can go into the BlueGnu +source directory ``bluegnu2.0.3/testsets/examples'' and run the +following: + + + 4 + + + + + +% bluegnu versionTcl.itcl +% bluegnu ts_001 +% bluegnu ts_002 +% bluegnu ts_003 + + The above test result should all be PASS. The following test +will give a result UNKNOWN, because no pass/fail instruction have +been given. + +% bluegnu tc001 + + The last test you can run will fail in its simple form: +% bluegnu tc002 + + But will pass if you execute the test as follows: + +% bluegnu tc002[English] + + This is because the test scripts need a test case identifier +to find the correct benchmark code. + +5 Changes + +5.1 Version 2.0.3 + +This being the first public release it is not to useful to +list all the changes. BlueGnu has been modeled after DejaGnu +and is a complete new implementation which has been tested +thoroughly. When documentation is being written more changes +will be made. An example of some of these changes as a result of +this documentation effort can be found in the test-suites ts_001, +ts_002, and ts_003. The first two are not as easy to write as +the third. The test suite ts_001 is a script implementation of +the command line: + +% cd bluegnu2.0.3/testsets +% bluegnu examples/tc002[English=B] \ +> "examples/tc002[Dutch=B]={MSG=Hallo Wereld}" +This may be useful for simple tests but when you want to +write more complex test-suite scripts you would like some more +flexibility, so two procedures were introduced, which are shown +in test-suite ts_002. This makes writing rather complex so +the procedures have become part of the procedures 'appendQueue', +'prependQueue', and 'runtest'. The resulting script is shown in +test-suit ts_003. + Changes like this will be made in the future! + + + 5 + + + + + +6 Future Enhancements + +The following enhancements are being planned: + + * Target code will be made into a class with methods + 'start', 'load', 'exit', and 'version'. Instead of the + current '_start', '_load', '_exit', + and '_version', which have been taken from DejaGnu. + * Procedures will be created that make it easy to test WEB + application from the framework. + + * Other enhancements will be made depending on the use of the + framework in testing different applications. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 6 + \ No newline at end of file diff --git a/contrib/bluegnu2.0.3/README.dejagnu b/contrib/bluegnu2.0.3/README.dejagnu new file mode 100644 index 0000000..0e22eab --- /dev/null +++ b/contrib/bluegnu2.0.3/README.dejagnu @@ -0,0 +1,283 @@ + DejaGnu is a framework for testing other programs. Its purpose is to +provide a single front end for all tests. Beyond this, DejaGnu offers +several advantages for testing: + + - The flexibility and consistency of the DejaGnu framework + make it easy to write tests for any program. + + - DejaGnu provides a layer of abstraction which makes all + tests (if correctly written) portable to any host or target + where a program must be tested. For instance, a test for + GDB can run (from any Unix based host) on any target + architecture supported by DejaGnu. Currently DejaGnu runs + tests on several single board computers, whose operating + software ranges from just a boot monitor to a full-fledged, + Unix-like realtime OS. + + - DejaGnu is written in expect, which in turn uses Tcl + (Tool command language). The framework comprises two parts: + the testing framework and the testsuites themselves. Tests + are usually written in expect using Tcl. + + Bugs can be reported to bug-dejagnu@prep.ai.mit.edu. + + How To Configure and Build + + To build DejaGnu, run the ``configure'' script here, e.g.: + + ./configure MYHOSTTYPE + +followed by running ``make''. (MYHOSTTYPE is a name for your host computer, +for instance "sun4". You can use the script ``config.sub'' to test whether +a name is recognized; if it is, config.sub translates it to a triplet +specifying CPU, vendor, and OS.) This is used when you plan to +configure and build in the source tree. + + If you use a separate tree for object files, (the recommended way), +then the --srcdir option must also be specified. This would also +require that the configure script be run from the top level directory. + + PATH/configure MYHOSTYPE --srcdir PATH/dejagnu + +where PATH is is the directory that the contains the sources. + + To configure it so it gets installed somewhere other than the +default of /usr/local, use the --prefix option. + + configure MYHOSTYPE --prefix [PATH] + +where PATH is the prefix used to install the programs. + + The configure testing and building will use the native compiler "cc" +on your host machine. To change which compiler gets used (like gcc) +set a the variable "CC" in your environment to point to it. + + For csh users: "setenv CC gcc" + For bourne shell users: "CC=gcc;export CC" + + Then when you compile, use "make CC=$CC". + +See etc/cfg-paper.texi, etc/configure.texi, and/or the README files in +various subdirectories, for more details. + + As DejaGnu is a Tcl program, there is nothing to build. However, the +documentation is not built by default. Use these targets: +"make info" - Convert the texinfo document to something that can + be used the GNU info program or info mode in emacs. +"make dvi" - Convert the texinfo document to something that can + be printed. This produces dvi output. +"make doc" - This builds both. +"make ps" - This converts the dvi file into postscript. This + requires a copy of dvips. +"make install" - This installs DejaGnu based on the --prefix option + when configuring. Otherwise it defaults to + /usr/local. See the DejaGnu manual for more + information on installation. + + Changes from 1.1.1 + 1. Works with (included in release) Tcl 7.3 and Expect 5.6. + 2. Much better error trapping and handling, including the + execution of sub scripts. + 3. Re-worked configuration subsystem. + 4. Default handling for testing unknown targets. + 5. New testsuite for expect and runtest. + 6. More debugging procedures. + + Changes from 1.0 + + 1. DejaGnu now conforms to POSIX 1003.3, a standard for + testing frameworks. + 2. A Tcl debugger written by Don Libes has been added. + 3. Lots of bug fixes. + + Changes from 0.9 + + 1. DejaGnu now installs itself like other utilities. + 2. 700 G++ tests are included. + 3. The bugs in the GCC tests have been fixed. + 4. Testsuites are released separately. + 5. Testsuite sources now reside with the within each tool's + source tree. + +------------------------------------------------------------------- +Here's is a posting on the Free OS testing project. (FROST) +------------------------------------------------------------------- +If you have built up your own tests for system calls, library +routines, networking protocols, or common utilities, this posting +offers you an opportunity to put them to good use. You can do a good +deed for the Linux community, the Berkeley UNIX community, and the +wider world of free software users. + +Also, if you would like to learn some good test tools and strategies, +and devote some time on a volunteer basis to writing tests -- perhaps +a couple of weeks full-time, or a couple hours per week over a period +of several months -- then here is a project you should get involved +in. + +I am helping to coordinate a test effort for Linux. In the following +four sections of this message I will describe the goals, the process, +the people trying to do it, and what you can do to help. + +Goals + + Linux and BSD share a number of libraries and utilities, both + because BSD software was ported to Linux, and because several free + software (GNU) utilities have been ported to both operating + systems. + + Linux shows startling differences and failures as you move from one + set of hardware to another. People who hope to base their own + commercial products on Linux would like to see proof that it is + robust, portable, and standard-conforming. The problem is that + cross-platform testing is very hard to do, and few decent test + suites exist either for free software or for UNIX. (Look at all the + differences you find among systems that are SVID-conforming, + particularly at higher levels such as the utilities.) + + Therefore, a number of us who are interested n Linux have decided to + enter the modern age of formal, automated software testing -- but in + a manner that is proper for the free software community. + + Using DejaGnu, a test platform developed by Cygnus Support and + placed under the GPL, we want to collect the best tests we can from + people everywhere, and integrate them into suites that any user can + download, run, and interpret with a few commands. DejaGnu already + runs under BSD, and Cygnus is porting it to Linux. + + Our goal is to test as many parts of the system as possible, + including system calls (particularly for POSIX 1003.1 compliance), + libraries in the official distribution, networking protocols, + and utilities. We need help with + + 1) integrating good tests donated by the community (and probably + written in a variety of programming languages and command + shells) into the DejaGnu framework, and + + 2) writing new tests for major functional areas for which no + adequate tests exist. + + The tests we use will be placed under the GPL and distributed by + Cygnus Support along with DejaGnu. H. J. Lu, who maintains the C + library for Linux, has offered to run the POSIX 1003.1 tests and as + many others as he can. + +Process + + First let me summarize the advantages of using DejaGnu, a free + software product that will be the umbrella for all the tests, and + then explain how we plan to conduct this project. + + Cygnus Support released DejaGnu to the public on January 3, along + with several test suites for GNU language tools. The product is + designed for portability and easy cross-platform development and + execution. It works more uniformly than typical tests using the + UNIX shell, and also supports interactive testing better than most + test platforms -- for instance, Cygnus has written over 1300 unit + tests for the gdb debugger using it. + + The implementation of DejaGnu is based on tcl and expect, two simple + existing languages for writing commands. You can develop new tests + in two major ways: by placing keyword-based comments in C source + code, or by writing tests in tcl. + + While Cygnus is still increasing their body of tests for language + tools, they are also turning their resources toward the libraries + and GNU utilities. While most of the tests are written at Cygnus, + they have reached out to communities of testers and are now porting + substantial sets of donated tests. + + We are hoping to broaden this successful use of collaboration across + user communities. We hope that suites of useful tests are sitting + in desk drawers out there. We also hope to gather and mobilize + people who appreciate the value of formal tests in legitimizing free + software, and would like to help write them. + + I am not an employee of Cygnus, but have volunteered to talk to + interested people and do an initial classification of tests, just to + offload some of this routine work from them. I will discuss all + offers with Cygnus staff to find out what is most needed and decide + which tests to incorporate into DejaGnu. There are several criteria + for choosing tests, including the degree to which an area is + covered, and its importance in the overall stability of the + operating system. Some tests may have to be rejected just because + they are hard to fit into the DejaGnu model. + +People + + Now you can find out why each of us got involved with this project. + + Cygnus writes and distributes free software, selling support as a + means to make money. The company is not directly in the business of + supporting operating systems or common UNIX utilities, so this kind + of testing is tangential to their main goals. But they may want to + support those things in the future. In any case, they would like to + see Linux do well, and this big test project will be a good + promotion for DejaGnu. + H. K. Lu, as a volunteer for Linux, has been using his own system to + implement, port, maintain, and ensure ANSI and POSIX compliance for + the C library (mostly the GNU C library along with the iostream + class from the g++ library). He is looking for ways to validate the + work that he and many other contributors have put in. + + As an editor at a publisher of computer books, my relationship to + Linux and BSD is even more distant than that of Cygnus. But we are + thinking about putting out books about Linux, from either the Linux + Documentation Project or independent authors, and would like to make + sure Linux is stable enough to be documented. The testing of + utilities is particularly important to me, because it can provide + quality assurance for our books, including the BSD version of UNIX + in a Nutshell. + +What you can do + + We ask people who have written tests in the areas I have described + to donate them to this project and see them benefit the public. + Don't just send me stuff -- write or call to discuss what you've got + in general. You also have to assign the tests to the Free Software + Foundation (a simple matter, so long as you are the owner of the + tests) so that they can be distributed under the GPL. + + Also, please don't starting flaming about the GPL. Either join our + project and donate your tests, or don't. Personally, I do not take + a side in this war. + + People who are interested in testing as a discipline, and have some + time to donate, are invited to contact me to help write tests. Tell + me: + + Your knowledge of computer languages and tools + + Previous software test efforts you have engaged in, if any + + How much time you can devote + + What functional areas you think are important and have a + particular interest in + + Cygnus staff will tell volunteers which areas need testing, and + offer guidance while you learn and apply DejaGnu. The most + important trait for the project is rigorous thinking along the lines + of software quality (so the best preparation is to have done some + formal testing before). You do not need to know any particular + language or tool; you can learn tcl or other aspects of DejaGnu + fairly quickly. + + Contact information for me is in my signature. I am at the phone + number during traditional U.S. business hours. So send mail any + time, or try calling from Monday through Friday, 9:00 AM to 5:00 PM, + Eastern Daylight Saving Time (four hours later than Greenwich Mean + Time). + + Feel free to distribute and repost this message elsewhere, in its + entirety. + +---------------------------------------------------------------------- +Andy Oram O'Reilly & Associates, Inc. andyo@ora.com + 90 Sherman Street, Cambridge, MA 02140 (617) 354-5800 + fax (617) 661-1116 +---------------------------------------------------------------------- + +There is a new listserv based mailing list for the FROST project. To +subscribe, send email to "listserv@cygnus.com" and the body should +contain "SUBSCRIBE FROST ". Messages sent to +frost@cygnus.com go to the mailing list. \ No newline at end of file diff --git a/contrib/bluegnu2.0.3/TODO.dejagnu b/contrib/bluegnu2.0.3/TODO.dejagnu new file mode 100644 index 0000000..b22cecc --- /dev/null +++ b/contrib/bluegnu2.0.3/TODO.dejagnu @@ -0,0 +1,7 @@ + Thu Mar 16 17:34:33 MST 1995 + +. Add more support for target boards and realtime OS's. +. Use the new expect terminal support for an "escape codes" API. +. Use expectk and write a GUI testing API, complete with + record/playback. +. Add a "testing methodologies" section to the manual. diff --git a/contrib/bluegnu2.0.3/aclocal.m4 b/contrib/bluegnu2.0.3/aclocal.m4 new file mode 100644 index 0000000..3483fe5 --- /dev/null +++ b/contrib/bluegnu2.0.3/aclocal.m4 @@ -0,0 +1,605 @@ +dnl This file is duplicated in four places: +dnl * gdb/aclocal.m4 +dnl * gdb/testsuite/aclocal.m4 +dnl * expect/aclocal.m4 +dnl * dejagnu/aclocal.m4 +dnl Consider modifying all copies in parallel. +dnl written by Rob Savoye for Cygnus Support +dnl CYGNUS LOCAL: This gets the right posix flag for gcc +AC_DEFUN(CY_AC_TCL_LYNX_POSIX, +[AC_REQUIRE([AC_PROG_CC])AC_REQUIRE([AC_PROG_CPP]) +AC_MSG_CHECKING([to see if this is LynxOS]) +AC_CACHE_VAL(ac_cv_os_lynx, +[AC_EGREP_CPP(yes, +[/* + * The old Lynx "cc" only defines "Lynx", but the newer one uses "__Lynx__" + */ +#if defined(__Lynx__) || defined(Lynx) +yes +#endif +], ac_cv_os_lynx=yes, ac_cv_os_lynx=no)]) +# +if test "$ac_cv_os_lynx" = "yes" ; then + AC_MSG_RESULT(yes) + AC_DEFINE(LYNX) + AC_MSG_CHECKING([whether -mposix or -X is available]) + AC_CACHE_VAL(ac_cv_c_posix_flag, + [AC_TRY_COMPILE(,[ + /* + * This flag varies depending on how old the compiler is. + * -X is for the old "cc" and "gcc" (based on 1.42). + * -mposix is for the new gcc (at least 2.5.8). + */ + #if defined(__GNUC__) && __GNUC__ >= 2 + choke me + #endif + ], ac_cv_c_posix_flag=" -mposix", ac_cv_c_posix_flag=" -X")]) + CC="$CC $ac_cv_c_posix_flag" + AC_MSG_RESULT($ac_cv_c_posix_flag) + else + AC_MSG_RESULT(no) +fi +]) +# +# Sometimes the native compiler is a bogus stub for gcc or /usr/ucb/cc. This +# makes configure think it's cross compiling. If --target wasn't used, then +# we can't configure, so something is wrong. +AC_DEFUN(CY_AC_C_CROSS, +[# If we cannot run a trivial program, we must be cross compiling. +AC_MSG_CHECKING(whether cross-compiling) +AC_CACHE_VAL(ac_cv_c_cross,[ +AC_TRY_RUN([ + main(){return(0);}], + ac_cv_c_cross=no, ac_cv_c_cross=yes, ac_cv_c_cross=yes) +]) +if test x"${target}" = x"${host}" -a x"${ac_cv_c_cross}" = x"yes"; then + dnl this hack is cause the message is so long we don't call AC_MSG_ERROR + echo "configure: error: You need to specify --target to cross compile," 1>&2; + echo " or the native compiler is broken" 1>&2; + exit 1; +else + cross_compiling=$ac_cv_c_cross + AC_MSG_RESULT($ac_cv_c_cross) +fi +]) +AC_DEFUN(CY_AC_PATH_TCLH, [ +# +# Ok, lets find the tcl source trees so we can use the headers +# Warning: transition of version 9 to 10 will break this algorithm +# because 10 sorts before 9. We also look for just tcl. We have to +# be careful that we don't match stuff like tclX by accident. +# the alternative search directory is involked by --with-tclinclude +# +no_tcl=true +AC_MSG_CHECKING(for Tcl private headers) +AC_ARG_WITH(tclinclude, [ --with-tclinclude directory where tcl private headers are], with_tclinclude=${withval}) +AC_CACHE_VAL(ac_cv_c_tclh,[ +# first check to see if --with-tclinclude was specified +if test x"${with_tclinclude}" != x ; then + if test -f ${with_tclinclude}/tclInt.h ; then + ac_cv_c_tclh=`(cd ${with_tclinclude}; pwd)` + else + AC_MSG_ERROR([${with_tclinclude} directory doesn't contain private headers]) + fi +fi +# next check in private source directory +# +# since ls returns lowest version numbers first, reverse its output +if test x"${ac_cv_c_tclh}" = x ; then + for i in \ + ${srcdir}/../tcl \ + `ls -dr ${srcdir}/../tcl[[0-9]]* 2>/dev/null` \ + ${srcdir}/../../tcl \ + `ls -dr ${srcdir}/../../tcl[[0-9]]* 2>/dev/null` \ + ${srcdir}/../../../tcl \ + `ls -dr ${srcdir}/../../../tcl[[0-9]]* 2>/dev/null ` ; do + if test -f $i/tclInt.h ; then + ac_cv_c_tclh=`(cd $i; pwd)` + break + fi + # Tcl 7.5 and greater puts headers in subdirectory. + if test -f $i/generic/tclInt.h ; then + ac_cv_c_tclh=`(cd $i; pwd)`/generic + fi + done +fi +# finally check in a few common install locations +# +# since ls returns lowest version numbers first, reverse its output +if test x"${ac_cv_c_tclh}" = x ; then + for i in \ + `ls -dr /usr/local/src/tcl[[0-9]]* 2>/dev/null` \ + `ls -dr /usr/local/lib/tcl[[0-9]]* 2>/dev/null` \ + /usr/local/src/tcl \ + /usr/local/lib/tcl \ + ${prefix}/include ; do + if test -f $i/tclInt.h ; then + ac_cv_c_tclh=`(cd $i; pwd)` + break + fi + done +fi +# see if one is installed +if test x"${ac_cv_c_tclh}" = x ; then + AC_HEADER_CHECK(tclInt.h, ac_cv_c_tclh=installed, ac_cv_c_tclh="") +fi +]) +if test x"${ac_cv_c_tclh}" = x ; then + TCLHDIR="# no Tcl private headers found" + AC_MSG_ERROR([Can't find Tcl private headers]) +fi +if test x"${ac_cv_c_tclh}" != x ; then + no_tcl="" + if test x"${ac_cv_c_tkh}" = x"installed" ; then + AC_MSG_RESULT([is installed]) + TCLHDIR="" + else + AC_MSG_RESULT([found in ${ac_cv_c_tclh}]) + # this hack is cause the TCLHDIR won't print if there is a "-I" in it. + TCLHDIR="-I${ac_cv_c_tclh}" + fi +fi + +AC_MSG_CHECKING([Tcl version]) +rm -rf tclmajor tclminor +orig_includes="$CPPFLAGS" + +if test x"${TCLHDIR}" != x ; then + CPPFLAGS="$CPPFLAGS $TCLHDIR" +fi + +AC_TRY_RUN([ +#include +#include "tcl.h" +main() { + FILE *maj = fopen("tclmajor","w"); + FILE *min = fopen("tclminor","w"); + fprintf(maj,"%d",TCL_MAJOR_VERSION); + fprintf(min,"%d",TCL_MINOR_VERSION); + fclose(maj); + fclose(min); + return 0; +}], + tclmajor=`cat tclmajor` + tclminor=`cat tclminor` + tclversion=$tclmajor.$tclminor + AC_MSG_RESULT($tclversion) + rm -f tclmajor tclminor +, + AC_MSG_RESULT([can't happen]) +, + AC_MSG_ERROR([can't be cross compiled]) +) +CPPFLAGS="${orig_includes}" + +AC_PROVIDE([$0]) +AC_SUBST(TCLHDIR) +]) +AC_DEFUN(CY_AC_PATH_TCLLIB, [ +# +# Ok, lets find the tcl library +# First, look for one uninstalled. +# the alternative search directory is invoked by --with-tcllib +# + +if test $tclmajor -ge 7 -a $tclminor -ge 4 ; then + installedtcllibroot=tcl$tclversion +else + installedtcllibroot=tcl +fi + +if test x"${no_tcl}" = x ; then + # we reset no_tcl incase something fails here + no_tcl=true + AC_ARG_WITH(tcllib, [ --with-tcllib directory where the tcl library is], + with_tcllib=${withval}) + AC_MSG_CHECKING([for Tcl library]) + AC_CACHE_VAL(ac_cv_c_tcllib,[ + # First check to see if --with-tcllib was specified. + # This requires checking for both the installed and uninstalled name-styles + # since we have no idea if it's installed or not. + if test x"${with_tcllib}" != x ; then + if test -f "${with_tcllib}/lib$installedtcllibroot.so" ; then + ac_cv_c_tcllib=`(cd ${with_tcllib}; pwd)`/lib$installedtcllibroot.so + elif test -f "${with_tcllib}/libtcl.so" ; then + ac_cv_c_tcllib=`(cd ${with_tcllib}; pwd)`/libtcl.so + # then look for a freshly built statically linked library + # if Makefile exists we assume its configured and libtcl will be built first. + elif test -f "${with_tcllib}/lib$installedtcllibroot.a" ; then + ac_cv_c_tcllib=`(cd ${with_tcllib}; pwd)`/lib$installedtcllibroot.a + elif test -f "${with_tcllib}/libtcl.a" ; then + ac_cv_c_tcllib=`(cd ${with_tcllib}; pwd)`/libtcl.a + else + AC_MSG_ERROR([${with_tcllib} directory doesn't contain libraries]) + fi + fi + # then check for a private Tcl library + # Since these are uninstalled, use the simple lib name root. + if test x"${ac_cv_c_tcllib}" = x ; then + for i in \ + ../tcl \ + `ls -dr ../tcl[[0-9]]* 2>/dev/null` \ + ../../tcl \ + `ls -dr ../../tcl[[0-9]]* 2>/dev/null` \ + ../../../tcl \ + `ls -dr ../../../tcl[[0-9]]* 2>/dev/null` ; do + # Tcl 7.5 and greater puts library in subdir. Look there first. + if test -f "$i/unix/libtcl.so" ; then + ac_cv_c_tcllib=`(cd $i; pwd)`/unix/libtcl.so + break + elif test -f "$i/unix/libtcl.a" -o -f "$i/unix/Makefile"; then + ac_cv_c_tcllib=`(cd $i; pwd)`/unix/libtcl.a + break + # look for a freshly built dynamically linked library + elif test -f "$i/libtcl.so" ; then + ac_cv_c_tcllib=`(cd $i; pwd)`/libtcl.so + break + + # then look for a freshly built statically linked library + # if Makefile exists we assume its configured and libtcl will be + # built first. + elif test -f "$i/libtcl.a" -o -f "$i/Makefile" ; then + ac_cv_c_tcllib=`(cd $i; pwd)`/libtcl.a + break + fi + done + fi + # check in a few common install locations + if test x"${ac_cv_c_tcllib}" = x ; then + for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do + # first look for a freshly built dynamically linked library + if test -f "$i/lib$installedtcllibroot.so" ; then + ac_cv_c_tcllib=`(cd $i; pwd)`/lib$installedtcllibroot.so + break + # then look for a freshly built statically linked library + # if Makefile exists we assume its configured and libtcl will be built first. + elif test -f "$i/lib$installedtcllibroot.a" -o -f "$i/Makefile" ; then + ac_cv_c_tcllib=`(cd $i; pwd)`/lib$installedtcllibroot.a + break + fi + done + fi + # check in a few other private locations + if test x"${ac_cv_c_tcllib}" = x ; then + for i in \ + ${srcdir}/../tcl \ + `ls -dr ${srcdir}/../tcl[[0-9]]* 2>/dev/null` ; do + # Tcl 7.5 and greater puts library in subdir. Look there first. + if test -f "$i/unix/libtcl.so" ; then + ac_cv_c_tcllib=`(cd $i; pwd)`/unix/libtcl.so + break + elif test -f "$i/unix/libtcl.a" -o -f "$i/unix/Makefile"; then + ac_cv_c_tcllib=`(cd $i; pwd)`/unix/libtcl.a + break + # look for a freshly built dynamically linked library + elif test -f "$i/libtcl.so" ; then + ac_cv_c_tcllib=`(cd $i; pwd)`/libtcl.so + break + + # then look for a freshly built statically linked library + # if Makefile exists we assume its configured and libtcl will be + # built first. + elif test -f "$i/libtcl.a" -o -f "$i/Makefile" ; then + ac_cv_c_tcllib=`(cd $i; pwd)`/libtcl.a + break + fi + done + fi + + # see if one is conveniently installed with the compiler + if test x"${ac_cv_c_tcllib}" = x ; then + orig_libs="$LIBS" + LIBS="$LIBS -l$installedtcllibroot -lm" + AC_TRY_RUN([ + Tcl_AppInit() + { exit(0); }], ac_cv_c_tcllib="-l$installedtcllibroot", ac_cv_c_tcllib="" + , ac_cv_c_tclib="-l$installedtcllibroot") + LIBS="${orig_libs}" + fi + ]) + if test x"${ac_cv_c_tcllib}" = x ; then + TCLLIB="# no Tcl library found" + AC_MSG_WARN(Can't find Tcl library) + else + TCLLIB=${ac_cv_c_tcllib} + AC_MSG_RESULT(found $TCLLIB) + no_tcl= + fi +fi + +AC_PROVIDE([$0]) +AC_SUBST(TCLLIB) +]) +AC_DEFUN(CY_AC_PATH_TKH, [ +# +# Ok, lets find the tk source trees so we can use the headers +# If the directory (presumably symlink) named "tk" exists, use that one +# in preference to any others. Same logic is used when choosing library +# and again with Tcl. The search order is the best place to look first, then in +# decreasing significance. The loop breaks if the trigger file is found. +# Note the gross little conversion here of srcdir by cd'ing to the found +# directory. This converts the path from a relative to an absolute, so +# recursive cache variables for the path will work right. We check all +# the possible paths in one loop rather than many seperate loops to speed +# things up. +# the alternative search directory is invoked by --with-tkinclude +# +AC_MSG_CHECKING(for Tk private headers) +AC_ARG_WITH(tkinclude, [ --with-tkinclude directory where the tk private headers are], + with_tkinclude=${withval}) +no_tk=true +AC_CACHE_VAL(ac_cv_c_tkh,[ +# first check to see if --with-tkinclude was specified +if test x"${with_tkinclude}" != x ; then + if test -f ${with_tkinclude}/tk.h ; then + ac_cv_c_tkh=`(cd ${with_tkinclude}; pwd)` + else + AC_MSG_ERROR([${with_tkinclude} directory doesn't contain private headers]) + fi +fi +# next check in private source directory +# +# since ls returns lowest version numbers first, reverse the entire list +# and search for the worst fit, overwriting it with better fits as we find them +if test x"${ac_cv_c_tkh}" = x ; then + for i in \ + ${srcdir}/../tk \ + `ls -dr ${srcdir}/../tk[[0-9]]* 2>/dev/null` \ + ${srcdir}/../../tk \ + `ls -dr ${srcdir}/../../tk[[0-9]]* 2>/dev/null` \ + ${srcdir}/../../../tk \ + `ls -dr ${srcdir}/../../../tk[[0-9]]* 2>/dev/null ` ; do + if test -f $i/tk.h ; then + ac_cv_c_tkh=`(cd $i; pwd)` + break + fi + # Tk 4.1 and greater puts this in a subdir. + if test -f $i/generic/tk.h; then + ac_cv_c_tkh=`(cd $i; pwd)`/generic + fi + done +fi +# finally check in a few common install locations +# +# since ls returns lowest version numbers first, reverse the entire list +# and search for the worst fit, overwriting it with better fits as we find them +if test x"${ac_cv_c_tkh}" = x ; then + for i in \ + `ls -dr /usr/local/src/tk[[0-9]]* 2>/dev/null` \ + `ls -dr /usr/local/lib/tk[[0-9]]* 2>/dev/null` \ + /usr/local/src/tk \ + /usr/local/lib/tk \ + ${prefix}/include ; do + if test -f $i/tk.h ; then + ac_cv_c_tkh=`(cd $i; pwd)` + break + fi + done +fi +# see if one is installed +if test x"${ac_cv_c_tkh}" = x ; then + AC_HEADER_CHECK(tk.h, ac_cv_c_tkh=installed) +fi +]) +if test x"${ac_cv_c_tkh}" != x ; then + no_tk="" + if test x"${ac_cv_c_tkh}" = x"installed" ; then + AC_MSG_RESULT([is installed]) + TKHDIR="" + else + AC_MSG_RESULT([found in $ac_cv_c_tkh]) + # this hack is cause the TKHDIR won't print if there is a "-I" in it. + TKHDIR="-I${ac_cv_c_tkh}" + fi +else + TKHDIR="# no Tk directory found" + AC_MSG_WARN([Can't find Tk private headers]) + no_tk=true +fi + +# if Tk is installed, extract the major/minor version +if test x"${no_tk}" = x ; then +AC_MSG_CHECKING([Tk version]) +rm -rf tkmajor tkminor +orig_includes="$CPPFLAGS" + +if test x"${TCLHDIR}" != x ; then + CPPFLAGS="$CPPFLAGS $TCLHDIR" +fi +if test x"${TKHDIR}" != x ; then + CPPFLAGS="$CPPFLAGS $TKHDIR" +fi +if test x"${x_includes}" != x -a x"${x_includes}" != xNONE ; then + CPPFLAGS="$CPPFLAGS -I$x_includes" +fi + +AC_TRY_RUN([ +#include +#include "tk.h" + main() { + FILE *maj = fopen("tkmajor","w"); + FILE *min = fopen("tkminor","w"); + fprintf(maj,"%d",TK_MAJOR_VERSION); + fprintf(min,"%d",TK_MINOR_VERSION); + fclose(maj); + fclose(min); + return 0; +}], + tkmajor=`cat tkmajor` + tkminor=`cat tkminor` + tkversion=$tkmajor.$tkminor + AC_MSG_RESULT($tkversion) + rm -f tkmajor tkminor +, + AC_MSG_ERROR([ +cannot compile a simple X program - suspect your xmkmf is +misconfigured and is incorrectly reporting the location of your X +include or libraries - report this to your system admin]) , + AC_MSG_ERROR([can't be cross compiled]) +) +CPPFLAGS="${orig_includes}" +fi + +AC_PROVIDE([$0]) +AC_SUBST(TKHDIR) +]) +AC_DEFUN(CY_AC_PATH_TKLIB, [ +AC_REQUIRE([CY_AC_PATH_TCL]) +# +# Ok, lets find the tk library +# First, look for the latest private (uninstalled) copy +# Notice that the destinations in backwards priority since the tests have +# no break. +# Then we look for either .a, .so, or Makefile. A Makefile is acceptable +# is it indicates the target has been configured and will (probably) +# soon be built. This allows an entire tree of Tcl software to be +# configured at once and then built. +# the alternative search directory is invoked by --with-tklib +# + +if test x"${no_tk}" = x ; then + # reset no_tk incase something fails here + no_tk="true" + + if test $tkmajor -ge 4 ; then + installedtklibroot=tk$tkversion + else + installedtkllibroot=tk + fi + + AC_ARG_WITH(tklib, [ --with-tklib directory where the tk library is], + with_tklib=${withval}) + AC_MSG_CHECKING([for Tk library]) + AC_CACHE_VAL(ac_cv_c_tklib,[ + # first check to see if --with-tklib was specified + # This requires checking for both the installed and uninstalled name-styles + # since we have no idea if it's installed or not. + if test x"${with_tklib}" != x ; then + if test -f "${with_tklib}/lib$installedtklibroot.so" ; then + ac_cv_c_tklib=`(cd ${with_tklib}; pwd)`/lib$installedtklibroot.so + no_tk="" + elif test -f "${with_tklib}/libtk.so" ; then + ac_cv_c_tklib=`(cd ${with_tklib}; pwd)`/libtk.so + no_tk="" + # then look for a freshly built statically linked library + # if Makefile exists we assume its configured and libtk will be built + elif test -f "${with_tklib}/lib$installedtklibroot.a" ; then + ac_cv_c_tklib=`(cd ${with_tklib}; pwd)`/lib$installedtklibroot.a + no_tk="" + elif test -f "${with_tklib}/libtk.a" ; then + ac_cv_c_tklib=`(cd ${with_tklib}; pwd)`/libtk.a + no_tk="" + else + AC_MSG_ERROR([${with_tklib} directory doesn't contain libraries]) + fi + fi + # then check for a private Tk library + # Since these are uninstalled, use the simple lib name root. + if test x"${ac_cv_c_tklib}" = x ; then + for i in \ + ../tk \ + `ls -dr ../tk[[0-9]]* 2>/dev/null` \ + ../../tk \ + `ls -dr ../../tk[[0-9]]* 2>/dev/null` \ + ../../../tk \ + `ls -dr ../../../tk[[0-9]]* 2>/dev/null` ; do + # Tk 4.1 and greater puts things in subdirs. Check these first. + if test -f "$i/unix/libtk.so" ; then + ac_cv_c_tklib=`(cd $i; pwd)`/unix/libtk.so + no_tk= + break + elif test -f "$i/unix/libtk.a" -o -f "$i/unix/Makefile"; then + ac_cv_c_tklib=`(cd $i; pwd)`/unix/libtk.a + no_tk= + break + # look for a freshly built dynamically linked library + elif test -f "$i/libtk.so" ; then + ac_cv_c_tklib=`(cd $i; pwd)`/libtk.so + no_tk= + break + # then look for a freshly built statically linked library + # if Makefile exists we assume its configured and libtk will be built + elif test -f "$i/libtk.a" -o -f "$i/Makefile" ; then + ac_cv_c_tklib=`(cd $i; pwd)`/libtk.a + no_tk="" + break + fi + done + fi + # finally check in a few common install locations + if test x"${ac_cv_c_tklib}" = x ; then + for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do + # first look for a freshly built dynamically linked library + if test -f "$i/lib$installedtklibroot.so" ; then + ac_cv_c_tklib=`(cd $i; pwd)`/lib$installedtklibroot.so + no_tk="" + break + # then look for a freshly built statically linked library + # if Makefile exists, we assume it's configured and libtcl will be built + elif test -f "$i/lib$installedtklibroot.a" -o -f "$i/Makefile" ; then + ac_cv_c_tklib=`(cd $i; pwd)`/lib$installedtklibroot.a + no_tk="" + break + fi + done + fi + # check in a few other private locations + if test x"${ac_cv_c_tklib}" = x ; then + for i in \ + ${srcdir}/../tk \ + `ls -dr ${srcdir}/../tk[[0-9]]* 2>/dev/null` ; do + # Tk 4.1 and greater puts things in subdirs. Check these first. + if test -f "$i/unix/libtk.so" ; then + ac_cv_c_tklib=`(cd $i; pwd)`/unix/libtk.so + no_tk= + break + elif test -f "$i/unix/libtk.a" -o -f "$i/unix/Makefile"; then + ac_cv_c_tcllib=`(cd $i; pwd)`/unix/libtk.a + no_tk= + break + # look for a freshly built dynamically linked library + elif test -f "$i/libtk.so" ; then + ac_cv_c_tklib=`(cd $i; pwd)`/libtk.so + no_tk="" + break + # then look for a freshly built statically linked library + # if Makefile exists, we assume it's configured and libtcl will be built + elif test -f "$i/libtk.a" -o -f "$i/Makefile" ; then + ac_cv_c_tklib=`(cd $i; pwd)`/libtk.a + no_tk="" + break + fi + done + fi + # see if one is conveniently installed with the compiler + if test x"${ac_cv_c_tklib}" = x ; then + AC_REQUIRE([AC_PATH_X]) + orig_libs="$LIBS" + LIBS="$LIBS -l$installedtklibroot $x_libraries $ac_cv_c_tcllib -lm" + AC_TRY_RUN([ + Tcl_AppInit() + { exit(0); }], ac_cv_c_tklib="-l$installedtklibroot", ac_cv_c_tklib="" + , ac_cv_c_tklib="-l$installedtklibroot") + LIBS="${orig_libs}" + fi + ]) + if test x"${ac_cv_c_tklib}" = x ; then + TKLIB="# no Tk library found" + AC_MSG_WARN(Can't find Tk library) + else + TKLIB=$ac_cv_c_tklib + AC_MSG_RESULT(found $TKLIB) + no_tk= + fi +fi +AC_PROVIDE([$0]) +AC_SUBST(TKLIB) +]) +AC_DEFUN(CY_AC_PATH_TK, [ + CY_AC_PATH_TKH + CY_AC_PATH_TKLIB +]) +AC_DEFUN(CY_AC_PATH_TCL, [ + CY_AC_PATH_TCLH + CY_AC_PATH_TCLLIB +]) diff --git a/contrib/bluegnu2.0.3/bluegnu b/contrib/bluegnu2.0.3/bluegnu new file mode 100755 index 0000000..cbb43ea --- /dev/null +++ b/contrib/bluegnu2.0.3/bluegnu @@ -0,0 +1,136 @@ +#! /bin/sh +# +# This application is using [incr Tcl] +# +# Copyright (C) 1998, 1999 jotOmega dsc, Inc. + +# This file is part of BlueGnu testing framework. +# It asumes that the itclsh3.0 program is on your PATH +# + +# +# Get the execution path to this script +# +execpath=`echo ${0-.} | sed -e 's@/[^/]*$@@'` + +# +# get the name by which bluegnu was invoked and extract the config triplet +# +bluegnu=`echo ${0-.} | sed -e 's@^.*/@@'` +target=`echo $bluegnu | sed -e 's/-bluegnu$//'` +if [ "$target" != bluegnu ] ; then + target="--target=${target}" +else + target="" +fi + +# +# Find the right interpreter binary to use. If a variable EXPECT exists, +# it takes precedence over all other tests. Otherwise look for a freshly +# built one, and then use one in the path. +# +if [ x"$EXPECT" != x ] ; then + expectbin=$EXPECT +else + if [ -x "$execpath/itclsh3.0" ] ; then + expectbin=$execpath/itclsh3.0 + else + expectbin=itclsh3.0 + fi +fi + +# just to be safe... +if [ -z "$expectbin" ]; then + echo "ERROR: No $expectbin shell found" + exit 1 +fi + +# +# Extract a few options from the option list. +# +verbose=0 +debug="" +for a in "$@" ; do + case $a in + -v|--v|-verb*|--verb*) verbose=`expr $verbose + 1`;; + -D0|--D0) debug="-D 0" ;; + -D1|--D1) debug="-D 1" ;; + esac +done + +if expr $verbose \> 0 \& "$DEBUG" > /dev/null ; then + echo Using $expectbin as interpreter for the BlueGnu testing framework. +fi + +# +# find bluegnu.itcl. First we look in it's installed location, otherwise +# start if from the source tree. +# +for i in $execpath/../lib/bluegnu $execpath/../lib $execpath $execpath/lib ; do + if expr $verbose \> 2 \& "$DEBUG" > /dev/null ; then + echo Looking for $i/bluegnu.itcl. + fi + if [ -f $i/bluegnu.itcl ] ; then + runpath=$i + if expr $verbose \> 0 \& "$DEBUG" > /dev/null ; then + echo Using $i/bluegnu.itcl as default main test driver + fi + break + fi +done + +# check for an environment variable +if [ x"$BLUEGNULIB" != x ] ; then + runpath=$BLUEGNULIB +else + BLUEGNULIB=$runpath; export BLUEGNULIB +fi +if expr $verbose \> 0 \& "$DEBUG" > /dev/null ; then + echo Using $BLUEGNULIB as the BlueGnu library +fi + +# +# Find the right test framework. If a variable FRAMEWORK exists, +# it takes precedence over all other frameworks. Otherwise look for the +# default one. +if [ x"$FRAMEWORK" != x ] ; then + framework=$FRAMEWORK +else + if [ -r "$runpath/bluegnu.itcl" ] ; then + framework=bluegnu.itcl + else + echo "ERROR: $runpath/bluegnu.itcl does not exist." + exit 1 + fi +fi + +if [ x"$runpath" = x ] ; then + echo "ERROR: bluegnu.itcl does not exist." + exit 1 +fi + +if [ ! -r "$runpath/$framework" ] ; then + echo "ERROR: $runpath/$framework does not exist." +else + if expr $verbose \> 0 \& "$DEBUG" > /dev/null ; then + echo "Using $runpath/$framework as main test driver" + fi +fi + +# Find Test Suite Root directory +# +if [ x"$TESTSUITEROOT" = x ] ; then + TESTSUITEROOT=`pwd`; export TESTSUITEROOT +else + cd $TESTSUITEROOT +fi +if expr $verbose \> 0 \& "$DEBUG" > /dev/null ; then + echo "Using $TESTSUITEROOT as Test Suite Directory." +fi + +# Start the BlueGnu Test Framework +# +if expr $verbose \> 2 \& "$DEBUG" > /dev/null ; then + echo Command: $expectbin $debug $runpath/$framework $target ${1+"$@"} +fi +exec $expectbin $debug $runpath/$framework $target ${1+"$@"} diff --git a/contrib/bluegnu2.0.3/bluegnutk b/contrib/bluegnu2.0.3/bluegnutk new file mode 100755 index 0000000..e637870 --- /dev/null +++ b/contrib/bluegnu2.0.3/bluegnutk @@ -0,0 +1,5 @@ +#! /bin/ksh +# + + +exec itkwish2.2 $0.itcl $* diff --git a/contrib/bluegnu2.0.3/bluegnutk.itcl b/contrib/bluegnu2.0.3/bluegnutk.itcl new file mode 100644 index 0000000..92c1c87 --- /dev/null +++ b/contrib/bluegnu2.0.3/bluegnutk.itcl @@ -0,0 +1,216 @@ +# +# +# + +set szApplName [file dirname $argv0]/[file root [file tail $argv0]] + +# puts "MAIA TK application: $szApplName" + +source ${szApplName}Utils.itcl + +if [file exists ~/.[file tail ${szApplName}]rc] { + puts stderr "Using Resource ~/.[file tail ${szApplName}]rc" + if [catch {option readfile ~/.[file tail ${szApplName}]rc} szErrMsg] { + puts stderr "error in ~/.[file tail ${szApplName}]rc: $szErrMsg" + } +} elseif [file exists ${szApplName}.rc] { + puts stderr "Using Resource ${szApplName}.rc" + if [catch {option readfile ${szApplName}.rc} szErrMsg] { + puts stderr "error in ${szApplName}.rc: $szErrMsg" + } +} + +wm title . "BlueGnu Tk" +set iLabelWidth 25 + +frame .options -borderwidth 3 +pack .options -side top -fill both -expand true +# puts "grid: [grid columnconfigure .options 1 -weight 1]" + +set iRow 0 +label .options.lCmd -text "BlueGnu Command Line:" -padx 0 -width $iLabelWidth -anchor e +entry .options.cmd -relief sunken -textvariable szCommand -width 60 +set wRun [button .options.run -text "Run it" -command run] +button .options.quit -text Quit -command exit +grid .options.lCmd -row $iRow -column 0 -sticky w +grid .options.cmd -row $iRow -column 1 -columnspan 4 -sticky ew +grid .options.run -row $iRow -column 5 -sticky ew +grid .options.quit -row $iRow -column 6 -sticky ew +bind .options.cmd run +bind .options.cmd stop +focus .options.cmd + +incr iRow +set szPWD [exec /bin/sh -c pwd] +set wPWDentry [entry .options.pwdText -textvariable szPWD] +set wPWDlabel [label .options.pwdLabel -text "Current Working Dir:" -padx 0 \ + -width $iLabelWidth -anchor e] +set wPWD [menubutton .options.pwd -text "Subdirectories" \ + -menu .options.pwd.menu -relief raised] +set wPWDmenu [menu .options.pwd.menu -tearoff 0] +$wPWDmenu add command -label "." -command {setPWD "."} +$wPWDmenu add command -label ".." -command {setPWD ".."} +$wPWDmenu add command -label "dummy" -command {setPWD "dummy"} +setPWD "." +grid .options.pwdLabel -row $iRow -column 0 -sticky w +grid .options.pwdText -row $iRow -column 1 -columnspan 4 -sticky ew +grid .options.pwd -row $iRow -column 5 -columnspan 2 -sticky ew +set iRowPWD $iRow + +incr iRow +set wEXPECTentry [entry .options.expectEntry \ + -textvariable szEXPECT -state disabled] +set wEXPECTlabel [label .options.expectLabel -text env(EXPECT): \ + -padx 0 -width $iLabelWidth -anchor e] +set wEXPECT [menubutton .options.expect -text "EXPECT choices" \ + -menu .options.expect.menu -relief raised] +set wEXPECTmenu [menu .options.expect.menu -tearoff 0] +set lTesters [option get $wEXPECTmenu choices {}] +if [info exists env(EXPECT)] { + setEXPECT $env(EXPECT) + if {[lsearch -exact $lTesters $szExpect] < 0} { + $wEXPECTmenu add command -label "$szExpect" \ + -command [list setEXPECT "$szExpect"] + } +} else { + setEXPECT {} +} +foreach szTester $lTesters { + #puts "tester choice: >$szTester<" + $wEXPECTmenu add command -label "$szTester" \ + -command [list setEXPECT "$szTester"] +} +$wEXPECTmenu add command -label "" \ + -command [list setEXPECT ""] +grid .options.expectLabel -row $iRow -column 0 -sticky w +grid .options.expectEntry -row $iRow -column 1 -columnspan 4 -sticky ew +grid .options.expect -row $iRow -column 5 -columnspan 2 -sticky ew + +incr iRow +label .options.targetLabel -text Target: -padx 0 -width $iLabelWidth -anchor e +label .options.targetChoice -textvariable szTarget -relief sunken -anchor w +menubutton .options.target -text "Target choices" \ + -menu .options.target.menu -relief raised +menu .options.target.menu -tearoff 0 +set lChoices [option get .options.target.menu choices {}] +foreach szChoice $lChoices { + .options.target.menu add command -label $szChoice \ + -command [list set szTarget $szChoice] +} +.options.target.menu add command -label "" \ + -command [list set szTarget ""] +grid .options.targetLabel -row $iRow -column 0 -sticky w +grid .options.targetChoice -row $iRow -column 1 -columnspan 4 -sticky ew -padx 2 +grid .options.target -row $iRow -column 5 -columnspan 2 -sticky ew + +incr iRow +label .options.viewLabel -text view: -padx 0 -width $iLabelWidth \ + -anchor e +label .options.viewChoice -textvariable szView -relief sunken -anchor w +menubutton .options.view -text "View choices" \ + -menu .options.view.menu -relief raised +menu .options.view.menu -tearoff 0 +set lChoices [option get .options.view.menu choices {}] +foreach szChoice $lChoices { + .options.view.menu add command -label $szChoice \ + -command [list set szView $szChoice] +} +.options.view.menu add command -label "" \ + -command [list set szView ""] +grid .options.viewLabel -row $iRow -column 0 -sticky w +grid .options.viewChoice -row $iRow -column 1 -columnspan 4 -sticky ew -padx 2 +grid .options.view -row $iRow -column 5 -columnspan 2 -sticky ew + +incr iRow +label .options.xipcLabel -text XIPCINSTANCE: \ + -padx 0 -width $iLabelWidth -anchor e +label .options.xipcChoice -textvariable szXipc -relief sunken -anchor w +menubutton .options.xipc -text "XIPCINSTANCE choices" \ + -menu .options.xipc.menu -relief raised +menu .options.xipc.menu -tearoff 0 +set lChoices [option get .options.xipc.menu choices {}] +foreach szChoice $lChoices { + .options.xipc.menu add command -label $szChoice \ + -command [list set szXipc $szChoice] +} +.options.xipc.menu add command -label "" \ + -command [list set szXipc ""] +grid .options.xipcLabel -row $iRow -column 0 -sticky w +grid .options.xipcChoice -row $iRow -column 1 -columnspan 4 -sticky ew -padx 2 +grid .options.xipc -row $iRow -column 5 -columnspan 2 -sticky ew + +set szTestScript "tools/xterm" +#set szArguments "\{title=\"\$szTarget -- \$szView\"\}" + +incr iRow +set wTSentry [entry .options.tsText -textvariable szTS -state disabled] +set wTSlabel [label .options.tsLabel -text "Current Test Scripts Dir:" \ + -padx 0 \ + -width $iLabelWidth -anchor e] +set wTS [menubutton .options.ts -text "Subdirectories" \ + -menu .options.ts.menu -relief raised] +set wTSmenu [menu .options.ts.menu -tearoff 0] +$wTSmenu add command -label "." -command {setTS "."} +$wTSmenu add command -label ".." -command {setTS ".."} +setTS "." +grid .options.tsLabel -row $iRow -column 0 -sticky w +grid .options.tsText -row $iRow -column 1 -columnspan 4 -sticky ew +grid .options.ts -row $iRow -column 5 -columnspan 2 -sticky ew +set iRowTS $iRow + +incr iRow +set wTSLlabel [label .options.tslLabel -text "Selected Test Scripts:" \ + -padx 0 \ + -width $iLabelWidth -anchor e] +frame .options.lists -background blue +#grid rowconfigure .options.lists 0 -weight 1 +#grid columnconfigure .options.lists 0 -weight 1 +grid .options.lists -row $iRow -column 1 -columnspan 6 -sticky news +set wLL [scrolledListBox .options.lists.fl] +set wLR [scrolledListBox .options.lists.fr] +grid .options.tslLabel -row $iRow -column 0 -sticky wn +grid rowconfigure .options.lists 0 -weight 1 +grid columnconfigure .options.lists 0 -weight 1 +grid .options.lists.fl -row 0 -column 0 -sticky news +#grid rowconfigure .options.lists.fr 0 -weight 1 +grid columnconfigure .options.lists 1 -weight 1 +grid .options.lists.fr -row 0 -column 1 -sticky news +bind $wLR [list listTransferSelected %W $wLL] +bind $wLL [list listTransferData %W] +bind $wLL [list listTransferRemoved %W $wLR] +insertTests $wLR + +incr iRow +set wArguments [entry .options.arguments -textvariable szArguments -width 40] +label .options.argumentsLabel -text "Arguments:" -padx 0 \ + -width $iLabelWidth -anchor e +grid .options.argumentsLabel -row $iRow -column 0 -sticky w +grid .options.arguments -row $iRow -column 1 -columnspan 6 -sticky ew + +incr iRow +set wTestcase [entry .options.testcase -textvariable szTestcase -width 40] +label .options.testcaseLabel -text "Testcase ID:" -padx 0 \ + -width $iLabelWidth -anchor e +grid .options.testcaseLabel -row $iRow -column 0 -sticky w +grid .options.testcase -row $iRow -column 1 -columnspan 6 -sticky ew + +set szTestcase "" +lostSelection $wLL + +frame .txt +set wLog [text .txt.log -width 80 -height 10 -borderwidth 2 -relief raised \ + -setgrid true -yscrollcommand {.txt.scroll set}] +scrollbar .txt.scroll -command {.txt.log yview} +pack .txt.scroll -side right -fill y +pack .txt.log -side left -fill both -expand true +pack .txt -side top -fill both -expand true + +trace variable szPWD w setPWDoverwrite +trace variable szExpect w setExpect +trace variable szTarget w cmdUpdate +trace variable szView w cmdUpdate +trace variable szXipc w cmdUpdate +trace variable szTS w setTSoverwrite +trace variable szArguments w cmdUpdate +trace variable szTestcase w cmdUpdate + diff --git a/contrib/bluegnu2.0.3/bluegnutk.rc b/contrib/bluegnu2.0.3/bluegnutk.rc new file mode 100644 index 0000000..225ac94 --- /dev/null +++ b/contrib/bluegnu2.0.3/bluegnutk.rc @@ -0,0 +1,29 @@ +! +! This is the resource file for MAIA Tk +! + +*background: #d9d9d9 +*foreground: black +*activeBackground: #ececec +*run.activeBackground: red +*activeForeground: blue +*run.activeForeground: yellow +*selectColor: #b03060 +*selectBackground: #c3c3c3 +*troughColor: #c3c3c3 +*disabledForeground: #a3a3a3 + +*expect.menu.choices: /home/jann/tools/MAIA/bin/botester \ + /home/jann/tools/MAIA/bin/ibotester \ + /home/jann/tools/MAIA/bin/pqltester \ + /home/jann/tools/MAIA/bin/cpqltester \ + /home/jann/tools/MAIA/bin/tester \ + /home/jann/tools/bin/iexpect + +*target.menu.choices: BusObj BusObj=Atlas BusObj=Corba \ + BusObj=TTX/Atlas TTX=Atlas \ + BusObj=ICR/Atlas ICR=Corba ICR=Atlas \ + BusObj=PQL/Atlas BusObj=PQL/Corba PQL=Corba PQL=Atlas + +*view.menu.choices: testB_spr1 testB_spr2 +*xipc.menu.choices: atsqa1 atsqa2 atsqa3 atsqa4 atsqa5 atsqa6 diff --git a/contrib/bluegnu2.0.3/bluegnutkUtils.itcl b/contrib/bluegnu2.0.3/bluegnutkUtils.itcl new file mode 100644 index 0000000..0ed485e --- /dev/null +++ b/contrib/bluegnu2.0.3/bluegnutkUtils.itcl @@ -0,0 +1,436 @@ +# +# +# + +# puts "MAIA TK Utilities" + +set szView [file tail $env(CLEARCASE_ROOT)] +set szXipc $env(XIPCINSTANCE) + +proc run {} { + global env + global szCommand wRun input wLog wRun + global szView szXipc + + set env(CLEARCASE_ROOT) /view/$szView + set env(XIPCINSTANCE) $szXipc + + set szCmd "xterm -sl 50000 -sb" + if {[string length $szCommand] == 0} { + set szCommand "$szCmd" + } else { + append szCmd " -e $szCommand" + } + if [catch {eval exec "$szCmd &"} input] { + $wLog insert end $input + bell + } else { + #fileevent $input readable log + $wLog insert end "$env(PS1)$szCommand &\n" + $wLog see end + #$wRun config -text Stop -command stop + } +} + +proc log {} { + global input wLog + + if [eof $input] { + stop + } else { + gets $input szLine + $wLog insert end "$szLine\n" + $wLog see end + } +} + + +proc stop {} { + global input wRun + + catch {close $input} + $wRun config -text "Run it" -command run +} + +proc cmdUpdate {name1 name2 ops} { + global szCommand szTarget szView szXipc \ + szTestScript szTestcase szArguments + global iSelect + global lTestScripts lTestcaseIDs lArguments + + switch $name1 { + szArguments { + set lArguments($iSelect) $szArguments + } + szTestcase { + set lTestcaseIDs($iSelect) $szTestcase + } + } + + set szCommand "bluegnu " + if {[string compare $szTarget ""] != 0} { + append szCommand "\"--target=$szTarget" + if {[string compare $szView ""] != 0} { + append szCommand " view=$szView" + } + if {[string compare $szXipc ""] != 0} { + append szCommand " XIPCINSTANCE=$szXipc" + } + append szCommand "\" " + } + foreach i [lsort -integer [array names lTestScripts]] { + # puts "test script index = $i" + append szCommand "\"$lTestScripts($i)" + if {[string compare $lTestcaseIDs($i) ""] !=0} { + append szCommand "\[$lTestcaseIDs($i)\]" + } + if {[string compare $lArguments($i) ""] != 0} { + #puts "szArguments: >$lArguments($i)<" + append szCommand "=$lArguments($i)" + } + append szCommand "\" " + } + #puts "szCommand: >$szCommand<" +} + +proc setPWD {dir} { + global szPWD wPWDmenu wPWDentry env + #puts "setPWD $dir:" + set szPWD $dir + #puts "szPWD:: $szPWD" + cd $szPWD + catch {setTS "."} + if {[string compare $szPWD "/"] != 0} { + set szPWD "[exec /bin/sh -c pwd]/" + regsub "/tmp_mnt" $szPWD "" szPWD + } + #puts "szPWD>: $szPWD" + $wPWDentry insert [$wPWDentry index end] \ + [string range $szPWD [$wPWDentry index end] end] + #update idletasks + $wPWDentry icursor end + + if {[$wPWDmenu index end] > 1} { + $wPWDmenu delete 2 end + } + foreach F [lsort [glob *]] { + if [file isdirectory $F] { + set szFile [file tail $F] + $wPWDmenu add command -label $szFile -command "setPWD $szFile" + } + } +} + +proc setPWDoverwrite {name1 name2 ops} { + global wPWDmenu env + catch {upvar #0 $name1 szPWD} szErrMsg + + if {[file isdirectory $szPWD]} { + trace vdelete szPWD w setPWDoverwrite + setPWD $szPWD + trace variable szPWD w setPWDoverwrite + } else { + set szDir {} + foreach F [glob -nocomplain "${szPWD}*"] { + if [file isdirectory $F] { + lappend szDir $F + } + } + # puts "szDir: >$szDir< [llength $szDir]" + if {[llength $szDir] == 1} { + set szPWD $szDir + setPWD $szPWD + } elseif {[llength $szDir] == 0} { + bell + } + } +} + +proc checkDir {szDir} { + regsub "^.*/home" $szDir "/home" szDir + return $szDir +} + +proc setTS {dir} { + global szTS szTSdir wTSmenu wTSentry env wLR + + trace vdelete szTS w setTSoverwrite + $wTSentry configure -state normal + #puts "setTS $dir: [checkDir [exec /bin/sh -c pwd]]" + if {[string compare $dir ".."] == 0} { + # puts "##szTS: >$szTS<1" + set szTStmp [file dirname $szTS] + # puts "##szTS: >[set szTStmp [file dirname $szTS]]<2" + $wTSentry delete 0 end + # puts "##szTS: >$szTS<3" + $wTSentry insert end "$szTStmp/" + } elseif {[string compare $dir "."] == 0} { + set szTStmp "." + $wTSentry delete 0 end + $wTSentry insert end "$szTStmp/" + catch {listRemoved} szErrMsg + #puts "err: $szErrMsg" + } else { + $wTSentry insert end "$dir/" + } + set szTmp [$wTSentry get] + # puts "####### TS: >[set szTmp [$wTSentry get]]<" + #puts "######szTS: >$szTS<" + catch {insertTests $wLR} + +# update idletasks +# $wTSentry icursor end + + # puts "TS menu index: [$wTSmenu index end]" + if {[$wTSmenu index end] != "none"} { + $wTSmenu delete 0 end + } + if {[string compare $szTmp "./"] != 0} { + $wTSmenu add command -label .. \ + -command "setTS .." + } + foreach F [lsort [glob -nocomplain ${szTmp}*]] { + if [file isdirectory $F] { + set szFile [file tail $F] + $wTSmenu add command -label $szFile \ + -command "setTS $szFile" + } + } + $wTSentry configure -state disabled + trace variable szTS w setTSoverwrite + # puts "TS menu end" +} + +proc setEXPECT {dir} { + global szExpect wEXPECTentry env + # puts "Set env(EXPECT) to $dir" + + trace vdelete szExpect w setExpectOverwrite + $wEXPECTentry configure -state normal + $wEXPECTentry delete 0 end + $wEXPECTentry insert end "$dir" + set szExpect $dir + $wEXPECTentry configure -state disabled + trace variable szExpect w setExpectOverwrite +} + +proc setTSoverwrite {name1 name2 ops} { + global wTSmenu env + catch {upvar #0 $name1 szTS} szErrMsg + + # puts "szTS >$szTS<" + #setTS $szTS +} + +proc setExpectOverwrite {name1 name2 ops} { + #global wEmenu env + catch {upvar #0 $name1 szExpect} szErrMsg +} + +proc setExpect {name1 name2 ops} { + global szExpect env + + if {[string length $szExpect] == 0} { + catch {unset env(EXPECT)} + } else { + set env(EXPECT) $szExpect + } +} + +proc scrollSet {wScroll geoCmd offset size} { + if {$offset != 0.0 || $size != 1.0} { + eval $geoCmd; # make sure it is visible + $wScroll set $offset $size + } else { + set manager [lindex $geoCmd 0] + $manager forget $wScroll; # hide it + } +} + +proc scrolledListBox {w args} { + frame $w -width 200 + grid rowconfigure $w 0 -weight 1 + grid columnconfigure $w 0 -weight 1 + listbox $w.list \ + -xscrollcommand [list scrollSet $w.xscroll \ + [list grid $w.xscroll -row 1 -column 0 -sticky we]] \ + -yscrollcommand [list scrollSet $w.yscroll \ + [list grid $w.yscroll -row 0 -column 1 -sticky ns]] + eval {$w.list configure} $args + scrollbar $w.xscroll -orient horizontal \ + -command [list $w.list xview] + scrollbar $w.yscroll -orient vertical \ + -command [list $w.list yview] + grid $w.list $w.yscroll -sticky news + grid $w.xscroll -sticky news + return $w.list +} + +proc listTransferSelected {w wL} { + global szTS wLR + global lTestScripts lTestcaseIDs lArguments + + set i [lindex [$w curselection] 0] + set szTest [$w get $i] + set szTestScript [file join $szTS $szTest] + # puts "selected: >$szTest<" + set i [$wL index end] + set lTestScripts($i) $szTestScript + set lTestcaseIDs($i) "" + set lArguments($i) [getArguments $szTestScript] + # puts "set lArguments($i) $lArguments($i)" + $wL insert end $szTestScript + cmdUpdate lArguments {} u +} + +proc listRemoved {} { + global lTestScripts lTestcaseIDs lArguments + global wLL szCommand + + if [catch {set jMax [$wLL index end]}] return + for {set i $jMax} {$i > 0} {incr i -1} { + catch {unset lTestScripts($i)} + catch {unset lTestcaseIDs($i)} + catch {unset lArguments($i)} + $wLL delete $i + } + set szCommand "" +} + +proc listTransferRemoved {w wL} { + global lTestScripts lTestcaseIDs lArguments + + set jMax [$w index end] + foreach i [lsort -integer -decreasing [$w curselection]] { + # puts "i = $i; jMax = $jMax" + if {$i + 1 < $jMax} { + for {set j $i} {$j < $jMax - 1} {incr j} { + set k [expr $j + 1] + # puts "j = $j; k = $k" + set lTestScripts($j) $lTestScripts($k) + set lTestcaseIDs($j) $lTestcaseIDs($k) + set lArguments($j) $lArguments($k) + unset lTestScripts($k) + unset lTestcaseIDs($k) + unset lArguments($k) + } + } else { + unset lTestScripts($i) + unset lTestcaseIDs($i) + unset lArguments($i) + } + cmdUpdate lArguments {} u + $w delete $i + } +} + +proc listTransferData {w} { + global iSelect szArguments wArguments szTestcase wTestcase + global lTestcaseIDs lArguments + + if {! [catch {set iSelect [lindex [$w curselection] 0]}]} { + if {[llength iSelect] == 1} { + selection own -command [list lostSelection $w] $w + # trace vdelete szArguments w cmdUpdate + set szArguments $lArguments($iSelect) + $wArguments configure -state normal + # trace variable szArguments w cmdUpdate + # trace vdelete szTestcase w cmdUpdate + set szTestcase $lTestcaseIDs($iSelect) + $wTestcase configure -state normal + # trace variable szTestcase w cmdUpdate + cmdUpdate lArguments {} u + } + } +} + +proc lostSelection {w} { + global wArguments wTestcase + global iSelect szArguments szTestcase + + set i [$w index active] + # $w selection clear $i + # trace vdelete szArguments w cmdUpdate + # trace vdelete szTestcase w cmdUpdate + # set szArguments "" + # set szTestcase "" + # trace variable szArguments w cmdUpdate + # trace variable szTestcase w cmdUpdate + $wArguments configure -state disabled + $wTestcase configure -state disabled +} + +proc getArguments {ts} { + if [file exists $ts] { + set F [open $ts r] + set bArg 0 + set szArgs "" + while {[gets $F szLine] >= 0} { + switch -regexp $szLine { + "Mandatory Arguments:" - + "Optional Arguments:" { + set bArg 1 + continue + } + {^# *$} { + set bArg 0 + continue + } + {^processTestScriptArgs} { + break + } + default { + if {$bArg} { + set bRepl [regsub {^# *} $szLine {} szArg] + if {! $bRepl} { + set bRepl [regsub "^\[ \t ]*set *" \ + $szLine {} szArg] + if {$bRepl} { + regsub " " $szArg "=" szArg + regsub -all {"} $szArg "" szArg + regsub -all "\{" $szArg "" szArg + regsub -all "\}" $szArg "" szArg + } + } + if {$bRepl} { + regsub { *; *#.*$} $szArg {} szArg + if {[string first " " $szArg] >= 0} { + append szArgs "\{[string trim $szArg]\} " + } else { + append szArgs "[string trim $szArg] " + } + } + } + } + } + } + close $F + return [string trim $szArgs] + } + return "" +} + +proc insertTests {w} { + global szTS + + $w delete 0 end + foreach F [lsort [glob -nocomplain ${szTS}/*]] { + if {! [file isdirectory $F]} { + switch -regexp $F { + {~$} - + {[.]sql$} - + {[.]err$} - + {[.]log$} - + {[.]out$} - + {[.]txt$} - + {tclIndex$} { + # Nothing to be done, will not be added to list + } + default { + set szFile [file tail $F] + $w insert end "$szFile" + } + } + } + } +} diff --git a/contrib/bluegnu2.0.3/config.guess b/contrib/bluegnu2.0.3/config.guess new file mode 100755 index 0000000..afd200a --- /dev/null +++ b/contrib/bluegnu2.0.3/config.guess @@ -0,0 +1,592 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 93, 94, 95, 1996 Free Software Foundation, Inc. +# +# This file 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 of the License, 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. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Written by Per Bothner . +# The master version of this file is at the FSF in /home/gd/gnu/lib. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit system type (host/target name). +# +# Only a few systems have been added to this list; please add others +# (but try to keep the structure clean). +# + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 8/24/94.) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15 + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + alpha:OSF1:[VX]*:*) + # After 1.2, OSF1 uses "V1.3" for uname -r. + # After 4.x, OSF1 uses "X4.x" for uname -r. + echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VX]//'` + exit 0 ;; + alpha:OSF1:*:*) + # 1.2 uses "1.2" for uname -r. + echo alpha-dec-osf${UNAME_RELEASE} + exit 0 ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit 0 ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-cbm-sysv4 + exit 0;; + amiga:NetBSD:*:*) + echo m68k-cbm-netbsd${UNAME_RELEASE} + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; + Pyramid*:OSx*:*:*) + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit 0 ;; + sun4*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + i86pc:SunOS:5.*:*) + echo i386-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit 0 ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit 0 ;; + atari*:NetBSD:*:*) + echo m68k-atari-netbsd${UNAME_RELEASE} + exit 0 ;; + sun3*:NetBSD:*:*) + echo m68k-sun-netbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:NetBSD:*:*) + echo m68k-apple-netbsd${UNAME_RELEASE} + exit 0 ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + mips:*:4*:UMIPS) + echo mips-mips-riscos4sysv + exit 0 ;; + mips:*:5*:RISCos) + echo mips-mips-riscos${UNAME_RELEASE} + exit 0 ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit 0 ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit 0 ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit 0 ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit 0 ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`uname -p` + if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88100 ] ; then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \ + -o ${TARGET_BINARY_INTERFACE}x = x ] ; then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else echo i586-dg-dgux${UNAME_RELEASE} + fi + exit 0 ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit 0 ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit 0 ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit 0 ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit 0 ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit 0 ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i[34]86:AIX:*:*) + echo i386-ibm-aix + exit 0 ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + sed 's/^ //' << EOF >dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0 + rm -f dummy.c dummy + echo rs6000-ibm-aix3.2.5 + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit 0 ;; + *:AIX:*:4) + if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=4.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit 0 ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit 0 ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit 0 ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit 0 ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit 0 ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit 0 ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit 0 ;; + 9000/[3478]??:HP-UX:*:*) + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/7?? | 9000/8?[679] ) HP_ARCH=hppa1.1 ;; + 9000/8?? ) HP_ARCH=hppa1.0 ;; + esac + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit 0 ;; + 3050*:HI-UX:*:*) + sed 's/^ //' << EOF >dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0 + rm -f dummy.c dummy + echo unknown-hitachi-hiuxwe2 + exit 0 ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit 0 ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit 0 ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit 0 ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit 0 ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit 0 ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit 0 ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit 0 ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit 0 ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit 0 ;; + CRAY*X-MP:*:*:*) + echo xmp-cray-unicos + exit 0 ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} + exit 0 ;; + CRAY*C90:*:*:*) + echo c90-cray-unicos${UNAME_RELEASE} + exit 0 ;; + CRAY-2:*:*:*) + echo cray2-cray-unicos + exit 0 ;; + hp3[0-9][05]:NetBSD:*:*) + echo m68k-hp-netbsd${UNAME_RELEASE} + exit 0 ;; + i[34]86:BSD/386:*:* | *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:FreeBSD:*:*) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit 0 ;; + *:NetBSD:*:*) + echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; + i*:CYGWIN*:*) + echo i386-unknown-cygwin32 + exit 0 ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin32 + exit 0 ;; + *:GNU:*:*) + echo `echo ${UNAME_MACHINE}|sed -e 's,/.*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit 0 ;; + *:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. + ld_help_string=`ld --help 2>&1` + if echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf_i[345]86"; then + echo "${UNAME_MACHINE}-unknown-linux" ; exit 0 + elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i[345]86linux"; then + echo "${UNAME_MACHINE}-unknown-linuxaout" ; exit 0 + elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i[345]86coff"; then + echo "${UNAME_MACHINE}-unknown-linuxcoff" ; exit 0 + elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68kelf"; then + echo "${UNAME_MACHINE}-unknown-linux" ; exit 0 + elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68klinux"; then + echo "${UNAME_MACHINE}-unknown-linuxaout" ; exit 0 + elif test "${UNAME_MACHINE}" = "alpha" ; then + echo alpha-unknown-linux ; exit 0 + else + # Either a pre-BFD a.out linker (linuxoldld) or one that does not give us + # useful --help. Gcc wants to distinguish between linuxoldld and linuxaout. + test ! -d /usr/lib/ldscripts/. \ + && echo "${UNAME_MACHINE}-unknown-linuxoldld" && exit 0 + # Determine whether the default compiler is a.out or elf + cat >dummy.c </dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0 + rm -f dummy.c dummy + fi ;; +# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions +# are messed up and put the nodename in both sysname and nodename. + i[34]86:DYNIX/ptx:4*:*) + echo i386-sequent-sysv4 + exit 0 ;; + i[34]86:*:4.*:* | i[34]86:SYSTEM_V:4.*:*) + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE} + else + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE} + fi + exit 0 ;; + i[34]86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` + (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + echo ${UNAME_MACHINE}-unknown-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-unknown-sysv32 + fi + exit 0 ;; + Intel:Mach:3*:*) + echo i386-unknown-mach3 + exit 0 ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit 0 ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit 0 ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit 0 ;; + M680[234]0:*:R3V[567]*:*) + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0) + uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4.3 && exit 0 ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4 && exit 0 ;; + m680[234]0:LynxOS:2.[23]*:*) + echo m68k-lynx-lynxos${UNAME_RELEASE} + exit 0 ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit 0 ;; + i[34]86:LynxOS:2.[23]*:*) + echo i386-lynx-lynxos${UNAME_RELEASE} + exit 0 ;; + TSUNAMI:LynxOS:2.[23]*:*) + echo sparc-lynx-lynxos${UNAME_RELEASE} + exit 0 ;; + rs6000:LynxOS:2.[23]*:*) + echo rs6000-lynx-lynxos${UNAME_RELEASE} + exit 0 ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit 0 ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit 0 ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +cat >dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + printf ("%s-next-nextstep%s\n", __ARCHITECTURE__, version==2 ? "2" : "3"); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-unknown-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +#if !defined (ultrix) + printf ("vax-dec-bsd\n"); exit (0); +#else + printf ("vax-dec-ultrix\n"); exit (0); +#endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0 +rm -f dummy.c dummy + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit 0 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + c34*) + echo c34-convex-bsd + exit 0 ;; + c38*) + echo c38-convex-bsd + exit 0 ;; + c4*) + echo c4-convex-bsd + exit 0 ;; + esac +fi + +#echo '(Unable to guess system type)' 1>&2 + +exit 1 diff --git a/contrib/bluegnu2.0.3/configure b/contrib/bluegnu2.0.3/configure new file mode 100755 index 0000000..5296de2 --- /dev/null +++ b/contrib/bluegnu2.0.3/configure @@ -0,0 +1,974 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.7 +# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. +# Copyright (C) 1998 jotOmega dsc, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.7" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set LANG and LC_ALL to C if already set. +# These must not be set unconditionally because not all systems understand +# e.g. LANG=C (notably SCO). +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LANG+set}" = set; then LANG=C; export LANG; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=runtest.exp + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='echo $CPP $CPPFLAGS 1>&5; +$CPP $CPPFLAGS' +ac_compile='echo ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5; +${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5 2>&5' +ac_link='echo ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5; +${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5 2>&5' + +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_CC" && ac_cv_prog_CC="cc" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5 | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 +if test $ac_cv_prog_gcc = yes; then + GCC=yes + if test "${CFLAGS+set}" != set; then + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_prog_gcc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_gcc_g=yes +else + ac_cv_prog_gcc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_gcc_g" 1>&6 + if test $ac_cv_prog_gcc_g = yes; then + CFLAGS="-g -O" + else + CFLAGS="-O" + fi + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + for ac_prog in ginstall installbsd scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + # OSF/1 installbsd also uses dspmsg, but is usable. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_ifs" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +subdirs="doc example testsuite" + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \ + >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.7" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@CC@%$CC%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@subdirs@%$subdirs%g + +CEOF +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust relative srcdir, etc. for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file +fi; done +rm -f conftest.subs + + + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + +if test "$no_recursion" != yes; then + + # Remove --cache-file and --srcdir arguments so they do not pile up. + ac_sub_configure_args= + ac_prev= + for ac_arg in $ac_configure_args; do + if test -n "$ac_prev"; then + ac_prev= + continue + fi + case "$ac_arg" in + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + ;; + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + ;; + *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;; + esac + done + + for ac_config_dir in doc example testsuite; do + + # Do not complain, so a configure script can configure whichever + # parts of a large source tree are present. + if test ! -d $srcdir/$ac_config_dir; then + continue + fi + + echo configuring in $ac_config_dir + + case "$srcdir" in + .) ;; + *) + if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :; + else + { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>&2; exit 1; } + fi + ;; + esac + + ac_popdir=`pwd` + cd $ac_config_dir + + case "$srcdir" in + .) # No --srcdir option. We are building in place. + ac_sub_srcdir=$srcdir ;; + /*) # Absolute path. + ac_sub_srcdir=$srcdir/$ac_config_dir ;; + *) # Relative path. + ac_sub_srcdir=../$srcdir/$ac_config_dir ;; + esac + + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_sub_srcdir/configure; then + ac_sub_configure=$ac_sub_srcdir/configure + elif test -f $ac_sub_srcdir/configure.in; then + ac_sub_configure=$ac_configure + else + echo "configure: warning: no configuration information is in $ac_config_dir" 1>&2 + ac_sub_configure= + fi + + # The recursion is here. + if test -n "$ac_sub_configure"; then + + # Make the cache file name correct relative to the subdirectory. + # A "../" for each directory in /$ac_config_dir. + ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'` + case "$cache_file" in + /*) ac_sub_cache_file=$cache_file ;; + *) # Relative path. + ac_sub_cache_file="$ac_dots$cache_file" ;; + esac + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir" + # The eval makes quoting arguments work. + if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir + then : + else + { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; } + fi + fi + + cd $ac_popdir + done +fi + diff --git a/contrib/bluegnu2.0.3/configure.in b/contrib/bluegnu2.0.3/configure.in new file mode 100644 index 0000000..0ebdb7b --- /dev/null +++ b/contrib/bluegnu2.0.3/configure.in @@ -0,0 +1,9 @@ +dnl Process this file with autoconf to produce a configure script. +AC_INIT(runtest.exp) + +AC_PROG_CC +AC_PROG_INSTALL + +AC_CONFIG_SUBDIRS(doc example testsuite) + +AC_OUTPUT(Makefile) diff --git a/contrib/bluegnu2.0.3/contents b/contrib/bluegnu2.0.3/contents new file mode 100644 index 0000000..8adfee3 --- /dev/null +++ b/contrib/bluegnu2.0.3/contents @@ -0,0 +1,232 @@ +total 266 +-rw-r--r-- 1 janw users 5396 Sep 19 21:10 Makefile.in +-rw-r--r-- 1 janw users 8202 Sep 19 21:18 README.bluegnu +-rw-r--r-- 1 janw users 12903 Aug 3 1998 README.dejagnu +-rw-r--r-- 1 janw users 284 Aug 3 1998 TODO.dejagnu +-rw-r--r-- 1 janw users 19640 Aug 3 1998 aclocal.m4 +-rwxr-xr-x 1 janw users 3323 Sep 19 15:37 bluegnu +-rwxr-xr-x 1 janw users 43 Feb 11 1999 bluegnutk +-rw-r--r-- 1 janw users 8456 Sep 17 18:17 bluegnutk.itcl +-rw-r--r-- 1 janw users 839 Feb 11 1999 bluegnutk.rc +-rw-r--r-- 1 janw users 10554 Sep 17 18:17 bluegnutkUtils.itcl +-rwxr-xr-- 1 janw users 17007 Aug 3 1998 config.guess +-rwxr-xr-x 1 janw users 32591 Aug 3 1998 configure +-rw-r--r-- 1 janw users 179 Aug 3 1998 configure.in +-rw-r--r-- 1 janw users 0 Sep 19 21:55 contents +drwxr-xr-x 2 janw users 1024 Sep 19 21:15 contrib +-rwxr-xr-x 1 janw users 2204 Aug 3 1998 dejagnu +drwxr-xr-x 2 janw users 1024 Sep 19 21:55 doc +drwxr-xr-x 3 janw users 1024 Sep 19 21:55 example +-rwxr-xr-x 1 janw users 4772 Aug 3 1998 install-sh +drwxr-xr-x 2 janw users 1024 Sep 19 21:15 lib +-rwxr-xr-x 1 janw users 650 Aug 3 1998 mkinstalldirs +-rwxr-xr-- 1 janw users 2102 Aug 3 1998 runtest +-rwxr-xr-- 1 janw users 33061 Aug 3 1998 runtest.exp +-rw-r--r-- 1 janw users 7843 Aug 3 1998 site.tmpl +-rw-r--r-- 1 janw users 77247 Aug 3 1998 tcl-mode.el +drwxr-xr-x 4 janw users 1024 Sep 19 21:15 testsets +drwxr-xr-x 7 janw users 1024 Sep 19 21:55 testsuite + +contrib: +total 45 +-rw-r--r-- 1 janw users 868 Aug 3 1998 README +-rwxr-xr-- 1 janw users 1500 Aug 3 1998 test-g++ +-rwxr-xr-- 1 janw users 8256 Aug 3 1998 test-tool +-rwxr-xr-x 1 janw users 32055 Aug 3 1998 testit + +doc: +total 1867 +-rw-r--r-- 1 janw users 4796 Sep 19 21:10 Makefile.in +-rw-r--r-- 1 janw users 7917 Sep 19 21:10 README.tex +-rw-r--r-- 1 janw users 10840 Sep 19 21:16 READMEdvi.dvi +-rw-r--r-- 1 janw users 52 Sep 19 15:37 READMEdvi.tex +-rw-r--r-- 1 janw users 23 Sep 19 21:10 READMEdvi.title +-rw-r--r-- 1 janw users 9344 Sep 19 21:16 READMEtxt.dvi +-rw-r--r-- 1 janw users 52 Sep 19 15:37 READMEtxt.tex +-rwxr-xr-x 1 janw users 22137 Aug 3 1998 configure +-rw-r--r-- 1 janw users 125 Aug 3 1998 configure.in +-rw-r--r-- 1 janw users 3289 Sep 18 21:42 dejagnu.1 +-rw-r--r-- 1 janw users 263684 Sep 19 21:52 dejagnu.dvi +-rw-r--r-- 1 janw users 2041 Sep 19 21:52 dejagnu.info +-rw-r--r-- 1 janw users 49656 Sep 19 21:52 dejagnu.info-1 +-rw-r--r-- 1 janw users 50053 Sep 19 21:52 dejagnu.info-2 +-rw-r--r-- 1 janw users 47866 Sep 19 21:52 dejagnu.info-3 +-rw-r--r-- 1 janw users 651210 Sep 19 21:52 dejagnu.pdf +-rw-r--r-- 1 janw users 438510 Sep 19 21:52 dejagnu.ps +-rw-r--r-- 1 janw users 139117 Aug 3 1998 dejagnu.texi +-rw-r--r-- 1 janw users 11008 Sep 19 21:52 notice.html +-rw-r--r-- 1 janw users 78227 Sep 19 21:20 notice.pdf +-rw-r--r-- 1 janw users 95621 Sep 19 21:20 notice.ps + +example: +total 29 +-rw-r--r-- 1 janw users 2297 Feb 11 1999 Makefile.in +drwxr-xr-x 3 janw users 1024 Sep 19 21:55 calc +-rwxr-xr-x 1 janw users 23014 Aug 3 1998 configure +-rw-r--r-- 1 janw users 159 Aug 3 1998 configure.in + +example/calc: +total 37 +-rw-r--r-- 1 janw users 3336 Feb 11 1999 Makefile.in +-rw-r--r-- 1 janw users 416 Aug 3 1998 calc.1 +-rw-r--r-- 1 janw users 1380 Aug 3 1998 calc.c +-rw-r--r-- 1 janw users 225 Aug 3 1998 calc.h.in +-rwxr-xr-x 1 janw users 25611 Aug 3 1998 configure +-rw-r--r-- 1 janw users 363 Aug 3 1998 configure.in +drwxr-xr-x 4 janw users 1024 Sep 19 21:15 testsuite + +example/calc/testsuite: +total 2 +drwxr-xr-x 2 janw users 1024 Sep 19 21:15 calc.test +drwxr-xr-x 2 janw users 1024 Sep 19 21:15 config + +example/calc/testsuite/calc.test: +total 2 +-rw-r--r-- 1 janw users 1151 Aug 3 1998 calc.exp + +example/calc/testsuite/config: +total 1 +-rw-r--r-- 1 janw users 825 Aug 3 1998 unix.exp + +lib: +total 274 +-rw-r--r-- 1 janw users 2776 Sep 18 19:53 BlueGnu_target.itcl +-rw-r--r-- 1 janw users 2183 Sep 18 19:53 Default_target.itcl +-rw-r--r-- 1 janw users 5795 Sep 18 19:53 Types.itcl +-rw-r--r-- 1 janw users 561 Sep 17 18:18 bluegnu.itcl +-rw-r--r-- 1 janw users 2959 Aug 3 1998 bug.exp +-rw-r--r-- 1 janw users 5353 Aug 3 1998 debugger.exp +-rw-r--r-- 1 janw users 1890 Aug 3 1998 dejagnu.itcl +-rw-r--r-- 1 janw users 31724 Aug 3 1998 dejagnu.tcl +-rw-r--r-- 1 janw users 27666 Aug 3 1998 dg.exp +-rw-r--r-- 1 janw users 340 Aug 3 1998 foo.itcl +-rw-r--r-- 1 janw users 15692 Aug 3 1998 framework.exp +-rw-r--r-- 1 janw users 6926 Aug 3 1998 libgloss.exp +-rw-r--r-- 1 janw users 1499 Sep 17 18:18 nonexpect.itcl +-rw-r--r-- 1 janw users 22986 Aug 3 1998 remote.exp +-rw-r--r-- 1 janw users 1069 Aug 3 1998 serverUtils.itcl +-rw-r--r-- 1 janw users 14175 Aug 3 1998 target.exp +-rw-r--r-- 1 janw users 537 Sep 17 18:18 tclIndex +-rw-r--r-- 1 janw users 9084 Sep 17 18:18 testSessionApplication.itcl +-rw-r--r-- 1 janw users 34819 Sep 17 18:18 testSessionClasses.itcl +-rw-r--r-- 1 janw users 36461 Sep 17 18:18 testSessionFramework.itcl +-rw-r--r-- 1 janw users 476 Sep 17 18:18 testSessionUtils.itcl +-rw-r--r-- 1 janw users 5357 Aug 3 1998 udi.exp +-rw-r--r-- 1 janw users 2923 Aug 3 1998 util-defs.exp +-rw-r--r-- 1 janw users 11309 Aug 3 1998 utils.exp +-rw-r--r-- 1 janw users 7377 Aug 3 1998 vrtx.exp +-rw-r--r-- 1 janw users 7603 Aug 3 1998 vxworks.exp + +testsets: +total 3 +drwxr-xr-x 4 janw users 1024 Sep 19 21:15 BlueGnu +drwxr-xr-x 3 janw users 1024 Sep 19 21:15 examples +-rw-r--r-- 1 janw users 190 Sep 18 19:53 tclIndex + +testsets/BlueGnu: +total 29 +-rw-r--r-- 1 janw users 257 Sep 18 19:53 appendQueue.itcl +-rw-r--r-- 1 janw users 4325 Sep 18 19:53 clone_output.itcl +-rw-r--r-- 1 janw users 1364 Sep 18 19:53 locateFile.itcl +-rw-r--r-- 1 janw users 918 Sep 18 19:53 namespaceVariables.itcl +-rw-r--r-- 1 janw users 152 Sep 18 19:53 prependQueue.itcl +-rw-r--r-- 1 janw users 686 Sep 18 19:53 runtest.itcl +-rw-r--r-- 1 janw users 659 Sep 18 19:53 testNaming.itcl +drwxr-xr-x 2 janw users 1024 Sep 19 21:15 ts001 +drwxr-xr-x 2 janw users 1024 Sep 19 21:15 ts002 +-rw-r--r-- 1 janw users 968 Sep 18 19:53 types.itcl +-rw-r--r-- 1 janw users 13282 Sep 18 19:53 verbose.itcl + +testsets/BlueGnu/ts001: +total 1 +-rw-r--r-- 1 janw users 20 Sep 18 19:53 A.itcl + +testsets/BlueGnu/ts002: +total 1 +-rw-r--r-- 1 janw users 20 Sep 18 19:53 A.itcl + +testsets/examples: +total 7 +drwxr-xr-x 2 janw users 1024 Sep 19 21:15 lib +-rw-r--r-- 1 janw users 54 Sep 18 19:53 tc001 +-rw-r--r-- 1 janw users 73 Sep 18 19:53 tc002 +-rw-r--r-- 1 janw users 97 Sep 18 19:53 ts_001 +-rw-r--r-- 1 janw users 181 Sep 18 19:53 ts_002 +-rw-r--r-- 1 janw users 76 Sep 18 19:53 ts_003 +-rw-r--r-- 1 janw users 228 Sep 18 19:53 versionTcl.itcl + +testsets/examples/lib: +total 2 +-rw-r--r-- 1 janw users 1358 Sep 18 19:53 benchmark.itcl + +testsuite: +total 45 +-rw-r--r-- 1 janw users 3155 Sep 18 20:39 Makefile.in +drwxr-xr-x 3 janw users 1024 Sep 19 21:15 T +drwxr-xr-x 3 janw users 1024 Sep 19 21:15 bluegnu.all +drwxr-xr-x 2 janw users 1024 Sep 19 21:15 config +-rwxr-xr-x 1 janw users 34637 Aug 3 1998 configure +-rw-r--r-- 1 janw users 166 Aug 3 1998 configure.in +drwxr-xr-x 2 janw users 1024 Sep 19 21:15 lib +drwxr-xr-x 2 janw users 1024 Sep 19 21:15 tools + +testsuite/T: +total 10 +-rw-r--r-- 1 janw users 232 Aug 3 1998 env.exp +-rw-r--r-- 1 janw users 1355 Aug 3 1998 env.iexp +-rw-r--r-- 1 janw users 129 Aug 3 1998 foo.exp +drwxr-xr-x 2 janw users 1024 Sep 19 21:15 subT +-rw-r--r-- 1 janw users 132 Aug 3 1998 test_000.exp +-rw-r--r-- 1 janw users 484 Aug 3 1998 test_001.exp +-rw-r--r-- 1 janw users 453 Aug 3 1998 test_002.exp +-rw-r--r-- 1 janw users 55 Aug 3 1998 test_003.exp +-rw-r--r-- 1 janw users 34 Aug 3 1998 test_004.exp + +testsuite/T/subT: +total 1 +-rw-r--r-- 1 janw users 391 Aug 3 1998 test_002.exp + +testsuite/bluegnu.all: +total 32 +-rw-r--r-- 1 janw users 2431 Aug 3 1998 clone_output.test +-rw-r--r-- 1 janw users 2908 Aug 3 1998 config.test +-rw-r--r-- 1 janw users 1893 Aug 3 1998 default_procs.tcl +-rw-r--r-- 1 janw users 1580 Aug 3 1998 libs.exp +-rw-r--r-- 1 janw users 3486 Aug 3 1998 options.exp +-rw-r--r-- 1 janw users 4938 Aug 3 1998 remote.test +-rw-r--r-- 1 janw users 407 Aug 3 1998 stats-sub.exp +-rw-r--r-- 1 janw users 1626 Aug 3 1998 stats.exp +-rw-r--r-- 1 janw users 6001 Aug 3 1998 target.test +drwxr-xr-x 4 janw users 1024 Sep 19 21:15 topdir +-rw-r--r-- 1 janw users 2750 Aug 3 1998 utils.test + +testsuite/bluegnu.all/topdir: +total 2 +drwxr-xr-x 3 janw users 1024 Sep 19 21:15 subdir1 +drwxr-xr-x 2 janw users 1024 Sep 19 21:15 subdir2 + +testsuite/bluegnu.all/topdir/subdir1: +total 3 +-rw-r--r-- 1 janw users 31 Aug 3 1998 subfile1 +-rw-r--r-- 1 janw users 32 Aug 3 1998 subfile2 +drwxr-xr-x 2 janw users 1024 Sep 19 21:15 subsubdir1 + +testsuite/bluegnu.all/topdir/subdir1/subsubdir1: +total 1 +-rw-r--r-- 1 janw users 32 Aug 3 1998 subsubfile1 + +testsuite/bluegnu.all/topdir/subdir2: +total 1 +-rw-r--r-- 1 janw users 32 Aug 3 1998 subfile2 + +testsuite/config: +total 2 +-rw-r--r-- 1 janw users 2008 Aug 3 1998 default.exp + +testsuite/lib: +total 5 +-rw-r--r-- 1 janw users 5114 Aug 3 1998 libsup.exp + +testsuite/tools: +total 1 +-rw-r--r-- 1 janw users 609 Aug 3 1998 env.exp diff --git a/contrib/bluegnu2.0.3/contrib/README b/contrib/bluegnu2.0.3/contrib/README new file mode 100644 index 0000000..d776f6e --- /dev/null +++ b/contrib/bluegnu2.0.3/contrib/README @@ -0,0 +1,16 @@ +These are "user" contributed scripts that automate testing. These all +depend on using "make check", so they are included here as an aid to +helping others automate their own testing. All of these script do +report filtering on the output from DejaGnu. test-tool and test-g++ +are basically the same script. test-target is the script I use for our +quarterly release and it is the most sophisticated. It still uses +"make check" (a make target that start runtest) to produce the +results, but tests our entire tool chain for native and crosses. It +also produces a short summary report that gets emailed, as well as +summary reports. It does regression analysis using the previous test +run. testit is a very crude and simple Tk GUI for accessing all the +testing results. Hope these are helpful to anyone, I'd like to collect +more from the net as they get developed. + + - rob - + diff --git a/contrib/bluegnu2.0.3/contrib/test-g++ b/contrib/bluegnu2.0.3/contrib/test-g++ new file mode 100755 index 0000000..3b90e6a --- /dev/null +++ b/contrib/bluegnu2.0.3/contrib/test-g++ @@ -0,0 +1,84 @@ +#!/bin/sh + +# Default DEVOSRCDIR +if [ "$DEVOSRCDIR" = "" ]; then + DEVOSRCDIR=$HOME/devo ; export DEVOSRCDIR +fi + +# Check DEVOSRCDIR +if [ ! -d "$DEVOSRCDIR" ]; then + echo "$0: no directory $DEVOSRCDIR" >&2 + exit 2 +fi + +# Default DEVOBINDIR +if [ "$DEVOBINDIR" = "" ]; then + CPU=`$DEVOSRCDIR/config.guess` + if [ $? != 0 ]; then + echo "$0: cannot run config.guess" >&2 + exit 2 + fi + DEVOBINDIR=$HOME/$CPU ; export DEVOBINDIR +fi + +# Check DEVOBINDIR +if [ ! -d "$DEVOBINDIR" ]; then + echo "$0: no directory $DEVOBINDIR" >&2 + exit 2 +fi + +# Default LOGDIR +if [ "$LOGDIR" = "" ]; then + LOGDIR=$HOME/logs ; export LOGDIR +fi + +# Check LOGDIR +if [ ! -d "$LOGDIR" ]; then + echo "$0: no directory $LOGDIR" >&2 + exit 2 +fi + +cd $LOGDIR || exit 2 + +sum=g++-`date '+%y%m%d'` + +$DEVOSRCDIR/dejagnu/contrib/test-tool g++ > $sum 2>&1 +status=$? + +cd $DEVOBINDIR/libg++ +make check >/tmp/clgpp$$ 2>&1 +if [ $? != 0 ]; then + cd $LOGDIR + echo "" >> $sum + echo "libg++ fails to make check:" >> $sum + tail -20 /tmp/clgpp$$ >> $sum + if [ $status = 0 ]; then + status=1 + fi +fi + +cd $DEVOBINDIR/libio +make check >/tmp/clgpp$$ 2>&1 +if [ $? != 0 ]; then + cd $LOGDIR + echo "" >> $sum + echo "libio fails to make check:" >> $sum + tail -20 /tmp/clgpp$$ >> $sum + if [ $status = 0 ]; then + status=1 + fi +fi + +cd $DEVOBINDIR/libstdc++ +make check >/tmp/clgpp$$ 2>&1 +if [ $? != 0 ]; then + cd $LOGDIR + echo "" >> $sum + echo "libstdc++ fails to make check:" >> $sum + tail -20 /tmp/clgpp$$ >> $sum + if [ $status = 0 ]; then + status=1 + fi +fi + +exit $status diff --git a/contrib/bluegnu2.0.3/contrib/test-tool b/contrib/bluegnu2.0.3/contrib/test-tool new file mode 100755 index 0000000..6b79352 --- /dev/null +++ b/contrib/bluegnu2.0.3/contrib/test-tool @@ -0,0 +1,346 @@ +#!/bin/sh +# This script automatically test the given tool with the tool's test cases, +# reporting anything of interest. + +# exits with 1 if there is nothing of interest +# exits with 0 if there is something interesting +# exits with 2 if an error occurred + +# Syntax: test-tool [-expectedpass] [-keepoutput] [-noupdate] g++|gcc|gdb|... +# +# -expectedpass: Turn XFAIL into "pass", XPASS into "fail". +# The default is XFAIL->fail, XPASS->pass. +# -keepoutput: Save "make check" output in test-$tool.log. +# -noupdate: Don't update log files. + +# Limitations, don't run this multiple times in one day, unless the -noupdate +# flag is given. + +# Written by Mike Stump + +expectedpass=no +keepoutput=no +update=yes +tool="" + +for arg in $* +do + case $arg in + -expectedpass) expectedpass=yes ;; + -keepoutput) keepoutput=yes ;; + -noupdate) update=no ;; + -*) + echo "Usage: [-expectedpass] [-keepoutput] [-noupdate] tool_name" >&2 + exit 2 + ;; + *) + if [ "$tool" != "" ]; then + echo "Usage: [-expectedpass] [-keepoutput] [-noupdate] tool_name" >&2 + exit 2 + fi + tool=$arg + ;; + esac +done + +# FIXME: It sure would be nice if `testdir' wasn't necessary. :-( + +if [ "$tool" = g++ ]; then + devoname=gcc + checktarget=check-g++ + testdir=. +elif [ "$tool" = gcc ]; then + devoname=gcc + checktarget=check-gcc + testdir=. +elif [ "$tool" = gdb ]; then + devoname=gdb + checktarget=check + testdir=testsuite +elif [ "$tool" = gas ]; then + devoname=gas + checktarget=check + testdir=testsuite +elif [ "$tool" = gld -o "$tool" = ld ]; then + devoname=ld + checktarget=check + testdir=. +elif [ "$tool" = binutils ]; then + devoname=binutils + checktarget=check + testdir=. +else + echo "Only gcc, g++, gdb, gas, gld, and binutils supported." >&2 + exit 2 +fi + +# Default DEVOSRCDIR +if [ "$DEVOSRCDIR" = "" ]; then + DEVOSRCDIR=$HOME/devo ; export DEVOSRCDIR +fi + +# Check DEVOSRCDIR +if [ ! -d "$DEVOSRCDIR" ]; then + echo "$0: no directory $DEVOSRCDIR" >&2 + exit 2 +fi + +# Default DEVOBINDIR +if [ "$DEVOBINDIR" = "" ]; then + CPU=`$DEVOSRCDIR/config.guess` + if [ $? != 0 ]; then + echo "$0: cannot run config.guess" >&2 + exit 2 + fi + DEVOBINDIR=$HOME/$CPU ; export DEVOBINDIR +fi + +# Check DEVOBINDIR +if [ ! -d "$DEVOBINDIR" ]; then + echo "$0: no directory $DEVOBINDIR" >&2 + exit 2 +fi + +# Specialize DEVOSRCDIR +if [ -d "$DEVOSRCDIR/$devoname" ]; then + DEVOSRCDIR=$DEVOSRCDIR/$devoname +else + echo "$0: Cannot find source directory." >&2 + exit 2 +fi + +# Default LOGDIR +if [ "$LOGDIR" = "" ]; then + LOGDIR=$HOME/logs ; export LOGDIR +fi + +# Check LOGDIR +if [ ! -d "$LOGDIR" ]; then + echo "$0: no directory $LOGDIR" >&2 + exit 2 +fi + +# Specialize DEVOBINDIR +if [ -d "$DEVOBINDIR/$devoname" ]; then + DEVOBINDIR=$DEVOBINDIR/$devoname +else + echo "$0: Cannot find binary directory." >&2 + exit 2 +fi + +# Binary directory +cd $DEVOBINDIR || exit 2 + +TMPDIR=${TMPDIR-/tmp} + +tmp=$TMPDIR/$tool-testing.$$a +tmp1=$TMPDIR/$tool-testing.$$b +tmp2=$TMPDIR/$tool-testing.$$c +now_s=$TMPDIR/$tool-testing.$$d +before_s=$TMPDIR/$tool-testing.$$e + +if [ "$keepoutput" = yes ]; then + rm -f test-$tool.log + make RUNTESTFLAGS="-v -v" $checktarget >test-$tool.log 2>&1 +else + make RUNTESTFLAGS="-v -v" $checktarget >/dev/null 2>&1 +fi + +# Check for DEJAGNU errors that prevented any output at all. +if [ ! -f $testdir/$tool.sum ]; then + echo "Tests didn't run, probably because of a framework error." + if [ "$keepoutput" = yes ]; then + echo + tail -20 test-$tool.log + else + echo "Unable to determine why. Rerun with -keepoutput." + fi + exit 2 +fi + +# Canonicalize XFAIL and XPASS so the rest of the script can ignore them. +if [ "$expectedpass" = yes ]; then + sed 's/^XFAIL/PASS(XFAIL)/; s/^XPASS/FAIL(XPASS)/' <$testdir/$tool.sum >$testdir/$tool.1.sum || exit 2 +else + sed 's/^XFAIL/FAIL(XFAIL)/; s/^XPASS/PASS(XPASS)/' <$testdir/$tool.sum >$testdir/$tool.1.sum || exit 2 +fi +mv $testdir/$tool.1.sum $testdir/$tool.sum + +todayname=`date '+%y%m%d'` +if [ "$update" = no ]; then + now=$testdir/$tool.sum + before=`ls $LOGDIR/$tool-??????.sum | tail -1` +else + mv -f $testdir/$tool.sum $LOGDIR/$tool-$todayname.sum || exit 2 + mv -f $testdir/$tool.log $LOGDIR/$tool-$todayname.log || exit 2 + + now=`ls $LOGDIR/$tool-??????.sum | tail -1` + before=`ls $LOGDIR/$tool-??????.sum | tail -2 | sed 1q` +fi +trap "rm -f $tmp $tmp1 $tmp2 $now_s $before_s" 0 1 2 3 5 9 13 15 + +if [ "$before" = "" ]; then + echo "Need previous summary to compare against." >&2 + exit 2 +fi + +# Say where the logs are stored so they appear in email messages. +echo +echo "Log files: $LOGDIR/$tool-$todayname.*" +echo + +grep '^[PFU][A-Z()]*:' | sort -t ':' +1 "$now" > "$now_s" +grep '^[PFU][A-Z()]*:' | sort -t ':' +1 "$before" > "$before_s" + +grep '^FAIL:' "$now_s" | sed 's/^[^:]*:[ ]*//' >$tmp1 +grep '^PASS' "$before_s" | sed 's/^[^:]*:[ ]*//' | comm -12 $tmp1 - >$tmp2 + +grep -s . $tmp2 >/dev/null +if [ $? = 0 ]; then + echo "Tests that now unexpectedly fail, but worked before:" + echo + cat $tmp2 + showchangelog=1 + echo +fi + +grep '^PASS' "$now_s" | sed 's/^[^:]*:[ ]*//' >$tmp1 +grep '^FAIL' "$before_s" | sed 's/^[^:]*:[ ]*//' | comm -12 $tmp1 - >$tmp2 + +grep -s . $tmp2 >/dev/null +if [ $? = 0 ]; then + echo "Tests that now work, but didn't before:" + echo + cat $tmp2 + echo +fi + +grep '^FAIL:' "$now_s" | sed 's/^[^:]*:[ ]*//' >$tmp1 +grep '^[PFU][A-Z()]*:' "$before_s" | sed 's/^[^:]*:[ ]*//' | comm -23 $tmp1 - >$tmp2 + +grep -s . $tmp2 >/dev/null +if [ $? = 0 ]; then + echo "New tests that unexpectedly FAIL:" + echo + cat $tmp2 + echo +fi + +grep '^PASS' "$now_s" | sed 's/^[^:]*:[ ]*//' >$tmp1 +grep '^[PFU][A-Z()]*:' "$before_s" | sed 's/^[^:]*:[ ]*//' | comm -23 $tmp1 - >$tmp2 + +grep -s . $tmp2 >/dev/null +if [ $? = 0 ]; then + echo "New tests that PASS:" + echo + cat $tmp2 + echo +fi + +grep '^[PFU][A-Z()]*:' "$now_s" | sed 's/^[^:]*:[ ]*//' >$tmp1 +grep '^PASS' "$before_s" | sed 's/^[^:]*:[ ]*//' | comm -13 $tmp1 - >$tmp2 + +grep -s . $tmp2 >/dev/null +if [ $? = 0 ]; then + echo "Old tests that passed, that have disappeared: (Eeek!)" + echo + cat $tmp2 + echo +fi + +grep '^[PFU][A-Z()]*:' "$now_s" | sed 's/^[^:]*:[ ]*//' >$tmp1 +grep '^FAIL' "$before_s" | sed 's/^[^:]*:[ ]*//' | comm -13 $tmp1 - >$tmp2 + +grep -s . $tmp2 >/dev/null +if [ $? = 0 ]; then + echo "Old tests that failed, that have disappeared: (Eeek!)" + echo + cat $tmp2 + echo +fi + +grep '^FAIL:' "$now_s" | sed 's/^[^:]*:[ ]*//' >$tmp1 +grep '^FAIL' "$before_s" | sed 's/^[^:]*:[ ]*//' | comm -12 $tmp1 - >$tmp2 + +grep -s . $tmp2 >/dev/null +if [ $? = 0 ]; then + echo "Tests that still don't work:" + echo + cat $tmp2 + echo +fi + +egrep '^(ERROR|WARNING):' "$now" >$tmp1 + +if grep -s . $tmp1 > /dev/null; then + echo "Errors and warnings:" + echo + cat $tmp1 + echo +fi + +if [ "$tool" = g++ ]; then + if [ -f $DEVOBINDIR/libio/run-make-check ]; then + cd $DEVOBINDIR/libio + make check >$TMPDIR/clgpp$$ 2>&1 + if [ $? != 0 ]; then + echo + echo "libio fails to make check:" + tail -20 $TMPDIR/clgpp$$ + fi + fi + if [ -f $DEVOBINDIR/libstdc++/run-make-check ]; then + cd $DEVOBINDIR/libstdc++ + make check >$TMPDIR/clgpp$$ 2>&1 + if [ $? != 0 ]; then + echo + echo "libstdc++ fails to make check:" + tail -20 $TMPDIR/clgpp$$ + fi + fi + if [ -f $DEVOBINDIR/libg++/run-make-check ]; then + cd $DEVOBINDIR/libg++ + make check >$TMPDIR/clgpp$$ 2>&1 + if [ $? != 0 ]; then + echo + echo "libg++ fails to make check:" + tail -20 $TMPDIR/clgpp$$ + fi + fi + rm -f $TMPDIR/clgpp$$ + cd $DEVOBINDIR +fi + +if [ "$devoname" != "" ]; then + if [ "$showchangelog" = 1 ]; then + echo "Here is what's new in the ChangeLog:" + echo + diff -c $LOGDIR/$devoname.ChangeLog $DEVOSRCDIR/ChangeLog + echo + if [ "$tool" = g++ ]; then + echo "Here is what's new in the cp/ChangeLog:" + echo + diff -c $LOGDIR/g++.ChangeLog $DEVOSRCDIR/cp/ChangeLog + fi + echo + fi + if [ "$update" != no ]; then + # save the old ChangeLog as a reference for next time + rm -f $LOGDIR/$devoname.ChangeLog.BAK + mv $LOGDIR/$devoname.ChangeLog $LOGDIR/$devoname.ChangeLog.BAK 2>/dev/null + cp -p $DEVOSRCDIR/ChangeLog $LOGDIR/$devoname.ChangeLog + if [ "$tool" = g++ ]; then + rm -f $LOGDIR/g++.ChangeLog.BAK + mv $LOGDIR/g++.ChangeLog $LOGDIR/g++.ChangeLog.BAK 2>/dev/null + cp -p $DEVOSRCDIR/cp/ChangeLog $LOGDIR/g++.ChangeLog + fi + fi +fi + +diff $before $now | grep -s . >/dev/null +if [ $? = 0 ]; then + echo "Details:" + echo + diff $before $now + echo +fi diff --git a/contrib/bluegnu2.0.3/contrib/testit b/contrib/bluegnu2.0.3/contrib/testit new file mode 100755 index 0000000..e866aa6 --- /dev/null +++ b/contrib/bluegnu2.0.3/contrib/testit @@ -0,0 +1,1149 @@ +#!/usr/latest/bin/wish -f +# Program: testit +# Tcl version: 7.2 (Tcl/Tk/XF) +# Tk version: 3.5 +# XF version: 2.2 +# + + +# procedure to show window . +proc ShowWindow. {args} {# xf ignore me 7 + + # Window manager configurations + global tkVersion + wm positionfrom . user + wm sizefrom . "" + wm maxsize . 1152 900 + wm title . {xf} + + # bindings + bind . {MenuPopupPost .frame0.menubutton3.m.menu4 %X %Y} + bind . {MenuPopupRelease .frame0.menubutton3.m.menu4 %W} + + # build widget .frame0 + frame .frame0 \ + -background {white} \ + -borderwidth {2} \ + -relief {raised} + + # build widget .frame0.menubutton0 + menubutton .frame0.menubutton0 \ + -background {white} \ + -foreground {black} \ + -menu {.frame0.menubutton0.m} \ + -text {Summaries} + + # build widget .frame0.menubutton0.m + menu .frame0.menubutton0.m \ + -background {white} \ + -foreground {black} + .frame0.menubutton0.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/gcc.sum + +} \ + -label {Gcc} + .frame0.menubutton0.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/g++.sum + +} \ + -label {G++} + .frame0.menubutton0.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/gdb.sum + +} \ + -label {Gdb} + .frame0.menubutton0.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/gas.sum + +} \ + -label {Gas} + .frame0.menubutton0.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/binutils.sum + +} \ + -label {Binutils} + .frame0.menubutton0.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/runtest.sum + +} \ + -label {Runtest} + .frame0.menubutton0.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/tcl.sum + +} \ + -label {Tcl} + .frame0.menubutton0.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/expect.sum + +} \ + -label {Expect} + .frame0.menubutton0.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/libg++.sum + +} \ + -label {Libg++} + .frame0.menubutton0.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/libio.sum + +} \ + -label {Libio} + .frame0.menubutton0.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/libm.sum + +} \ + -label {Libm} + + # build widget .frame0.menubutton1 + menubutton .frame0.menubutton1 \ + -background {white} \ + -foreground {black} \ + -menu {.frame0.menubutton1.m} \ + -text {Misc} + + # build widget .frame0.menubutton1.m + menu .frame0.menubutton1.m \ + -background {white} \ + -foreground {black} + .frame0.menubutton1.m add command \ + -command {EndSrc +destroy .} \ + -label {Exit} + .frame0.menubutton1.m add command \ + -command {.frame6.frame.text2 delete 0.0 end} \ + -label {Clear window} + .frame0.menubutton1.m add command \ + -command {dialogbox} \ + -label {Editor} + .frame0.menubutton1.m add command \ + -command {.frame6.frame.text2 insert 0.0 "Top of tree is $testbase\n"} \ + -label {Show filename} + + # build widget .frame0.menubutton3 + menubutton .frame0.menubutton3 \ + -background {white} \ + -foreground {black} \ + -menu {.frame0.menubutton3.m} \ + -text {Host} + + # build widget .frame0.menubutton3.m + menu .frame0.menubutton3.m \ + -background {white} \ + -foreground {black} + .frame0.menubutton3.m add command \ + -command {set host "alpha-dec-osf1.3"} \ + -label {alpha-dec-osf1.3} + .frame0.menubutton3.m add command \ + -command {set host "hppa1.1-hp-hpux"} \ + -label {hppa1.1-hp-hpux} + .frame0.menubutton3.m add command \ + -command {set host "i386-unknown-sysv4.2"} \ + -label {i386-unknown-sysv4.2} + .frame0.menubutton3.m add command \ + -command {set host "m68k-hp-hpux"} \ + -label {m68k-hp-hpux} + .frame0.menubutton3.m add command \ + -command {set host "m68k-sun-sunos4.1.1"} \ + -label {m68k-sun-sunos4.1.1} + .frame0.menubutton3.m add command \ + -command {set host "mips-dec-ultrix4.2"} \ + -label {mips-dec-ultrix4.2} + .frame0.menubutton3.m add command \ + -command {set host "mips-sgi-irix4.0.5H"} \ + -label {mips-sgi-irix4.0.5H} + .frame0.menubutton3.m add command \ + -command {set host "rs6000-ibm-aix3.2"} \ + -label {rs6000-ibm-aix3.2} + .frame0.menubutton3.m add command \ + -command {set host "sparc-sun-solaris2.3"} \ + -label {sparc-sun-solaris2.3} + .frame0.menubutton3.m add command \ + -command {set host "sparc-sun-sunos4.1.3"} \ + -label {sparc-sun-sunos4.1.3} + + # build widget .frame0.menubutton2 + menubutton .frame0.menubutton2 \ + -background {white} \ + -foreground {black} \ + -menu {.frame0.menubutton2.m} \ + -text {Target} + + # build widget .frame0.menubutton2.m + menu .frame0.menubutton2.m \ + -background {white} \ + -foreground {black} + .frame0.menubutton2.m add command \ + -command {set target "a29k-amd-udi"} \ + -label {a29k-amd-udi} + .frame0.menubutton2.m add command \ + -command {set target "h8300-hms"} \ + -label {h8300-hms} + .frame0.menubutton2.m add command \ + -command {set target "i386-aout"} \ + -label {i386-aout} + .frame0.menubutton2.m add command \ + -command {set target "i386-lynx"} \ + -label {i386-lynx} + .frame0.menubutton2.m add command \ + -command {set target "i960-intel-nindy"} \ + -label {i960-intel-nindy} + .frame0.menubutton2.m add command \ + -command {set target "i960-vxwork"} \ + -label {i960-vxworks} + .frame0.menubutton2.m add command \ + -command {set target "m68k-aout"} \ + -label {m68k-aout} + .frame0.menubutton2.m add command \ + -command {set target "m68k-coff"} \ + -label {m68k-coff} + .frame0.menubutton2.m add command \ + -command {set target "m68k-lynx"} \ + -label {m68k-lynx} + .frame0.menubutton2.m add command \ + -command {set target "m68k-vxworks"} \ + -label {m68k-vxworks} + .frame0.menubutton2.m add command \ + -command {set target "mips-idt-ecoff"} \ + -label {mips-idt-ecoff} + .frame0.menubutton2.m add command \ + -command {set target "sh-hms"} \ + -label {sh-hms} + .frame0.menubutton2.m add command \ + -command {set target "sparc-aout"} \ + -label {sparc-aout} + .frame0.menubutton2.m add command \ + -command {set target "sparc-sun-sunos4.1.3"} \ + -label {sparc-sun-sunos4.1.3} + .frame0.menubutton2.m add command \ + -command {set target "sparc-vxworks"} \ + -label {sparc-vxworks} + .frame0.menubutton2.m add command \ + -command {set target "sparclite-aout"} \ + -label {sparclite-aout} + .frame0.menubutton2.m add command \ + -command {set target "sparclite-coff"} \ + -label {sparclite-coff} + .frame0.menubutton2.m add command \ + -command {set target "hppa1.1-hp-hpux"} \ + -label {hppa1.1-hp-hpux} + .frame0.menubutton2.m add command \ + -command {set target "i386-unknown-sysv4.2"} \ + -label {i386-unknown-sysv4.2} + .frame0.menubutton2.m add command \ + -command {set target "m68k-hp-hpux"} \ + -label {m68k-hp-hpux} + .frame0.menubutton2.m add command \ + -command {set target "m68k-sun-sunos4.1.1"} \ + -label {m68k-sun-sunos4.1.1} + .frame0.menubutton2.m add command \ + -command {set target "mips-dec-ultrix4.2"} \ + -label {mips-dec-ultrix4.2} + .frame0.menubutton2.m add command \ + -command {set target "mips-sgi-irix4.0.5H"} \ + -label {mips-sgi-irix4.0.5H} + .frame0.menubutton2.m add command \ + -command {set target "rs6000-ibm-aix3.2"} \ + -label {rs6000-ibm-aix3.2} + .frame0.menubutton2.m add command \ + -command {set target "sparc-sun-solaris2.3"} \ + -label {sparc-sun-solaris2.3} + + # build widget .frame0.menubutton9 + menubutton .frame0.menubutton9 \ + -background {white} \ + -foreground {black} \ + -menu {.frame0.menubutton9.m} \ + -text {Results} + + # build widget .frame0.menubutton9.m + menu .frame0.menubutton9.m \ + -background {white} \ + -foreground {black} + .frame0.menubutton9.m add command \ + -command {getresult $testbase/objdir/$host/$target/logs/gcc + +} \ + -label {Gcc} + .frame0.menubutton9.m add command \ + -command {getresult $testbase/objdir/$host/$target/logs/g++ + +} \ + -label {G++} + .frame0.menubutton9.m add command \ + -command {getresult $testbase/objdir/$host/$target/logs/gdb + +} \ + -label {Gdb} + .frame0.menubutton9.m add command \ + -command {getresult $testbase/objdir/$host/$target/logs/gas + +} \ + -label {Gas} + .frame0.menubutton9.m add command \ + -command {getresult $testbase/objdir/$host/$target/logs/binutils + +} \ + -label {Binutils} + .frame0.menubutton9.m add command \ + -command {getresult $testbase/objdir/$host/$target/logs/runtest +} \ + -label {Runtest} + .frame0.menubutton9.m add command \ + -command {getresult $testbase/objdir/$host/$target/logs/tcl + +} \ + -label {Tcl} + .frame0.menubutton9.m add command \ + -command {getresult $testbase/objdir/$host/$target/logs/expect + +} \ + -label {Expect} + .frame0.menubutton9.m add command \ + -command {getresult $testbase/objdir/$host/$target/logs/libg++ + +} \ + -label {Libg++} + .frame0.menubutton9.m add command \ + -command {getresult $testbase/objdir/$host/$target/logs/libio +} \ + -label {Libio} + .frame0.menubutton9.m add command \ + -command {getresult $testbase/objdir/$host/$target/logs/libm + +} \ + -label {Libm} + + # build widget .frame0.menubutton10 + menubutton .frame0.menubutton10 \ + -background {white} \ + -foreground {black} \ + -menu {.frame0.menubutton10.m} \ + -text {Logs} + + # build widget .frame0.menubutton10.m + menu .frame0.menubutton10.m \ + -background {white} \ + -foreground {black} + .frame0.menubutton10.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/gcc.log + +} \ + -label {Gcc} + .frame0.menubutton10.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/g++.log + +} \ + -label {G++} + .frame0.menubutton10.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/gdb.log + +} \ + -label {Gdb} + .frame0.menubutton10.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/gas.log + +} \ + -label {Gas} + .frame0.menubutton10.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/binutils.log + +} \ + -label {Binutils} + .frame0.menubutton10.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/runtest.log + +} \ + -label {Runtest} + .frame0.menubutton10.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/tcl.log + +} \ + -label {Tcl} + .frame0.menubutton10.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/expect.log + +} \ + -label {Expect} + .frame0.menubutton10.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/libg++.log + +} \ + -label {Libg++} + .frame0.menubutton10.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/libio.log + +} \ + -label {Libio} + .frame0.menubutton10.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/libm.log + +} \ + -label {Libm} + + # pack widget .frame0 + pack append .frame0 \ + .frame0.menubutton0 {left frame center} \ + .frame0.menubutton1 {right frame center} \ + .frame0.menubutton3 {left frame center} \ + .frame0.menubutton2 {left frame center} \ + .frame0.menubutton9 {left frame center} \ + .frame0.menubutton10 {left frame center} + + # build widget .frame1 + frame .frame1 \ + -background {white} \ + -borderwidth {2} \ + -relief {raised} + + # build widget .frame1.message3 + message .frame1.message3 \ + -aspect {1500} \ + -background {white} \ + -borderwidth {0} \ + -foreground {black} \ + -padx {5} \ + -pady {2} \ + -relief {raised} \ + -text {sparc-sun-sunos4.1.3} \ + -textvariable {host} + + # build widget .frame1.message4 + message .frame1.message4 \ + -aspect {1500} \ + -background {white} \ + -borderwidth {0} \ + -foreground {black} \ + -padx {5} \ + -pady {2} \ + -relief {raised} \ + -text {sparc-sun-sunos4.1.3} \ + -textvariable {target} + + # pack widget .frame1 + pack append .frame1 \ + .frame1.message3 {left frame center} \ + .frame1.message4 {right frame center} + + # build widget .frame6 + frame .frame6 \ + -background {white} \ + -borderwidth {2} \ + -relief {raised} + + # build widget .frame6.frame + frame .frame6.frame \ + -background {white} \ + -relief {raised} + + # build widget .frame6.frame.scrollbar1 + scrollbar .frame6.frame.scrollbar1 \ + -background {white} \ + -command {.frame6.frame.text2 yview} \ + -foreground {black} \ + -relief {raised} + + # build widget .frame6.frame.text2 + text .frame6.frame.text2 \ + -background {white} \ + -borderwidth {2} \ + -foreground {black} \ + -relief {raised} \ + -wrap {word} \ + -yscrollcommand {.frame6.frame.scrollbar1 set} + + # pack widget .frame6.frame + pack append .frame6.frame \ + .frame6.frame.scrollbar1 {left frame center filly} \ + .frame6.frame.text2 {top frame center expand fill} + + # pack widget .frame6 + pack append .frame6 \ + .frame6.frame {top frame center fill} + + # pack widget . + pack append . \ + .frame0 {top frame center fillx} \ + .frame1 {bottom frame center fillx} \ + .frame6 {top frame center expand fill} + + .frame6.frame.text2 insert end {} + + + + if {"[info procs XFEdit]" != ""} { + catch "XFMiscBindWidgetTree ." + after 2 "catch {XFEditSetShowWindows}" + } +} + + +# Procedure: Alias +if {"[info procs Alias]" == ""} { +proc Alias { args} { +# xf ignore me 7 +########## +# Procedure: Alias +# Description: establish an alias for a procedure +# Arguments: args - no argument means that a list of all aliases +# is returned. Otherwise the first parameter is +# the alias name, and the second parameter is +# the procedure that is aliased. +# Returns: nothing, the command that is bound to the alias or a +# list of all aliases - command pairs. +# Sideeffects: internalAliasList is updated, and the alias +# proc is inserted +########## + global internalAliasList + + if {[llength $args] == 0} { + return $internalAliasList + } { + if {[llength $args] == 1} { + set xfTmpIndex [lsearch $internalAliasList "[lindex $args 0] *"] + if {$xfTmpIndex != -1} { + return [lindex [lindex $internalAliasList $xfTmpIndex] 1] + } + } { + if {[llength $args] == 2} { + eval "proc [lindex $args 0] {args} {#xf ignore me 4 +return \[eval \"[lindex $args 1] \$args\"\]}" + set xfTmpIndex [lsearch $internalAliasList "[lindex $args 0] *"] + if {$xfTmpIndex != -1} { + set internalAliasList [lreplace $internalAliasList $xfTmpIndex $xfTmpIndex "[lindex $args 0] [lindex $args 1]"] + } { + lappend internalAliasList "[lindex $args 0] [lindex $args 1]" + } + } { + error "Alias: wrong number or args: $args" + } + } + } +} +} + + +# Procedure: GetSelection +if {"[info procs GetSelection]" == ""} { +proc GetSelection {} { +# xf ignore me 7 +########## +# Procedure: GetSelection +# Description: get current selection +# Arguments: none +# Returns: none +# Sideeffects: none +########## + + # the save way + set xfSelection "" + catch "selection get" xfSelection + if {"$xfSelection" == "selection doesn't exist or form \"STRING\" not defined"} { + return "" + } { + return $xfSelection + } +} +} + + +# Procedure: MenuPopupAdd +if {"[info procs MenuPopupAdd]" == ""} { +proc MenuPopupAdd { xfW xfButton xfMenu {xfModifier ""} {xfCanvasTag ""}} { +# xf ignore me 7 +# the popup menu handling is from (I already gave up with popup handling :-): +# +# Copyright 1991,1992 by James Noble. +# Everyone is granted permission to copy, modify and redistribute. +# This notice must be preserved on all copies or derivates. +# +########## +# Procedure: MenuPopupAdd +# Description: attach a popup menu to widget +# Arguments: xfW - the widget +# xfButton - the button we use +# xfMenu - the menu to attach +# {xfModifier} - a optional modifier +# {xfCanvasTag} - a canvas tagOrId +# Returns: none +# Sideeffects: none +########## + global tk_popupPriv + + set tk_popupPriv($xfMenu,focus) "" + set tk_popupPriv($xfMenu,grab) "" + if {"$xfModifier" != ""} { + set press "$xfModifier-" + set motion "$xfModifier-" + set release "Any-" + } { + set press "" + set motion "" + set release "" + } + + bind $xfMenu "<${motion}B${xfButton}-Motion>" "MenuPopupMotion $xfMenu %W %X %Y" + bind $xfMenu "<${release}ButtonRelease-${xfButton}>" "MenuPopupRelease $xfMenu %W" + if {"$xfCanvasTag" == ""} { + bind $xfW "<${press}ButtonPress-${xfButton}>" "MenuPopupPost $xfMenu %X %Y" + bind $xfW "<${release}ButtonRelease-${xfButton}>" "MenuPopupRelease $xfMenu %W" + } { + $xfW bind $xfCanvasTag "<${press}ButtonPress-${xfButton}>" "MenuPopupPost $xfMenu %X %Y" + $xfW bind $xfCanvasTag "<${release}ButtonRelease-${xfButton}>" "MenuPopupRelease $xfMenu %W" + } +} +} + + +# Procedure: MenuPopupMotion +if {"[info procs MenuPopupMotion]" == ""} { +proc MenuPopupMotion { xfMenu xfW xfX xfY} { +# xf ignore me 7 +########## +# Procedure: MenuPopupMotion +# Description: handle the popup menu motion +# Arguments: xfMenu - the topmost menu +# xfW - the menu +# xfX - the root x coordinate +# xfY - the root x coordinate +# Returns: none +# Sideeffects: none +########## + global tk_popupPriv + + if {"[info commands $xfW]" != "" && [winfo ismapped $xfW] && + "[winfo class $xfW]" == "Menu" && + [info exists tk_popupPriv($xfMenu,focus)] && + "$tk_popupPriv($xfMenu,focus)" != "" && + [info exists tk_popupPriv($xfMenu,grab)] && + "$tk_popupPriv($xfMenu,grab)" != ""} { + set xfPopMinX [winfo rootx $xfW] + set xfPopMaxX [expr $xfPopMinX+[winfo width $xfW]] + if {$xfX >= $xfPopMinX && $xfX <= $xfPopMaxX} { + $xfW activate @[expr $xfY-[winfo rooty $xfW]] + if {![catch "$xfW entryconfig @[expr $xfY-[winfo rooty $xfW]] -menu" result]} { + if {"[lindex $result 4]" != ""} { + foreach binding [bind $xfMenu] { + bind [lindex $result 4] $binding [bind $xfMenu $binding] + } + } + } + } { + $xfW activate none + } + } +} +} + + +# Procedure: MenuPopupPost +if {"[info procs MenuPopupPost]" == ""} { +proc MenuPopupPost { xfMenu xfX xfY} { +# xf ignore me 7 +########## +# Procedure: MenuPopupPost +# Description: post the popup menu +# Arguments: xfMenu - the menu +# xfX - the root x coordinate +# xfY - the root x coordinate +# Returns: none +# Sideeffects: none +########## + global tk_popupPriv + + if {"[info commands $xfMenu]" != ""} { + if {![info exists tk_popupPriv($xfMenu,focus)]} { + set tk_popupPriv($xfMenu,focus) [focus] + } { + if {"$tk_popupPriv($xfMenu,focus)" == ""} { + set tk_popupPriv($xfMenu,focus) [focus] + } + } + set tk_popupPriv($xfMenu,grab) $xfMenu + + catch "$xfMenu activate none" + catch "$xfMenu post $xfX $xfY" + catch "focus $xfMenu" + catch "grab -global $xfMenu" + } +} +} + + +# Procedure: MenuPopupRelease +if {"[info procs MenuPopupRelease]" == ""} { +proc MenuPopupRelease { xfMenu xfW} { +# xf ignore me 7 +########## +# Procedure: MenuPopupRelease +# Description: remove the popup menu +# Arguments: xfMenu - the topmost menu widget +# xfW - the menu widget +# Returns: none +# Sideeffects: none +########## + global tk_popupPriv + global tkVersion + + if {"[info commands $xfW]" != "" && [winfo ismapped $xfW] && + "[winfo class $xfW]" == "Menu" && + [info exists tk_popupPriv($xfMenu,focus)] && + "$tk_popupPriv($xfMenu,focus)" != "" && + [info exists tk_popupPriv($xfMenu,grab)] && + "$tk_popupPriv($xfMenu,grab)" != ""} { + if {$tkVersion >= 3.0} { + catch "grab release $tk_popupPriv($xfMenu,grab)" + } { + catch "grab none" + } + catch "focus $tk_popupPriv($xfMenu,focus)" + set tk_popupPriv($xfMenu,focus) "" + set tk_popupPriv($xfMenu,grab) "" + if {"[$xfW index active]" != "none"} { + $xfW invoke active; catch "$xfMenu unpost" + } + } + catch "$xfMenu unpost" +} +} + + +# Procedure: NoFunction +if {"[info procs NoFunction]" == ""} { +proc NoFunction { args} { +# xf ignore me 7 +########## +# Procedure: NoFunction +# Description: do nothing (especially with scales and scrollbars) +# Arguments: args - a number of ignored parameters +# Returns: none +# Sideeffects: none +########## +} +} + + +# Procedure: SN +if {"[info procs SN]" == ""} { +proc SN { {xfName ""}} { +# xf ignore me 7 +########## +# Procedure: SN +# Description: map a symbolic name to the widget path +# Arguments: xfName +# Returns: the symbolic name +# Sideeffects: none +########## + + SymbolicName $xfName +} +} + + +# Procedure: SymbolicName +if {"[info procs SymbolicName]" == ""} { +proc SymbolicName { {xfName ""}} { +# xf ignore me 7 +########## +# Procedure: SymbolicName +# Description: map a symbolic name to the widget path +# Arguments: xfName +# Returns: the symbolic name +# Sideeffects: none +########## + + global symbolicName + + if {"$xfName" != ""} { + set xfArrayName "" + append xfArrayName symbolicName ( $xfName ) + if {![catch "set \"$xfArrayName\"" xfValue]} { + return $xfValue + } { + if {"[info commands XFProcError]" != ""} { + XFProcError "Unknown symbolic name:\n$xfName" + } { + puts stderr "XF error: unknown symbolic name:\n$xfName" + } + } + } + return "" +} +} + + +# Procedure: Unalias +if {"[info procs Unalias]" == ""} { +proc Unalias { aliasName} { +# xf ignore me 7 +########## +# Procedure: Unalias +# Description: remove an alias for a procedure +# Arguments: aliasName - the alias name to remove +# Returns: none +# Sideeffects: internalAliasList is updated, and the alias +# proc is removed +########## + global internalAliasList + + set xfIndex [lsearch $internalAliasList "$aliasName *"] + if {$xfIndex != -1} { + rename $aliasName "" + set internalAliasList [lreplace $internalAliasList $xfIndex $xfIndex] + } +} +} + + +# Procedure: getbase +proc getbase {} { + global env + global testbase + if [info exists env(TESTBASE)] then { + set testbase $env(TESTBASE) + } else { + set testbase /lisa/test/rob + } + return $testbase +} + + +# Procedure: getresult +proc getresult { name} { +set tmp "[lsort [glob -nocomplain $name-results-??????-????]]" +set tmp [lindex $tmp [expr [llength $tmp] - 1]] +if [string match "" $tmp] then { + .frame6.frame.text2 delete 0.0 end + .frame6.frame.text2 insert 0.0 "Couldn't find results for: $name\n" + return +} else { + return [loadfile $tmp] +} +} + +# Procedure: dialogbox +proc dialogbox {} { + set w .frame6.top2 + catch {destroy $w} + catch {destroy $w.e1} + toplevel $w +# dpos $w + wm title $w "Change Editor" + wm iconname $w "Entries" + message $w.msg -font -Adobe-times-medium-r-normal--*-180* -aspect 200 \ + -text "Hey Now. Click the \"OK\" button when you've seen enough." + frame $w.frame -borderwidth 10 + button $w.ok -text OK -command "destroy $w" + pack $w.msg $w.frame $w.ok -side top -fill both + + entry $w.frame.e1 -relief sunken -textvariable editor + pack $w.frame.e1 -side top -pady 5 -fill x + bind $w.frame.e1 "destroy $w" +} + +# Procedure: loadfile +proc loadfile { name} { +if ![file exists $name] then { + .frame6.frame.text2 delete 0.0 end + .frame6.frame.text2 insert 0.0 "Couldn't find:\t$name\n" + return +} + +global editor +if [info exists editor] then { + if ![string match "" $editor] then { + catch "exec $editor $name&" tmp + if [info exists tmp] then { + .frame6.frame.text2 delete 0.0 end + .frame6.frame.text2 insert 0.0 "Editor returned $tmp\n" + } + } +} +.frame6.frame.text2 delete 0.0 end +set fd [open $name r] +while { [gets $fd line]>=0 } { +.frame6.frame.text2 insert end "$line\n" +.frame6.frame.text2 mark set insert 0.0 +} +close $fd +unset fd +} + + + +# application parsing procedure +proc XFLocalParseAppDefs {xfAppDefFile} { + global xfAppDefaults + + # basically from: Michael Moore + if {[file exists $xfAppDefFile] && + [file readable $xfAppDefFile] && + "[file type $xfAppDefFile]" == "link"} { + catch "file type $xfAppDefFile" xfType + while {"$xfType" == "link"} { + if {[catch "file readlink $xfAppDefFile" xfAppDefFile]} { + return + } + catch "file type $xfAppDefFile" xfType + } + } + if {!("$xfAppDefFile" != "" && + [file exists $xfAppDefFile] && + [file readable $xfAppDefFile] && + "[file type $xfAppDefFile]" == "file")} { + return + } + if {![catch "open $xfAppDefFile r" xfResult]} { + set xfAppFileContents [read $xfResult] + close $xfResult + foreach line [split $xfAppFileContents "\n"] { + # backup indicates how far to backup. It applies to the + # situation where a resource name ends in . and when it + # ends in *. In the second case you want to keep the * + # in the widget name for pattern matching, but you want + # to get rid of the . if it is the end of the name. + set backup -2 + set line [string trim $line] + if {[string index $line 0] == "#" || "$line" == ""} { + # skip comments and empty lines + continue + } + set list [split $line ":"] + set resource [string trim [lindex $list 0]] + set i [string last "." $resource] + set j [string last "*" $resource] + if {$j > $i} { + set i $j + set backup -1 + } + incr i + set name [string range $resource $i end] + incr i $backup + set widname [string range $resource 0 $i] + set value [string trim [lindex $list 1]] + if {"$widname" != "" && "$widname" != "*"} { + # insert the widget and resourcename to the application + # defaults list. + if {![info exists xfAppDefaults]} { + set xfAppDefaults "" + } + lappend xfAppDefaults [list $widname [string tolower $name] $value] + } + } + } +} + +# application loading procedure +proc XFLocalLoadAppDefs {{xfClasses ""} {xfPriority "startupFile"} {xfAppDefFile ""}} { + global env + + if {"$xfAppDefFile" == ""} { + set xfFileList "" + if {[info exists env(XUSERFILESEARCHPATH)]} { + append xfFileList [split $env(XUSERFILESEARCHPATH) :] + } + if {[info exists env(XAPPLRESDIR)]} { + append xfFileList [split $env(XAPPLRESDIR) :] + } + if {[info exists env(XFILESEARCHPATH)]} { + append xfFileList [split $env(XFILESEARCHPATH) :] + } + append xfFileList " /usr/lib/X11/app-defaults" + append xfFileList " /usr/X11/lib/X11/app-defaults" + + foreach xfCounter1 $xfClasses { + foreach xfCounter2 $xfFileList { + set xfPathName $xfCounter2 + if {[regsub -all "%N" "$xfPathName" "$xfCounter1" xfResult]} { + set xfPathName $xfResult + } + if {[regsub -all "%T" "$xfPathName" "app-defaults" xfResult]} { + set xfPathName $xfResult + } + if {[regsub -all "%S" "$xfPathName" "" xfResult]} { + set xfPathName $xfResult + } + if {[regsub -all "%C" "$xfPathName" "" xfResult]} { + set xfPathName $xfResult + } + if {[file exists $xfPathName] && + [file readable $xfPathName] && + ("[file type $xfPathName]" == "file" || + "[file type $xfPathName]" == "link")} { + catch "option readfile $xfPathName $xfPriority" + if {"[info commands XFParseAppDefs]" != ""} { + XFParseAppDefs $xfPathName + } { + if {"[info commands XFLocalParseAppDefs]" != ""} { + XFLocalParseAppDefs $xfPathName + } + } + } { + if {[file exists $xfCounter2/$xfCounter1] && + [file readable $xfCounter2/$xfCounter1] && + ("[file type $xfCounter2/$xfCounter1]" == "file" || + "[file type $xfCounter2/$xfCounter1]" == "link")} { + catch "option readfile $xfCounter2/$xfCounter1 $xfPriority" + if {"[info commands XFParseAppDefs]" != ""} { + XFParseAppDefs $xfCounter2/$xfCounter1 + } { + if {"[info commands XFLocalParseAppDefs]" != ""} { + XFLocalParseAppDefs $xfCounter2/$xfCounter1 + } + } + } + } + } + } + } { + # load a specific application defaults file + if {[file exists $xfAppDefFile] && + [file readable $xfAppDefFile] && + ("[file type $xfAppDefFile]" == "file" || + "[file type $xfAppDefFile]" == "link")} { + catch "option readfile $xfAppDefFile $xfPriority" + if {"[info commands XFParseAppDefs]" != ""} { + XFParseAppDefs $xfAppDefFile + } { + if {"[info commands XFLocalParseAppDefs]" != ""} { + XFLocalParseAppDefs $xfAppDefFile + } + } + } + } +} + +# application setting procedure +proc XFLocalSetAppDefs {{xfWidgetPath "."}} { + global xfAppDefaults + + if {![info exists xfAppDefaults]} { + return + } + foreach xfCounter $xfAppDefaults { + if {"$xfCounter" == ""} { + break + } + set widname [lindex $xfCounter 0] + if {[string match $widname ${xfWidgetPath}] || + [string match "${xfWidgetPath}*" $widname]} { + set name [string tolower [lindex $xfCounter 1]] + set value [lindex $xfCounter 2] + # Now lets see how many tcl commands match the name + # pattern specified. + set widlist [info command $widname] + if {"$widlist" != ""} { + foreach widget $widlist { + # make sure this command is a widget. + if {![catch "winfo id $widget"] && + [string match "${xfWidgetPath}*" $widget]} { + catch "$widget configure -$name $value" + } + } + } + } + } +} + + + +# startup source +proc StartupSrc {args} { +global testbase +global hostlist +global targlist +global host + +set host [exec config.guess] +set target $host +} + + +# end source +proc EndSrc {} { +.frame6.frame.text2 delete 0.0 end +} + +# startup source +StartupSrc + +# initialize global variables +global {editor} +set {editor} {} +global {fsBox} +set {fsBox(activeBackground)} {} +set {fsBox(activeForeground)} {} +set {fsBox(all)} {0} +set {fsBox(background)} {} +set {fsBox(button)} {0} +set {fsBox(extensions)} {0} +set {fsBox(font)} {} +set {fsBox(foreground)} {} +set {fsBox(internalPath)} {/offsite/rob/DejaGnu/devo/dejagnu} +set {fsBox(name)} {} +set {fsBox(path)} {/offsite/rob/DejaGnu/devo/dejagnu} +set {fsBox(pattern)} {*} +set {fsBox(scrollActiveForeground)} {} +set {fsBox(scrollBackground)} {} +set {fsBox(scrollForeground)} {} +set {fsBox(scrollSide)} {left} +set {fsBox(showPixmap)} {0} +global {host} +set {host} {sparc-sun-sunos4.1.3} +global {result} +set {result} {can't read "editor": no such variable} +global {target} +set {target} {sparc-sun-sunos4.1.3} +global {testbase} +set {testbase} {/lisa/test/rob} + +# please don't modify the following +# variables. They are needed by xf. +global {autoLoadList} +set {autoLoadList(testit)} {0} +global {internalAliasList} +set {internalAliasList} {} +global {moduleList} +set {moduleList(testit)} {} +global {preloadList} +set {preloadList(xfInternal)} {} +global {symbolicName} +set {symbolicName(binutils)} {.frame0.menubutton7} +set {symbolicName(dialogbox)} {.top2} +set {symbolicName(editor)} {.top2.entry4} +set {symbolicName(g++)} {.frame0.menubutton4} +set {symbolicName(gas)} {.frame0.menubutton6} +set {symbolicName(gdb)} {.frame0.menubutton5} +set {symbolicName(host)} {.frame0.menubutton3.m} +set {symbolicName(hostlist)} {.frame0.menubutton3} +set {symbolicName(logs)} {.frame0.menubutton10} +set {symbolicName(misc)} {.frame0.menubutton1} +set {symbolicName(ok)} {.top2.button7} +set {symbolicName(results)} {.frame0.menubutton9} +set {symbolicName(root)} {.} +set {symbolicName(sum)} {.frame0.menubutton0} +set {symbolicName(targlist)} {.frame0.menubutton2} +global {xfWmSetPosition} +set {xfWmSetPosition} {} +global {xfWmSetSize} +set {xfWmSetSize} {} +global {xfAppDefToplevels} +set {xfAppDefToplevels} {} + +# display/remove toplevel windows. +ShowWindow. + +# load default bindings. +if {[info exists env(XF_BIND_FILE)] && + "[info procs XFShowHelp]" == ""} { + source $env(XF_BIND_FILE) +} + +# parse and apply application defaults. +XFLocalLoadAppDefs Testit +XFLocalSetAppDefs + +# end source +EndSrc + +# eof +# + diff --git a/contrib/bluegnu2.0.3/dejagnu b/contrib/bluegnu2.0.3/dejagnu new file mode 100755 index 0000000..db944c2 --- /dev/null +++ b/contrib/bluegnu2.0.3/dejagnu @@ -0,0 +1,93 @@ +#! /bin/sh +# +# This scripts should start a fully compatible DejaGnu runtest +# application using [incr Expect] and Classes compatible with [incr Tcl] +# +# Copyright (C) 1998 jotOmega dsc, Inc. + +# This file is part of BlueGnu. +# It asumes that the iexpect program is on your PATH +# + +# +# Get the execution path to this script +# +execpath=`echo ${0-.} | sed -e 's@/[^/]*$@@'` + +# +# get the name by which dejagnu was invoked and extract the config triplet +# +dejagnu=`echo ${0-.} | sed -e 's@^.*/@@'` +target=`echo $dejagnu | sed -e 's/-dejagnu$//'` +if [ "$target" != dejagnu ] ; then + target="--target ${target}" +else + target="" +fi + +# +# Find the right expect binary to use. If a variable EXPECT exists, +# it takes precedence over all other tests. Otherwise look for a freshly +# built one, and then use one in the path. +# +if [ x"$EXPECT" != x ] ; then + expectbin=$EXPECT +else + if [ -x "$execpath/expect" ] ; then + expectbin=$execpath/iexpect + else + expectbin=iexpect + fi +fi + +# just to be safe... +if [ -z "$expectbin" ]; then + echo "ERROR: No $expectbin shell found" + exit 1 +fi + +# +# Extract a few options from the option list. +# +verbose=0 +debug="" +for a in "$@" ; do + case $a in + -v|--v|-verb*|--verb*) verbose=`expr $verbose + 1`;; + -D0|--D0) debug="-D 0" ;; + -D1|--D1) debug="-D 1" ;; + esac +done + +if expr $verbose \> 0 > /dev/null ; then + echo Expect binary is $expectbin +fi + +# +# find dejagnu.itcl. First we look in it's installed location, otherwise +# start if from the source tree. +# +for i in $execpath/../lib/bluegnu $execpath ; do + if expr $verbose \> 1 > /dev/null ; then + echo Looking for $i/dejagnu.itcl. + fi + if [ -f $i/dejagnu.itcl ] ; then + runpath=$i + if expr $verbose \> 0 > /dev/null ; then + echo Using $i/dejagnu.itcl as main test driver + fi + fi +done +# check for an environment variable +if [ x"$BLUEGNULIBS" != x ] ; then + runpath=$BLUEGNULIBS + if expr $verbose \> 0 > /dev/null ; then + echo Using $BLUEGNULIBS/dejagnu.itcl as main test driver + fi +fi +if [ x"$runpath" = x ] ; then + echo "ERROR: dejagnu.itcl does not exist." + exit 1 +fi + +exec $expectbin $debug -- $runpath/dejagnu.itcl $target ${1+"$@"} diff --git a/contrib/bluegnu2.0.3/doc/Makefile.in b/contrib/bluegnu2.0.3/doc/Makefile.in new file mode 100644 index 0000000..67d5f40 --- /dev/null +++ b/contrib/bluegnu2.0.3/doc/Makefile.in @@ -0,0 +1,170 @@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ +srcdir = @srcdir@ + +mandir = $(prefix)/man +man1dir = $(mandir)/man1 +infodir = $(prefix)/info + +MAKEINFO = makeinfo +TEXI2DVI = TEXINPUTS=$(TEXIDIR):$(srcdir):$$TEXINPUTS texi2dvi + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = $(INSTALL) +INSTALL_DATA = $(INSTALL) + +# Where to find texinfo.tex to format docn with TeX +TEXIDIR = $(srcdir)/../../texinfo + +MANPAGES= $(srcdir)/dejagnu.1 +DEJAGNU = dejagnu.dvi dejagnu.info dejagnu.ps dejagnu.pdf +README = ../README.bluegnu notice.ps notice.pdf notice.html + +%.dvi: %.tex + latex $< +%.pdf: %.dvi + dvipdfm -o $@ $< +%.html: %.dvi + rm -fr $(basename $@) + rm -f $@ + latex2html -t "`cat $(basename $<).title`" -split 0 $(basename $<).tex + ln -s $(basename $@)/$@ + +all: + +doc: ${README} ${DEJAGNU} + +dejagnu.pdf: dejagnu.dvi + +READMEtxt.dvi: READMEtxt.tex README.tex +READMEdvi.dvi: READMEdvi.tex README.tex + +../README.bluegnu: READMEtxt.dvi + dvidoc $< >$@ + +notice.ps: READMEdvi.dvi + dvips $< -o $@ + +notice.pdf: READMEdvi.dvi + dvipdfm -o $@ $< + +notice.html: READMEdvi.dvi + rm -fr $(basename $<) + rm -f $@ + latex2html -t "`cat $(basename $<).title`" -split 0 $(basename $<).tex + cp $(basename $<)/$(basename $<).html notice.html + +###################################################################### +# DOCUMENTATION TARGETS +# TeX output +dejagnu.dvi: $(srcdir)/dejagnu.texi + $(TEXI2DVI) $(srcdir)/dejagnu.texi + +# info file for online browsing +dejagnu.info: $(srcdir)/dejagnu.texi + $(MAKEINFO) -I $(srcdir) -o dejagnu.info $(srcdir)/dejagnu.texi + +dejagnu.ps: dejagnu.dvi + dvips -f dejagnu.dvi > dejagnu.ps + +# different targets for -ms, -mm, -me +# Try to use a recent texi2roff. v2 was put on prep in jan91. +# If you want an index, see texi2roff doc for postprocessing +# and add -i to texi2roff invocations below. +# Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete +# correspondint -e lines when later texi2roff's are current) +# + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs. +# + @c's deleted explicitly because texi2roff sees texinfo commands in them +# + @ (that's at-BLANK) not recognized by texi2roff, turned into blank +# + @alphaenumerate is ridiculously new, turned into @enumerate + +# roff output (-ms) +dejagnu.ms: $(srcdir)/dejagnu.texi + sed -e '/\\input texinfo/d' \ + -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ + -e '/^@ifinfo/,/^@end ifinfo/d' \ + -e '/^@c/d' \ + -e 's/{.*,,/{/' \ + -e 's/@ / /g' \ + -e 's/^@alphaenumerate/@enumerate/g' \ + -e 's/^@end alphaenumerate/@end enumerate/g' \ + $(srcdir)/dejagnu.texi | \ + $(TEXI2ROFF) -ms | \ + sed -e 's/---/\\(em/g' >dejagnu.ms + +# roff output (-mm) +# '@noindent's removed due to texi2roff-2 mm bug; if yours is newer, +# try leaving them in +dejagnu.mm: $(srcdir)/dejagnu.texi + sed -e '/\\input texinfo/d' \ + -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ + -e '/^@ifinfo/,/^@end ifinfo/d' \ + -e '/^@c/d' \ + -e 's/{.*,,/{/' \ + -e '/@noindent/d' \ + -e 's/@ / /g' \ + -e 's/^@alphaenumerate/@enumerate/g' \ + -e 's/^@end alphaenumerate/@end enumerate/g' \ + $(srcdir)/dejagnu.texi | \ + $(TEXI2ROFF) -mm | \ + sed -e 's/---/\\(em/g' >dejagnu.mm + +# roff output (-me) +dejagnu.me: $(srcdir)/dejagnu.texi + sed -e '/\\input texinfo/d' \ + -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ + -e '/^@ifinfo/,/^@end ifinfo/d' \ + -e '/^@c/d' \ + -e 's/{.*,,/{/' \ + -e 's/@ / /g' \ + -e 's/^@alphaenumerate/@enumerate/g' \ + -e 's/^@end alphaenumerate/@end enumerate/g' \ + $(srcdir)/dejagnu.texi | \ + $(TEXI2ROFF) -me | \ + sed -e 's/---/\\(em/g' >dejagnu.me + +###################################################################### + +clean mostlyclean: + -rm -f \#* *~ core *.o a.out xgdb *.x + -rm -f core *.aux *.log + -rm -f dejagnu.cp \ + dejagnu.fn dejagnu.ky dejagnu.log dejagnu.pg dejagnu.toc \ + dejagnu.tp dejagnu.vr dejagnu.cps dejagnu.fns dejagnu.kys \ + dejagnu.pgs dejagnu.tps dejagnu.vrs + +clean-info: + -rm -rf *.info* + +distclean: clean + -rm -f Makefile config.status config.log config.cache gdbme.c + -rm -fr READMEdvi + +maintainer-clean realclean: clean clean-info + -rm -f Makefile config.status config.log config.cache gdbme.c + -rm -fr READMEdvi + -rm -f *.pdf *.ps *.html + +install: + $(srcdir)/../mkinstalldirs $(man1dir) + for i in $(MANPAGES) ; do \ + $(INSTALL_DATA) $$i \ + $(man1dir)/$(program_prefix)`echo $$i |sed -e \ + 's@^.*doc/@@'` ; \ + done + $(srcdir)/../mkinstalldirs $(bindir) $(infodir) + for i in *.info* ; do \ + $(INSTALL_DATA) $$i $(infodir)/$$i ; \ + done + +Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) config.status + @echo "Rebuilding the Makefile..." + $(SHELL) ./config.status + +configure: + @echo "Rebuilding configure..." + @cd ${srcdir}; autoconf + +config.status: $(srcdir)/configure + @echo "Rebuilding config.status..." + $(SHELL) ./config.status --recheck diff --git a/contrib/bluegnu2.0.3/doc/README.tex b/contrib/bluegnu2.0.3/doc/README.tex new file mode 100644 index 0000000..30e974a --- /dev/null +++ b/contrib/bluegnu2.0.3/doc/README.tex @@ -0,0 +1,253 @@ +%% +%% + +\begin{document} + +\title{Release Notice\\BlueGnu Testing Framework\\ +Version 2.0.3} +\author{Jan-Willem Neurdenburg\\jotOmega dsc\\ +56 Brigham Hill Road\\Grafton~MA~~01519-1135\\ +neurdenburgj@acm.org\\Tel: (508) 839-0276\\Fax: (508) 839-7267} + +\maketitle + +\section{Introduction} +BlueGnu is a framework for testing other programs. It has been created +to be compatible with DejaGnu. Its purpose is to provide a single +front end for all tests. Beyond this, BlueGnu offers several +advantages for testing: + +\begin{itemize} + +\item The flexibility and consistency of the BlueGnu framework makes it +easy to write tests for any program, with the exception of GUI +applications. + +\item BlueGnu provides a layer of abstraction, which makes all tests +(if correctly written) portable to any host or target where a program +must be tested. + +\item BlueGnu is written in [incr Tcl], which in turn is based on Tcl +(Tool Command Language). The framework comprises two parts: +\begin{enumerate} +\item the testing framework, +\item the test-suites or test-sets themselves. +\end{enumerate} + +\item BlueGnu will work with any Tcl based interpreter as long as +[incr Tcl] has been included. You can include 'expect', 'Tk', and/or +other extensions. + +\item Includes DejaGnu release 1.6 + +\end{itemize} + +\section{Requirements} +The following modules should have been installed, before you can +install and/or use BlueGnu: + +\begin{itemize} +\item Tcl release 8.0 or higher, +\item incr Tcl release 3.0 or higher. +\end{itemize} + +Any other extensions that is compatible with Tcl release 8.0 can be used +as well. + +\section{Structure and Contents of the Release} + +The root directory of the release contains the README files with +installation instructions and the files needed to build and install +this product. It also contains the executable scripts of the +BlueGnu testing framework. + +The top-level directories are listed below: + +\begin{description} +\item[lib:] the packages and procedures that make the BlueGnu and +DejaGnu testing framework. This also includes the default target +definition files. + +\item[testsets:] the BlueGnu test-suites and test examples. It contains +the following subdirectories. + +\begin{description} +\item[BlueGnu:] +test scripts to test the testing framework itself. + +\item[examples:] +test suite and test script examples. + +\item[config, lib, tools:] +currently empty, but can be used for +test-set dependent configuration files, library files, and tools. +\end{description} + +\item[config:] +currently empty. + +\item[doc:] the DejaGnu texinfo source and the documentation in +'info', 'dvi', 'ps', and 'pdf' representation, respectively +dejagnu.info*, dejagnu.dvi, dejagnu.ps, and dejagnu.pdf. A DejaGnu man +page is also available. + +It also contains +the \TeX{} version (README.tex) of this document as well as the 'dvi', 'ps' +'html', and 'pdf' representation, respectively notice.dvi, notice.ps, +notice.html, and notice.pdf. + +\item[testsuite:] contains a mixture of DejaGnu and BlueGnu test +scripts. + +\item[contrib:] contains examples how DejaGnu is used at Cygnus. + +\item[example:] contains a full DejaGnu test framework example for testing the program 'calc' which is also included. + +\end{description} + +\section{Installation and use under Unix} + +Before you can install and use BlueGnu you need to have installed the +following three packages: +\begin{itemize} +\item Tcl version 8.0.3 +\item Tk version 8.0.3 +\item incr Tcl version 3.0.1 +\end{itemize} +The source for these packages should all be located in one directory. +The subdirectory in the directory should be: +\begin{itemize} +\item tcl8.0.3 +\item tk8.0.3 +\item itcl3.0.1 +\end{itemize} + +The following examples use the command `./configure +--prefix=/tools/...`. This will install all packages in a directory +``/tools''. When you omit the ``--prefix''-switch then the +installation default will be the directory ``/usr/local''. + +\subsection{Installation of needed Packages} + +When you have not installed Tcl and the other needed extensions, then +you need to retrieve the sources from ``www.tcltk.com/itcl''. You need +to `gunzip` the files and do a `tar xf` of all these packages in one +directory, let's call this directory ``TclTk''. + +From the directory ``TclTk'', you should do the following to install +the packages: + +\begin{verbatim} +% cd tcl8.0.3/unix +% ./configure --prefix=/tools/tcl8.0.3 --enable-gcc --enable-shared +% make +% mkdir /tools/tcl8.0.3 +% make install +% cd ../../tk8.0.3/unix +% ./configure --prefix=/tools/tk8.0.3 --enable-gcc --enable-shared +% make +% mkdir /tools/tk8.0.3 +% make install +% cd ../../itcl3.0.1 +% ./configure --prefix=/tools/itcl3.0.1 --enable-gcc --enable-shared +% make +% mkdir /tools/itcl3.0.1 +% make install +\end{verbatim} + +\subsection{Installing BlueGnu} +You can now `gunzip` and `tar xf` the BlueGnu version 2.0.3 in the +directory ``TckTk''. This will create the directory +``bluegnu2.0.3''. Now do the following: + +\begin{verbatim} +% cd bluegnu2.0.3 +% ./configure --prefix=/tools/bluegnu2.0.3 +% make +% mkdir /tools/bluegnu2.0.3 +% make install +\end{verbatim} + +This will install BlueGnu in the directories: +\begin{itemize} +\item /tools/bluegnu2.0.3/bin +\item /tools/bluegnu2.0.3/lib/bluegnu +\item /tools/bluegnu2.0.3/info +\item /tools/bluegnu2.0.3/man +\end{itemize} + +\subsection{Using BlueGnu} +When you have installed [incr Tcl] and BlueGnu and you have the +respective ``bin'' directories in your PATH variable, then you can +start running some tests. You can go into the BlueGnu source directory +``bluegnu2.0.3/testsets/examples'' and run the following: + +\begin{verbatim} +% bluegnu versionTcl.itcl +% bluegnu ts_001 +% bluegnu ts_002 +% bluegnu ts_003 +\end{verbatim} + +The above test result should all be PASS. The following test will give +a result UNKNOWN, because no pass/fail instruction have been given. + +\begin{verbatim} +% bluegnu tc001 +\end{verbatim} + +The last test you can run will fail in its simple form: + +\begin{verbatim} +% bluegnu tc002 +\end{verbatim} + +But will pass if you execute the test as follows: + +\begin{verbatim} +% bluegnu tc002[English] +\end{verbatim} + +This is because the test scripts need a test case identifier to find +the correct benchmark code. + +\section{Changes} +\subsection{Version 2.0.3} +This being the first public release it is not to useful to list all +the changes. BlueGnu has been modeled after DejaGnu and is a complete +new implementation which has been tested thoroughly. When +documentation is being written more changes will be made. An example +of some of these changes as a result of this documentation effort can +be found in the test-suites ts\verb+_+001, ts\verb+_+002, and +ts\verb+_+003. The first two are not as easy to write as the +third. The test suite ts\verb+_+001 is a script implementation of the +command line: +\begin{verbatim} +% cd bluegnu2.0.3/testsets +% bluegnu examples/tc002[English=B] \ +> "examples/tc002[Dutch=B]={MSG=Hallo Wereld}" +\end{verbatim} +This may be useful for simple tests but when you want to write more +complex test-suite scripts you would like some more flexibility, so two +procedures were introduced, which are shown in test-suite ts\verb+_+002. This +makes writing rather complex so the procedures have become part of +the procedures 'appendQueue', 'prependQueue', and 'runtest'. The +resulting script is shown in test-suit ts\verb+_+003. + +Changes like this will be made in the future! + +\section{Future Enhancements} +The following enhancements are being planned: +\begin{itemize} +\item Target code will be made into a class with methods 'start', +'load', 'exit', and 'version'. Instead of the current +'$<$target$>$\verb+_+start', '$<$target$>$\verb+_+load', '$<$target$>$\verb+_+exit', and +'$<$target$>$\verb+_+version', which have been taken from DejaGnu. + +\item Procedures will be created that make it easy to test WEB +application from the framework. + +\item Other enhancements will be made depending on the use of the +framework in testing different applications. +\end{itemize} +\end{document} \ No newline at end of file diff --git a/contrib/bluegnu2.0.3/doc/READMEdvi.dvi b/contrib/bluegnu2.0.3/doc/READMEdvi.dvi new file mode 100644 index 0000000..b324ab8 Binary files /dev/null and b/contrib/bluegnu2.0.3/doc/READMEdvi.dvi differ diff --git a/contrib/bluegnu2.0.3/doc/READMEdvi.tex b/contrib/bluegnu2.0.3/doc/READMEdvi.tex new file mode 100644 index 0000000..ee2e991 --- /dev/null +++ b/contrib/bluegnu2.0.3/doc/READMEdvi.tex @@ -0,0 +1,5 @@ +%% +%% + +\documentclass[12pt]{article} +\input{README} diff --git a/contrib/bluegnu2.0.3/doc/READMEdvi.title b/contrib/bluegnu2.0.3/doc/READMEdvi.title new file mode 100644 index 0000000..9f7f47d --- /dev/null +++ b/contrib/bluegnu2.0.3/doc/READMEdvi.title @@ -0,0 +1 @@ +BlueGnu Release Notice diff --git a/contrib/bluegnu2.0.3/doc/READMEtxt.dvi b/contrib/bluegnu2.0.3/doc/READMEtxt.dvi new file mode 100644 index 0000000..182a260 Binary files /dev/null and b/contrib/bluegnu2.0.3/doc/READMEtxt.dvi differ diff --git a/contrib/bluegnu2.0.3/doc/READMEtxt.tex b/contrib/bluegnu2.0.3/doc/READMEtxt.tex new file mode 100644 index 0000000..0c9afdb --- /dev/null +++ b/contrib/bluegnu2.0.3/doc/READMEtxt.tex @@ -0,0 +1,6 @@ +%% +%% + +\documentclass[10pt]{dvidoc} +\input{README} + diff --git a/contrib/bluegnu2.0.3/doc/configure b/contrib/bluegnu2.0.3/doc/configure new file mode 100755 index 0000000..7248143 --- /dev/null +++ b/contrib/bluegnu2.0.3/doc/configure @@ -0,0 +1,657 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.4 +# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE + +# Initialize some other variables. +subdirs= + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -build | --build | --buil | --bui | --bu | --b) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=PREFIX install architecture-dependent files in PREFIX + [same as prefix] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +--enable and --with options recognized:$ac_help +EOF + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.4" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set LANG and LC_ALL to C if already set. +# These must not be set unconditionally because not all systems understand +# e.g. LANG=C (notably SCO). +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LANG+set}" = set; then LANG=C; export LANG; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=dejagnu.texi + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5 2>&5' +ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5 2>&5' + +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + for ac_prog in ginstall installbsd scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + # OSF/1 installbsd also uses dspmsg, but is usable. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_ifs" + # As a last resort, use the slow shell script. + test -z "$ac_cv_path_install" && ac_cv_path_install="$ac_install_sh" +fi + INSTALL="$ac_cv_path_install" +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \ + >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.4" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 + +# Protect against being on the right side of a sed subst in config.status. +sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\\\&%]/\\\\&/g; + s/@@/%@/; s/@@/@%/; s/@g$/%g/' > conftest.subs <<\CEOF +$ac_vpsub +$extrasub +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_DATA@%$INSTALL_DATA%g + +CEOF +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust relative srcdir, etc. for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file +fi; done +rm -f conftest.subs + + + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/contrib/bluegnu2.0.3/doc/configure.in b/contrib/bluegnu2.0.3/doc/configure.in new file mode 100644 index 0000000..9ff15e8 --- /dev/null +++ b/contrib/bluegnu2.0.3/doc/configure.in @@ -0,0 +1,4 @@ +dnl Process this file with autoconf to produce a configure script. +AC_INIT(dejagnu.texi) +AC_PROG_INSTALL +AC_OUTPUT(Makefile) diff --git a/contrib/bluegnu2.0.3/doc/dejagnu.1 b/contrib/bluegnu2.0.3/doc/dejagnu.1 new file mode 100644 index 0000000..c6e29c5 --- /dev/null +++ b/contrib/bluegnu2.0.3/doc/dejagnu.1 @@ -0,0 +1,120 @@ +.TH runtest 1 "31 Dec 1992" +.SH NAME +runtest \- the DejaGnu test driver program +.SH SYNOPSIS +.B runtest +[ options ] +.SH DESCRIPTION +.I DejaGnu +is a framework for running test suites on GNU tools. It is written in +expect, which uses TCL (Tool command language). +.B runtest +is the test driver program; use it to control what tests to run, +and variations on how to run them. + +You can find a comprehensive description of DejaGnu and \fBruntest\fR in +.I +The DejaGnu Testing Framework +or its Info version, +.BR dejagnu.info . +.SH OPTIONS +.TP +.B --all +Print all test output to screen. By default, only unexpected results are +displayed. +.TP +.BI --baud \ rate +Set the baud rate for a serial line connection. Some serial interface +programs (like \fBtip\fR) don't use this value but instead use a separate +initialization file. +.TP +.BI --connect \ type +The type of connection to use. The choices are +.BR rlogin , +.BR telnet , +.BR rsh , +.BR kermit , +.BR tip +and +.BR mondfe . +.TP +.B --debug +Turn on +.B expect +internal debugging output. All output is logged to +a file called \fBdbg.out\fR. +The output of the \fB--strace\fR also goes into this file. +.TP +.B --help +Prints out a help screen and then exits. +.TP +.BI --host \ type +The configuration string for the host. +.TP +.BI --ignore \ test1.exp\ test2.exp\ ... +Do not run the specified tests. +.TP +.BI --mail \ \'name1\ name2\ ...\' +Electronic mail addresses to receive test results. +.TP +.BI --name \ hostname +The network hostname of the target board. +.TP +.BI --objdir \ path +\fIpath\fR is a directory containing compiled test code. +.TP +.BI --outdir \ directory +The name of a directory for test log output. +.TP +.B --reboot +Reboot the target board when \fBruntest\fR initializes +(if supported). +.TP +.BI --srcdir \ path +\fIpath\fR is a directory containing test directories. +.TP +.BI --strace \ N +Turns on +.B expect +internal tracing to \fIN\fR levels deep. +.TP +.BI --target \ type +The configuration string for the target. +.TP +.BI --tool \ toolname +Specify the tool to be tested. \fItoolname\fR controls the test suite +applied, and the associated initialization module. +.TP +.B --verbose,\ -v +Turns on more debugging output from test cases and DejaGnu utility code. +Use more than once to increase output further. +.TP +.B --version,\ -V +Prints out the versions of DejaGnu, expect and Tcl. +.TP +.B -D[number] +Activate the Tcl debugger.\fBnumber\fR can be either 1 or 0. If it is +1, then the expect shell will break when it starts to run. All ^C's +drop DejaGnu back to the debugger prompt. A 0 starts DejaGnu like +normal, but a ^C drops to the debugger prompt. +.TP 0 +Any file name on the command line is assumed to be a subset +of the test names to run. Usually these are the names of the +expect test driver, ie... special.exp. + +Makefile style variables are used to specify tool names and their +flags; these and other configuration dependent values are saved in the +file \fBsite.exp\fR, created during configuration. +.SH EXIT CODES +.B runtest +sets the exit code to 1 if any of the tests failed, or +sets it to 0 if all the tests passed. +.SH SEE ALSO +.I The DejaGnu Testing Framework +.RB ( dejagnu.info ). +This is the DejaGnu manual; its source is the Texinfo file +.B +doc/dejagnu.texi +in the DejaGnu distribution. +.SH AUTHOR +Rob Savoye (rob@welcomehome.org) diff --git a/contrib/bluegnu2.0.3/doc/dejagnu.dvi b/contrib/bluegnu2.0.3/doc/dejagnu.dvi new file mode 100644 index 0000000..f8e50e5 Binary files /dev/null and b/contrib/bluegnu2.0.3/doc/dejagnu.dvi differ diff --git a/contrib/bluegnu2.0.3/doc/dejagnu.info b/contrib/bluegnu2.0.3/doc/dejagnu.info new file mode 100644 index 0000000..c890e65 --- /dev/null +++ b/contrib/bluegnu2.0.3/doc/dejagnu.info @@ -0,0 +1,77 @@ +This is Info file dejagnu.info, produced by Makeinfo version 1.68 from +the input file ./dejagnu.texi. + +START-INFO-DIR-ENTRY +* DejaGnu: (dejagnu). The GNU testing framework. +END-INFO-DIR-ENTRY + + Copyright (C) 92, 93, 94, 95, 1996 Free Software Foundation, Inc. + + Permission is granted to make and distribute verbatim copies of this +manual provided the copyright notice and this permission notice are +preserved on all copies. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the entire resulting derived work is distributed under the terms +of a permission notice identical to this one. + + Permission is granted to copy and distribute translations of this +manual into another language, under the above conditions for modified +versions. + + +Indirect: +dejagnu.info-1: 845 +dejagnu.info-2: 49656 +dejagnu.info-3: 98864 + +Tag Table: +(Indirect) +Node: Top845 +Node: Overview1569 +Node: What is New3526 +Node: Running Tests4893 +Node: Sample Test8001 +Node: Design Goals9824 +Node: Posix11617 +Node: Future Directions17145 +Node: Tcl and Expect17988 +Node: Invoking runtest18731 +Node: Customizing31866 +Node: Config Values34287 +Node: Master Config File40542 +Node: Local Config File44541 +Node: Personal Config File46789 +Node: Internals47575 +Node: Names49656 +Node: Init Module51171 +Node: DejaGnu Builtins55274 +Node: framework.exp56083 +Node: remote.exp65293 +Node: utils.exp69799 +Node: target.exp73522 +Node: debugger.exp76091 +Node: Target Dependent77622 +Node: Cross Targets80980 +Node: Input Files86280 +Node: Output Files87772 +Node: Summary88390 +Node: Detail90141 +Node: Debug91993 +Node: Tests95959 +Node: Writing96405 +Node: Debugging98864 +Node: Adding101241 +Node: Hints103253 +Node: Variables106051 +Node: Extending107396 +Node: Adding Tools107928 +Node: Adding Targets116563 +Node: Porting118758 +Node: Installation119227 +Node: Configuring DejaGnu119607 +Node: Installing DejaGnu121510 +Node: Index122634 + +End Tag Table diff --git a/contrib/bluegnu2.0.3/doc/dejagnu.info-1 b/contrib/bluegnu2.0.3/doc/dejagnu.info-1 new file mode 100644 index 0000000..c11c3b4 --- /dev/null +++ b/contrib/bluegnu2.0.3/doc/dejagnu.info-1 @@ -0,0 +1,1163 @@ +This is Info file dejagnu.info, produced by Makeinfo version 1.68 from +the input file ./dejagnu.texi. + +START-INFO-DIR-ENTRY +* DejaGnu: (dejagnu). The GNU testing framework. +END-INFO-DIR-ENTRY + + Copyright (C) 92, 93, 94, 95, 1996 Free Software Foundation, Inc. + + Permission is granted to make and distribute verbatim copies of this +manual provided the copyright notice and this permission notice are +preserved on all copies. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the entire resulting derived work is distributed under the terms +of a permission notice identical to this one. + + Permission is granted to copy and distribute translations of this +manual into another language, under the above conditions for modified +versions. + + +File: dejagnu.info, Node: Top, Next: Overview, Up: (dir) + +DejaGnu +******* + + DejaGnu is a framework for running test suites on software tools. + + This file describes version 1.3 of DejaGnu. + +* Menu: + +* Overview:: What is DejaGnu? +* What is New:: What is new in this release. +* Invoking runtest:: Using `runtest', the main test driver +* Customizing:: Setting `runtest' defaults +* Internals:: The DejaGnu implementation +* Tests:: How to write a test case +* Extending:: New tools, new targets, and new hosts +* Installation:: Configuring and Installing DejaGnu +* Index:: Index + + +File: dejagnu.info, Node: Overview, Next: What is New, Prev: Top, Up: Top + +What is DejaGnu? +**************** + + DejaGnu is a framework for testing other programs. Its purpose is to +provide a single front end for all tests. Beyond this, DejaGnu offers +several advantages for testing: + + 1. The flexibility and consistency of the DejaGnu framework make it + easy to write tests for any program. + + 2. DejaGnu provides a layer of abstraction which allows you to write + tests that are portable to any host or target where a program must + be tested. For instance, a test for GDB can run (from any Unix + based host) on any target architecture that DejaGnu supports. + Currently DejaGnu runs tests on several single board computers, + whose operating software ranges from just a boot monitor to a + full-fledged, Unix-like realtime OS. + + 3. All tests have the same output format. This makes it easy to + integrate testing into other software development processes. + DejaGnu's output is designed to be parsed by other filtering + script, and it is also human readable. + + DejaGnu is written in `expect', which in turn uses "Tcl"--Tool +command language. + + Running tests requires two things: the testing framework, and the +test suites themselves. Tests are usually written in `expect' using +Tcl, but you can also use a Tcl script to run a test suite that is not +based on `expect'. (`expect' script filenames conventionally use +`.exp' as a suffix; for example, the main implementation of the DejaGnu +test driver is in the file `runtest.exp'.) + +* Menu: + +* Running Tests:: A first look at running DejaGnu tests +* Sample Test:: What does a DejaGnu test case look like? +* Design Goals:: Goals behind DejaGnu +* Posix:: DejaGnu conforms to POSIX 1003.3 +* Future Directions:: Where is DejaGnu going? +* Tcl and Expect:: Reading more about Tcl and Expect + + +File: dejagnu.info, Node: What is New, Next: Invoking runtest, Prev: Overview, Up: Top + +What is new in this release ? +***************************** + + This release has a number of substantial changes over version 1.2. +The most visible change is that the version of expect and Tcl included +in the release are up-to-date with the current stable net releases. +Other changes are: + + 1. The config sub-system in DejaGnu has been completely redesigned. + It now supports testing on remote hosts as well as remote targets. + + 2. More builtin support for building target binaries with the correct + linker flags. Currently this only works with GCC, preferably with a + target support by `libgloss'. + + 3. Lots of little bug fixes from a year of heavy use here at Cygnus + Support. + + 4. DejaGnu now uses `autoconf' for configuration. + + 5. New test cases for DejaGnu have been added for the new features, + plus the "-tool" option bug in the 1.2 testsuite has been fixed. + + 6. The `--tool' option is now optional. + + 7. `runtest' when searching for test drivers ignores all directories + named SCCS, RCS, and CVS. + + 8. There is now a generic keyword based test harness that uses + comments in source code to control how each test case gets built + and run. + + 9. There is now some support for running a testsuite with multiple + passes. + + + +File: dejagnu.info, Node: Running Tests, Next: Sample Test, Up: Overview + +Running existing tests +====================== + + To run tests from an existing collection, first use `configure' as +usual to set up the source directory containing the tests. Then try +running + + make check + + If the `check' target exists, it usually saves you some trouble--for +instance, it can set up any auxiliary programs or other files needed by +the tests. + + Once you have run `make check' to build any auxiliary files, you +might want to call the test driver `runtest' directly to repeat the +tests. You may also have to call `runtest' directly for test +collections with no `check' target in the `Makefile'. + + Typically, you must use two command-line options: `--tool', to +specify which set of tests to run(1), and `--srcdir', to specify where +to find test directories. + + For example, if the directory `gdb/testsuite' contains a collection +of DejaGnu tests for GDB, you can run them like this: + + eg$ cd gdb/testsuite + eg$ runtest --tool gdb +*Test output follows, ending with:* + + === gdb Summary === + + # of expected passes 508 + # of expected failures 103 + /usr/latest/bin/gdb version 4.14.4 -nx + + You can use the option `--srcdir' to point to some other directory +containing a collection of tests: + + eg$ runtest --tool gdb --srcdir /devo/gdb/testsuite + + These examples assume a "native" configuration, where the same +computer runs both `runtest' and the tests themselves. When you have a +"cross" configuration, the tests run on a different computer, +controlled by the host running `runtest'. In this situation, you need +the option `--name' to specify the network address for the other +computer: + + eg$ runtest --tool gdb --name vx9.munist.com + + If you always use the same option values, you can record them in a +file called `site.exp', rather than typing them each time. *Note +Setting defaults for `runtest' options: Config Values. + + By default, `runtest' prints only the names of the tests it runs, +output from any tests that have unexpected results, and a summary +showing how many tests passed and how many failed. To display output +from all tests (whether or not they behave as expected), use the +`--all' option. For more verbose output about processes being run, +communication, and so on, use `--verbose'. To see even more output, use +multiple `--verbose' options. *Note Using `runtest': Invoking runtest, +for a more detailed explanation of each `runtest' option. + + Test output goes into two files in your current directory: summary +output in `TOOL.sum', and detailed output in `TOOL.log'. (TOOL refers +to the collection of tests; for example, after a run with `--tool gdb', +look for output files `gdb.sum' and `gdb.log'.) *Note The files +DejaGnu writes: Output Files. + + ---------- Footnotes ---------- + + (1) `--tool' selects a particular suite of tests, *not* the name of +the executable program to run. *Note Configuration dependent values: +Config Values, for information on the variables that you can use to +specify the names of programs to run. + + +File: dejagnu.info, Node: Sample Test, Next: Design Goals, Prev: Running Tests, Up: Overview + +What does a DejaGnu test look like? +=================================== + + Each DejaGnu test is an `expect' script; the tests vary widely in +complexity, depending on the nature of the tool and the feature tested. + + Here is a very simple GDB test--one of the simplest tests shipped +with DejaGnu (extracted from `gdb.t00/echo.exp'):(1) + + # send a string to the GDB stdin: + send "echo Hello world!\n" + + # inspect the GDB stdout for the correct reply, + # and determine whether the test passes or fails: + expect { + -re "Hello world.*$prompt $" { pass "Echo test" } + -re "$prompt $" { fail "Echo test" } + timeout { fail "(timeout) Echo test" } + } + + Though brief, this example is a complete test. It illustrates some +of the main features of DejaGnu test scripts: + + * The test case does not start the tested program (GDB in this case); + all test scripts for interactive tools can assume the + corresponding tool is running. + + * Comments start with `#'. + + * The main commands you use to control a tested program are `send' + (to give it commands) and `expect' (to analyze its responses). + + * The `expect' command uses a list of pairs; a pattern (regular + expression if `-re' specified), followed by an action to run if the + pattern matches output from the program. Only the action for the + *first* matching pattern will execute. + + * Test cases use the commands `pass' and `fail' to record the test + outcome. + + ---------- Footnotes ---------- + + (1) More recent GDB tests use the `gdb_test' procedure. An +equivalent test using that procedure is ` gdb_test "echo Hello world!" +"Hello world!" ' + + +File: dejagnu.info, Node: Design Goals, Next: Posix, Prev: Sample Test, Up: Overview + +Design goals +============ + + DejaGnu grew out of the internal needs of Cygnus Support. Cygnus +maintains and enhances a variety of free programs in many different +environments, and we needed a testing tool that: + + * is useful to developers while fixing bugs; + + * automates running many tests during a software release process; + + * is portable among a variety of host computers; + + * supports cross-development testing; + + * permits testing interactive programs, like GDB; and + + * permits testing batch oriented programs, like GCC. + + Some of the requirements proved challenging. For example, +interactive programs do not lend themselves very well to automated +testing. But all the requirements are important: for instance, it is +imperative to make sure that GDB works as well when cross-debugging as +it does in a native configuration. + + Probably the greatest challenge was testing in a cross-development +environment (which can be a real nightmare). Most cross-development +environments are customized by each developer. Even when buying +packaged boards from vendors there are many differences. The +communication interfaces vary from a serial line to ethernet. DejaGnu +was designed with a modular communication setup, so that each kind of +communication can be added as required, and supported thereafter. Once +a communication procedure is coded, any test can use it. Currently +DejaGnu can use `rsh', `rlogin', `telnet', `tip', `kermit', and +`mondfe' for remote communications. + + Julia Menapace first coined the term "Deja Gnu" to describe an +earlier testing framework at Cygnus Support. When we replaced it with +the Expect-based framework, it was like DejaGnu all over again... + + +File: dejagnu.info, Node: Posix, Next: Future Directions, Prev: Design Goals, Up: Overview + +A POSIX conforming test framework +================================= + + DejaGnu conforms to the POSIX standard for test frameworks. + + POSIX standard 1003.3 defines what a testing framework needs to +provide, in order to permit the creation of POSIX conformance test +suites. This standard is primarily oriented to running POSIX +conformance tests, but its requirements also support testing of features +not related to POSIX conformance. POSIX 1003.3 does not specify a +particular testing framework, but at this time there is only one other +POSIX conforming test framework: TET.(1) + + The POSIX documentation refers to "assertions". An assertion is a +description of behavior. For example, if a standard says "The sun +shall shine", a corresponding assertion might be "The sun is shining." +A test based on this assertion would pass or fail depending on whether +it is daytime or nighttime. It is important to note that the standard +being tested is never 1003.3; the standard being tested is some other +standard, for which the assertions were written. + + As there is no test suite to test *testing frameworks* for POSIX +1003.3 conformance, verifying conformance to this standard is done by +repeatedly reading the standard and experimenting. One of the main +things 1003.3 does specify is the set of allowed output messages, and +their definitions. Four messages are supported for a required feature +of POSIX conforming systems, and a fifth for a conditional feature. +DejaGnu supports the use of all five output messages; in this sense a +test suite that uses exactly these messages can be considered POSIX +conforming. These definitions specify the output of a test case: + +`PASS' + A test has succeeded. That is, it demonstrated that the assertion + is true. + +`XFAIL' + POSIX 1003.3 does not incorporate the notion of expected failures, + so `PASS', instead of `XPASS', must also be returned for test + cases which were expected to fail and did not. This means that + `PASS' is in some sense more ambiguous than if `XPASS' is also + used. For information on `XPASS' and `XFAIL', see *Note Using + `runtest': Invoking runtest. + +`FAIL' + A test *has* produced the bug it was intended to capture. That is, + it has demonstrated that the assertion is false. The `FAIL' + message is based on the test case only. Other messages are used to + indicate a failure of the framework. + + As with `PASS', POSIX tests must return `FAIL' rather than `XFAIL' + even if a failure was expected. + +`UNRESOLVED' + A test produced indeterminate results. Usually, this means the + test executed in an unexpected fashion; this outcome requires that + a human being go over results, to determine if the test should + have passed or failed. This message is also used for any test + that requires human intervention because it is beyond the + abilities of the testing framework. Any unresolved test should + resolved to `PASS' or `FAIL' before a test run can be considered + finished. + + Note that for POSIX, each assertion must produce a test result + code. If the test isn't actually run, it must produce `UNRESOLVED' + rather than just leaving that test out of the output. This means + that you have to be careful when writing tests, to not carelessly + use tcl statements like `return'--if you alter the flow of control + of the tcl code you must insure that every test still produces + some result code. + + Here are some of the ways a test may wind up `UNRESOLVED': + + * A test's execution is interrupted. + + * A test does not produce a clear result. This is usually + because there was an `ERROR' from DejaGnu while processing + the test, or because there were three or more `WARNING' + messages. Any `WARNING' or `ERROR' messages can invalidate + the output of the test. This usually requires a human being + to examine the output to determine what really happened--and + to improve the test case. + + * A test depends on a previous test, which fails. + + * The test was set up incorrectly. + +`UNTESTED' + A test was not run. This is a placeholder, used when there is no + real test case yet. + +The only remaining output message left is intended to test features that +are specified by the applicable POSIX standard as conditional: + +`UNSUPPORTED' + There is no support for the tested case. This may mean that a + conditional feature of an operating system, or of a compiler, is + not implemented. DejaGnu also uses this message when a testing + environment (often a "bare board" target) lacks basic support for + compiling or running the test case. For example, a test for the + system subroutine `gethostname' would never work on a target board + running only a boot monitor. + + DejaGnu uses the same output procedures to produce these messages for +all test suites, and these procedures are already known to conform to +POSIX 1003.3. For a DejaGnu test suite to conform to POSIX 1003.3, you +must avoid the `setup_xfail' procedure as described in the `PASS' +section above, and you must be careful to return `UNRESOLVED' where +appropriate, as described in the `UNRESOLVED' section above. + + ---------- Footnotes ---------- + + (1) TET was created by Unisoft for a consortium comprised of X/Open, +Unix International, and the Open Software Foundation. + + +File: dejagnu.info, Node: Future Directions, Next: Tcl and Expect, Prev: Posix, Up: Overview + +Future directions +================= + + In the near future, there are two parallel directions for DejaGnu +development. The first is to add support for more hosts and targets. + + The second would permit testing programs with a more complex +interface, whether text based or GUI based. Two components already +exist: a Tcl based X window toolkit, and a terminal package for +`expect'. Both of these could be merged into DejaGnu in a way that +permits testing programs that run in each environment. + + Meanwhile, we hope DejaGnu enables the creation of test suites for +conformance to ANSI C and C++, to POSIX, and to other standards. We +encourage you to make any test suites you create freely available, +under the same terms as DejaGnu itself. + + +File: dejagnu.info, Node: Tcl and Expect, Prev: Future Directions, Up: Overview + +Tcl and Expect +============== + + Tcl was introduced in a paper by John K. Ousterhout at the 1990 +Winter Usenix conference, `Tcl: An Embeddable Command Language'. That +paper is included in PostScript form in the `doc' subdirectory of the +Tcl distribution. The version of Tcl included in DejaGnu at this time is +Tcl 7.4p3. + + Don Libes introduced `expect' in his paper `expect: Curing Those +Uncontrollable Fits of Interaction' at the 1990 Summer Usenix +conference. The paper is included in PostScript form in the `expect' +distribution (as are several other papers about `expect'). The version +of expect included in DejaGnu at this time is expect 5.18.0. + + +File: dejagnu.info, Node: Invoking runtest, Next: Customizing, Prev: What is New, Up: Top + +Using `runtest' +*************** + + `runtest' is the executable test driver for DejaGnu. You can +specify two kinds of things on the `runtest' command line: command line +options, and Tcl variables for the test scripts. The options are +listed alphabetically below. + + `runtest' returns an exit code of `1' if any test has an unexpected +result; otherwise (if all tests pass or fail as expected) it returns +`0' as the exit code. + + `runtest' flags the outcome of each test as one of these cases. +(*Note A POSIX conforming test framework: Posix, for a discussion of +how POSIX specifies the meanings of these cases.) + +`PASS' + The most desirable outcome: the test succeeded, and was expected to + succeed. + +`XPASS' + A pleasant kind of failure: a test was expected to fail, but + succeeded. This may indicate progress; inspect the test case to + determine whether you should amend it to stop expecting failure. + +`FAIL' + A test failed, although it was expected to succeed. This may + indicate regress; inspect the test case and the failing software + to locate the bug. + +`XFAIL' + A test failed, but it was expected to fail. This result indicates + no change in a known bug. If a test fails because the operating + system where the test runs lacks some facility required by the + test, the outcome is `UNSUPPORTED' instead. + +`UNRESOLVED' + Output from a test requires manual inspection; the test suite + could not automatically determine the outcome. For example, your + tests can report this outcome is when a test does not complete as + expected. + +`UNTESTED' + A test case is not yet complete, and in particular cannot yet + produce a `PASS' or `FAIL'. You can also use this outcome in dummy + "tests" that note explicitly the absence of a real test case for a + particular property. + +`UNSUPPORTED' + A test depends on a conditionally available feature that does not + exist (in the configured testing environment). For example, you + can use this outcome to report on a test case that does not work + on a particular target because its operating system support does + not include a required subroutine. + + `runtest' may also display the following messages: + +`ERROR' + Indicates a major problem (detected by the test case itself) in + running the test. This is usually an unrecoverable error, such as + a missing file or loss of communication to the target. (POSIX + test suites should not emit this message; use `UNSUPPORTED', + `UNTESTED', or `UNRESOLVED' instead, as appropriate.) + +`WARNING' + Indicates a possible problem in running the test. Usually warnings + correspond to recoverable errors, or display an important message + about the following tests. + +`NOTE' + An informational message about the test case. + + This is the full set of command line options that `runtest' +recognizes. Arguments may be abbreviated to the shortest unique string. + + runtest --tool TOOL [ TESTSUITE.exp ... ] + [ TESTSUITE.exp="testfile1 ..." ] + [ TCLVAR=VALUE... ] + [ --all ] [ --baud BAUD-RATE ] [ --connect TYPE ] + [ --debug ] [ --help ] [ --host STRING ] + [ --mail "NAME ..." ] [ --name STRING ] + [ --name NAME ] [ --outdir PATH ] + [ --objdir PATH ] [ --reboot ] + [ --srcdir PATH ] [ --strace N ] + [ --target STRING --build STRING ] + [ -v | --verbose ] [ -V | --version ] [ --DN ] + +`--tool TOOL' + TOOL specifies what set of tests to run, and what initialization + module to use. TOOL is used *only* for these two purposes: it is + *not* used to name the executable program to test. Executable + tool names (and paths) are recorded in `site.exp' (*note + Configuration dependent values: Config Values.), and you can + override them by specifying Tcl variables on the command line. + + For example, including `--tool gcc' on the `runtest' command line + runs tests from all test subdirectories whose names match `gcc.*', + and uses one of the initialization modules named + `config/*-gcc.exp'. To specify the name of the compiler (perhaps + as an alternative path to what `runtest' would use by default), use + `GCC=BINNAME' on the `runtest' command line. + +`TESTSUITE.exp ...' + Specify the names of testsuites to run. By default, `runtest' + runs all tests for the tool, but you can restrict it to particular + testsuites by giving the names of the `.exp' `expect' scripts that + control them. + + TESTSUITE.exp may not include path information; use plain + filenames. + +`TESTFILE.exp="testfile1 ..."' + Specify a subset of tests in a suite to run. For compiler or + assembler tests, which often use a single `.exp' script covering + many different source files, this option allows you to further + restrict the tests by listing particular source files to compile. + Some tools even support wildcards here. The wildcards supported + depend upon the tool, but typically they are `?', `*', and + `[chars]'. + +`TCLVAR=VALUE' + You can define Tcl variables for use by your test scripts in the + same style used with `make' for environment variables. For + example, `runtest GDB=gdb.old' defines a variable called `GDB'; + when your scripts refer to `$GDB' in this run, they use the value + `gdb.old'. + + The default Tcl variables used for most tools are defined in the + main DejaGnu `Makefile'; their values are captured in the + `site.exp' file. *Note Configuration dependent values: Config + Values. + +`--all' + Display all test output. By default, `runtest' shows only the + output of tests that produce unexpected results; that is, tests + with status `FAIL' (unexpected failure), `XPASS' (unexpected + success), or `ERROR' (a severe error in the test case itself). + Specify `--all' to see output for tests with status `PASS' + (success, as expected) `XFAIL' (failure, as expected), or + `WARNING' (minor error in the test case itself). + +`--baud BAUD-RATE' +`-b BAUD-RATE' + Set the default baud rate to something other than 9600. (Some + serial interface programs, like `tip', use a separate + initialization file instead of this value.) + +`--connect TYPE' + Connect to a target testing environment as specified by TYPE, if + the target is not the computer running `runtest'. For example, use + `--connect' to change the program used to connect to a "bare + board" boot monitor. The choices for TYPE in the DejaGnu 1.0 + distribution are `rlogin', `telnet', `rsh', `tip', `kermit', and + `mondfe'. + + The default for this option depends on the configuration (*note + Remote targets supported: Cross Targets.). The default is chosen + to be the most convenient communication method available, but + often other alternatives work as well; you may find it useful to + try alternative connect methods if you suspect a communication + problem with your testing target. + +`--debug' + Turns on the `expect' internal debugging output. Debugging output + is displayed as part of the `runtest' output, and logged to a file + called `dbg.log'. The extra debugging output does *not* appear on + standard output, unless the verbose level is greater than 2 (for + instance, to see debug output immediately, specify `--debug -v + -v'). The debugging output shows all attempts at matching the test + output of the tool with the scripted patterns describing expected + output. The output generated with `--strace' also goes into + `dbg.log'. + +`--help' +`-he' + Prints out a short summary of the `runtest' options, then exits + (even if you also specify other options). + +`--host STRING' + STRING is a full configuration "triple" name as used by + `configure'. Use this option to override the default string + recorded by your configuration's choice of host. This choice does + not change how anything is actually configured unless -build is + also specified; it affects *only* DejaGnu procedures that compare + the host string with particular values. The procedures `ishost', + `istarget', `isnative', and `setup_xfail' are affected by + `--host'. In this usage, `host' refers to the machine that the + tests are to be run on, which may not be the same as the `build' + machine. If `--build' is also specified, then `--host' refers to + the machine that the tests wil, be run on, not the machine DejaGnu + is run on. + +`--build STRING' + STRING is a full configuration "triple" name as used by + `configure'. This is the type of machine DejaGnu and the tools to + be tested are built on. For a normal cross this is the same as the + host, but for a canadian cross, they are seperate. + +`--name NAME' + NAME is a name for the particular testing target machine (for + cross testing). If the testing target has IP network support (for + example, `RPC' or `NFS'), this is the network name for the target + itself. (NAME is *not the configuration string* you specify as a + target with `configure'; the `--name' option names a particular + target, rather than describing a class of targets.) For targets + that connect in other ways, the meaning of the NAME string depends + on the connection method. *Note Remote targets supported: Cross + Targets. + +`--name STRING' + Specify a network name of testing target or its host. The + particular names that are meaningful with `--name' will depend on + your site configuration, and on the connection protocol: for + example, `tip' connections require names from a serial line + configuration file (usually called `/etc/remote'), while `telnet' + connections use IP hostnames. + +`--objdir PATH' + Use PATH as the top directory containing any auxiliary compiled + test code. This defaults to `.'. Use this option to locate + pre-compiled test code. You can normally prepare any auxiliary + files needed with `make'. + +`--outdir PATH' + Write output logs in directory PATH. The default is `.', the + directory where you start `runtest'. This option affects only the + summary and the detailed log files `TOOL.sum' and `TOOL.log'. The + DejaGnu debug log `dbg.log' always appears (when requested) in the + local directory. + +`--reboot' + Reboot the target board when `runtest' initializes. Usually, when + running tests on a separate target board, it is safer to reboot + the target to be certain of its state. However, when developing + test scripts, rebooting takes a lot of time. + +`--srcdir PATH' + Use PATH as the top directory for test scripts to run. `runtest' + looks in this directory for any subdirectory whose name begins + with the toolname (specified with `--tool'). For instance, with + `--tool gdb', `runtest' uses tests in subdirectories `gdb.*' (with + the usual shell-like filename expansion). If you do not use + `--srcdir', `runtest' looks for test directories under the current + working directory. + +`--strace N' + Turn on internal tracing for `expect', to N levels deep. By + adjusting the level, you can control the extent to which your + output expands multi-level Tcl statements. This allows you to + ignore some levels of `case' or `if' statements. Each procedure + call or control structure counts as one "level". + + The output is recorded in the same file, `dbg.log', used for output + from `--debug'. + +`--target STRING' + Use this option to override the default setting (running native + tests). STRING is a full configuration "triple" name(1) as used + by `configure'. This option changes the configuration `runtest' + uses for the default tool names, and other setup information. + *Note Using `configure': (configure.info)Using configure, for + details about `configure' names. + +`--verbose' +`-v' + Turns on more output. Repeating this option increases the amount + of output displayed. Level one (`-v') is simply test output. Level + two (`-v -v') shows messages on options, configuration, and process + control. Verbose messages appear in the detailed (`*.log') log + file, but not in the summary (`*.sum') log file. + +`--version' +`-V' + Prints out the version numbers of DejaGnu, `expect' and Tcl, and + exits without running any tests. + +`-D0' +`-D1' + Start the internal Tcl debugger. The Tcl debugger supports + breakpoints, single stepping, and other common debugging + activities. (See `A Debugger for Tcl Applications' by Don Libes. + (2)) + + If you specify `-D1', the `expect' shell stops at a breakpoint as + soon as DejaGnu invokes it. + + If you specify `-D0', DejaGnu starts as usual, but you can enter + the debugger by sending an interrupt (e.g. by typing ). + + ---------- Footnotes ---------- + + (1) Configuration triples have the form `CPU-VENDOR-OS'. + + (2) Distributed in PostScript form with `expect' as the file +`expect/tcl-debug.ps'. + + +File: dejagnu.info, Node: Customizing, Next: Internals, Prev: Invoking runtest, Up: Top + +Setting `runtest' defaults +************************** + + The site configuration file, `site.exp', captures +configuration-dependent values and propagates them to the DejaGnu test +environment using Tcl variables. This ties the DejaGnu test scripts +into the `configure' and `make' programs. + + DejaGnu supports more than one `site.exp' file. The multiple +instances of `site.exp' are loaded in a fixed order built into DejaGnu +(the more local last). The first file loaded is the optional +`~/.dejagnurc', then the local files, and finally the global file. + + 1. There is am optional "master" `site.exp', capturing configuration + values that apply to DejaGnu across the board, in each + configuration-specific subdirectory of the DejaGnu library + directory. `runtest' loads these values first. *Note Configuring + and Installing DejaGnu: Installation. The master `site.exp' + contains the default values for all targets and hosts supported by + DejaGnu. This master file is identified by setting the environment + variable `DEJAGNU' to the name of the file. This is also refered + to as the "global" config file. + + 2. Any directory containing a configured test suite also has a + `site.exp', capturing configuration values specific to the tool + under test. Since `runtest' loads these values last, the + individual test configuration can either rely on and use, or + override, any of the global values from the "master" `site.exp'. + + You can usually generate or update the testsuite `site.exp' by + typing `make site.exp' in the test suite directory, after the test + suite is configured. + + 3. You can also have a file in your home directory called + `.dejagnurc'. This gets loaded first before the other config + files. Usually this is used for personal stuff, like setting + `all_flag' so all the output gets printed, or verbosity levels. + + You can further override the default values in a user-editable +section of any `site.exp', or by setting variables on the `runtest' +command line. + +* Menu: + +* Config Values:: Variables used in the configuration file. +* Master Config File:: The master configuration file. +* Local Config File:: The local configuration file. +* Personal Config File:: The personal configuration file. + + +File: dejagnu.info, Node: Config Values, Next: Master Config File, Up: Customizing + +Config Variables +---------------- + + DejaGnu uses a named array in Tcl to hold all the info for each +machine. In the case of a canadian cross, this means host information as +well as target information. The named array is called `target_info', +and it has two indices. The following fields are part of the array. + +`name' + The name of the target. (mostly for error messages) This should + also be the string used for this target's array. It should also + be the same as the linker script so we can find them dynamically. + This should be the same as the argument used for `push_target{}'. + +`ldflags' + This is the linker flags required to produce a fully linked + executable. For `libgloss' supported targets this is usually just + the name of the linker script. + +`config' + The target canonical for this target. This is used by some init + files to make sure the target is supported. + +`cflags' + The flags required to produce an object file from a source file. + +`connect' + This is the connectmode for this target. This is for both IP and + serial connections. Typically this is either `telnet', `rlogin', + or `rsh'. + +`target' + This is the hostname of the target. This is for TCP/IP based + connections, and is also used for version of tip that use + /etc/remote. + +`serial' + This is the serial port. This is typically /dev/tty? or com?:. + +`netport' + This is the IP port. This is commonly used for telneting to target + boards that are connected to a terminal server. In that case the + IP port specifies the which serial port to use. + +`baud' + This is the baud rate for a serial port connection. + +`x10' + This is the parameters for an x10 controller. These are simple + devices that let us power cycle or reset a target board remotely. + +`fileid' + This is the fileid or spawn id of of the connection. + +`prompt' + a glob style pattern to recognize the prompt. + +`abbrev' + abbreviation for tool init files. + +`ioport' + This is the port for I/O on dual port systems. In this + configuration, the main serial port `0' is usually used for stdin + and stdout, which the second serial port can be used for debugging. + + The first index into the array is the same value as used in the +`name' field. This is usually a short version of the name of the target +board. For an example, here's the settings I use for my `Motorola's' +`IDP' board and my `Motorola' 6U VME `MVME135-1' board. (both m68k +targets) + + # IDP board + set target_info(idp,name) "idp" + set target_info(idp,ldflags) "-Tidp.ld" + set target_info(idp,config) m68k-unknown-aout + set target_info(idp,cflags) "" + set target_info(idp,connect) telnet + set target_info(idp,target) "s7" + set target_info(idp,serial) "tstty7" + set target_info(idp,netport) "wharfrat:1007" + set target_info(idp,baud) "9600" + # MVME 135 board + set target_info(idp,name) "mvme" + set target_info(idp,ldflags) "-Tmvme.ld" + set target_info(idp,config) m68k-unknown-aout + set target_info(idp,cflags) "" + set target_info(idp,connect) telnet + set target_info(idp,target) "s8" + set target_info(idp,serial) "tstty8" + set target_info(idp,netport) "wharfrat:1008" + set target_info(idp,baud) "9600" + + DejaGnu can use this information to switch between multiple targets +in one test run. This is done through the use of the `push_target' +procedure, which is discussed elsewhere. + + This array can also hold information for a remote host, which is used +when testing a candain cross. In this case, the only thing different is +the index is just `host'. Here's the settings I use to run tests on my +NT machine while running DejaGnu on a Unix machine. (in this case a +Linux box) + + set target_info(host,name) "nt-host" + set target_info(host,config) "386-unknown-winnt" + set target_info(host,connect) "telnet" + set target_info(host,target) "ripple" + + There is more info on how to use these variables in the sections on +the config files. *Note Configuration Files: Master Config File. + + In the user editable second section of `site.exp', you can not only +override the configuration variables captured in the first section, but +also specify default values for all the `runtest' command line options. +Save for `--debug', `--help', and `--version', each command line +option has an associated Tcl variable. Use the Tcl `set' command to +specify a new default value (as for the configuration variables). The +following table describes the correspondence between command line +options and variables you can set in `site.exp'. *Note Running the +Tests: Invoking runtest, for explanations of the command-line options. + + runtest Tcl + option variable description + __________ ________ ___________________________________________ + + --all all_flag display all test results if set + + --baud baud set the default baud rate to something other + than 9600. + --connect connectmode `rlogin', `telnet', `rsh', + `kermit', `tip', or `mondfe' + + --outdir outdir directory for `TOOL.sum' and `TOOL.log' + + --objdir objdir directory for pre-compiled binaries + + --reboot reboot reboot the target if set to `"1"'; + do not reboot if set to `"0"' (the default) + + --srcdir srcdir directory of test subdirectories + + --strace tracelevel a number: Tcl trace depth + + --tool tool name of tool to test; identifies init, test subdir + + --verbose verbose verbosity level. As option, use multiple times; + as variable, set a number, 0 or greater + --target target_triplet The canonical configuration string for the target. + --host host_triplet The canonical configuration string for the host. + --build build_triplet The canonical configuration string for the + build host. + + +File: dejagnu.info, Node: Master Config File, Next: Local Config File, Prev: Config Values, Up: Customizing + +Master Config File +------------------ + + The master config file is where all the target specific config +variables get set for a whole site get set. The idea is that for a +centralized testing lab where people have to share a target between +multiple developers. There are settings for both remote targets and +remote hosts. Here's an example of a Master Config File (also called +the Global config file) for a *canadian cross*. A canadian cross is +when you build and test a cross compiler on a machine other than the +one it's to be hosted on. + + Here we have the config settings for our California office. Note that +all config values are site dependant. Here we have two sets of values +that we use for testing m68k-aout cross compilers. As both of these +target boards has a different debugging protocol, we test on both of +them in sequence. + + global CFLAGS + global CXXFLAGS + + case "$target_triplet" in { + { "native" } { + set target_abbrev unix + } + { "m68*-unknown-aout" } { + set target_abbrev "rom68k" + # IDP target # IDP board with rom68k monitor + set target_info(idp,name) "idp" + set target_info(idp,ldflags) "-Tidp.ld" + set target_info(idp,config) m68k-unknown-aout + set target_info(idp,cflags) "" + set target_info(idp,connect) telnet + set target_info(idp,target) "s7" + set target_info(idp,serial) "tstty12" + set target_info(idp,netport) "truckin:1007" + set target_info(idp,baud) "9600" + # MVME target # Motorola MVME 135 with BUG monitor + set target_info(mvme,name) "mvme" + set target_info(mvme,ldflags) "-Tmvme.ld" + set target_info(mvme,config) m68k-unknown-aout + set target_info(mvme,cflags) "" + set target_info(mvme,connect) telnet + set target_info(mvme,target) "s4" + set target_info(mvme,serial) "tstty8" + set target_info(mvme,netport) "truckin:1004" + set target_info(mvme,baud) "9600" + } + } + + In this case, we have support for several remote hosts for our +m68k-aout cross compiler. Typically the remote Unix hosts run DejaGnu +locally, but we also use them for debugging the testsuites when we find +problems in running on remote hosts. Expect won't run on NT, so DejaGnu +is run on the local build machine, and it'll connect to the NT host and +run all the tests for this cross compiler on that host. + + case "$host_triplet" in { + "native" { + } + "i?86-*-linux*" { # Linux host + set target_info(host,name) "linux-host" + set target_info(host,config) $host_triplet + set target_info(host,connect) rlogin + set target_info(host,target) chinadoll + } + "i?86-*-winnt # NT host + set target_info(host,name) "nt-host" + set target_info(host,config) i386-unknown-winnt + set target_info(host,connect) telnet + set target_info(host,target) ripple + } + "hppa*-hp-hpux*" { # HP-UX host + set target_info(host,name) "hpux-host" + set target_info(host,config) $host_triplet + set target_info(host,connect) rlogin + set target_info(host,target) slipknot + } + "sparc-sun-sunos*" { # SunOS (sun4) + set target_info(host,name) "sunos-host" + set target_info(host,config) $host_triplet + set target_info(host,connect) rlogin + set target_info(host,target) darkstar + } + } + + +File: dejagnu.info, Node: Local Config File, Next: Personal Config File, Prev: Master Config File, Up: Customizing + +Local Config File +----------------- + + It is usually more convenient to keep these "manual overrides" in the +`site.exp' local to each test directory, rather than in the "master" +`site.exp' in the DejaGnu library. + + All local `site.exp' usually files have two sections, separated by +comment text. The first section is the part that is generated by +`make'. It is essentially a collection of Tcl variable definitions +based on `Makefile' environment variables. Since they are generated by +`make', they contain the values as specified by `configure'. (You can +also customize these values by using the `--site' option to +`configure'.) In particular, this section contains the `Makefile' +variables for host and target configuration data. Do not edit this +first section; if you do, your changes are replaced next time you run +`make'. + + The first section starts with: + + ## these variables are automatically generated by make ## + # Do not edit here. If you wish to override these values + # add them to the last section + + In the second section, you can override any default values (locally +to DejaGnu) for all the variables. The second section can also contain +your preferred defaults for all the command line options to `runtest'. +This allows you to easily customize `runtest' for your preferences in +each configured test-suite tree, so that you need not type options +repeatedly on the command line. (The second section may also be empty, +if you do not wish to override any defaults.) + + The first section ends with this line: + + ## All variables above are generated by configure. Do Not Edit ## + + You can make any changes under this line. If you wish to redefine a +variable in the top section, then just put a duplicate value in this +second section. Usually the values defined in this config file are +related to the configuration of the test run. This is the ideal place to +set the variables `host_triplet', `build_triplet', `target_triplet'. +All other variables are tool dependant. ie for testing a compiler, the +value for CC might be set to a freshly built binary, as opposed to one +in the user's path. + + +File: dejagnu.info, Node: Personal Config File, Prev: Local Config File, Up: Customizing + +Personal Config File +-------------------- + + The personal config file is used to customize `runtest's' behaviour +for each person. It's typically used to set the user prefered setting +for verbosity, and any experimental Tcl procedures. My personal +`~/.dejagnurc' file looks like: + + set all_flag 1 + set RLOGIN /usr/ucb/rlogin + set RSH /usr/ucb/rsh + + Here I set `all_flag' so I see all the test cases that PASS along +with the ones that FAIL. I also set RLOGIN and `RSH' to the BSD +version. I have `kerberos' installed, and when I rlogin to a target +board, it usually isn't supported. So I use the non secure versions of +these programs rather than the default that's in my path. + + +File: dejagnu.info, Node: Internals, Next: Tests, Prev: Customizing, Up: Top + +The DejaGnu Implementation +************************** + + DejaGnu is entirely written in `expect', which uses Tcl as a command +language. `expect' serves as a very programmable shell; you can run +any program, as with the usual Unix command shells--but once the +program is started, your `expect' script has fully programmable control +of its input and output. This does not just apply to the programs +under test; `expect' can also run any auxiliary program, such as `diff' +or `sh', with full control over its input and output. + + DejaGnu itself is merely a framework for the set of test suites +distributed separately for each GNU tool. Future releases of GNU tools +will include even more tests, developed throughout the free software +community. + + `runtest' is the glue to tie together and manage the test scripts. +The `runtest' program is actually a simple Bourne shell script that +locates a copy of the `expect' shell and then starts the main Tcl code, +`runtest.exp'. `runtest.exp' itself has these essential functions: + + 1. Parse the command line options, load the library files, and load + the default configuration files. + + 2. Locating the individual test scripts. `runtest.exp' locates the + tests by exploiting a straightforward naming convention based on + the string you specify with the `--tool' option. + + 3. Providing an extended test environment, by defining additional Tcl + procedures beyond those already in `expect'. + + 4. Locating target-dependent functions, to standardize the test + environment across a wide variety of test platforms. + +* Menu: + +* Names:: Conventions for using tool names +* Init Module:: Initialization module +* DejaGnu Builtins:: DejaGnu provides these Tcl procedures +* Target Dependent:: Procedures supplied by the init module +* Cross Targets:: Remote targets supported +* Input Files:: The files DejaGnu depends on +* Output Files:: The files DejaGnu produces + diff --git a/contrib/bluegnu2.0.3/doc/dejagnu.info-2 b/contrib/bluegnu2.0.3/doc/dejagnu.info-2 new file mode 100644 index 0000000..9339d94 --- /dev/null +++ b/contrib/bluegnu2.0.3/doc/dejagnu.info-2 @@ -0,0 +1,1137 @@ +This is Info file dejagnu.info, produced by Makeinfo version 1.68 from +the input file ./dejagnu.texi. + +START-INFO-DIR-ENTRY +* DejaGnu: (dejagnu). The GNU testing framework. +END-INFO-DIR-ENTRY + + Copyright (C) 92, 93, 94, 95, 1996 Free Software Foundation, Inc. + + Permission is granted to make and distribute verbatim copies of this +manual provided the copyright notice and this permission notice are +preserved on all copies. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the entire resulting derived work is distributed under the terms +of a permission notice identical to this one. + + Permission is granted to copy and distribute translations of this +manual into another language, under the above conditions for modified +versions. + + +File: dejagnu.info, Node: Names, Next: Init Module, Up: Internals + +Conventions for using tool names +================================ + + DejaGnu uses `$tool', the name of the tool under test, to tie +together the testing configuration in a straightforward but flexible +way. If there is only one testsuite for a particular application, then +`$tool' is optional. + + `$tool' is *not* used to invoke the tool, since sites that run +multiple configurations of a particular tool often call each +configuration by a different name. `runtest' uses the +configuration-dependent variables captured in `site.exp' to determine +how to call each tool. + + `runtest' uses tool names to find directories containing tests. +`runtest' scans the source directory (specified with `--srcdir') for +all directories whose names start with the tool name. It is a common +practice to put a period after the tool part of the name. For instance, +directories that start with `g++.' contain G++ tests. To add a new +test, just put it in any directory (create an entirely new directory, +if you wish) whose name follows this convention. + + A test is any file in an appropriately named subdirectory whose name +ends in `.exp' (the conventional way of naming `expect' scripts). +These simple naming conventions make it as simple as possible to +install new tests: all you must do is put the test in the right +directory. + + `runtest' sorts the tests in each subdirectory by name (using the +Tcl `lsort' command) and runs them in the resulting order. + + +File: dejagnu.info, Node: Init Module, Next: DejaGnu Builtins, Prev: Names, Up: Internals + +Initialization module +===================== + + The initialization module (or "init file") has two purposes: to +provide tool and target dependent procedures, and to start up an +interactive tool to the point where it is ready to operate. The latter +includes establishing communications with the target. All the tests for +interactive programs assume that the tool is already running and +communicating. Initialization modules for non-interactive programs may +only need to supply the support functions. + + Each test suite directory must contain (in its `config' +subdirectory) a separate initialization module for each target. The +appropriate init file is can be named several ways. The prefered name is +the *os* part of the canonical configuration name with `.exp' as the +suffix. An example would be that for an `m68k-coff' system, the +`target_os' part would be `coff'. The next way is for system where +there are short filenames, or a shortcut is desired to refer to the OS +name for that target. This is uses the value of `$target_abbrev' rather +than the `target_os'. + + The final file looked for is simply `default.exp'. If there is only +one operating system to support, then this file can be used. It's main +purpose is to offer some support for new operating systems, or for +unsupported cross targets. The last file looked for is `unknown.exp'. +This is usually limited to error handling for unsupported targets. It's +whole contents is typically. + + perror "Sorry, there is no support for this target" + exit 1 + + At the beginning of the init file, you must first determine the +proper executable name of the tool to execute, since the actual name of +the tool to be tested my vary from system to system. Here's an example +for the GNU C compiler. + + global AR + # look for the archiver ar + if ![info exists AR] { + set AR [findfile $base_dir/../../binutils/ar $base_dir/../../binutils/ar [tr + ansform ar]] + verbose "AR defaulting to $AR" 2 + } + } + + global CFLAGS + if ![info exists CFLAGS] then { + set CFLAGS "" + } + + It is always a good idea to first check the variable, and only set +it if it has not yet been defined. Often the proper value of `AR' is +set on the command line that invokes `runtest'. + + The `findfile' procedure takes as it's first argument a file name to +look for. The second argument is returned if the file is found, and the +third argument is returned if the file is not found. `base_dir' is set +internally by DejaGnu to the top level directory of the object tree. + + The `transform' procedure takes as its argument the native name of a +tool (such as `gcc' for the compiler), and returns the name as +configured for that tool in the current installation. (For example, a +cross-compiling version of GNU CC that generates MIPS code may be +installed with a name like `mips-idt-ecoff-gcc'.) + + In a test running native, writing the Tcl code for initialization is +usually quite simple. For cross configurations, however, more elaborate +instructions are usually needed to describe how to talk to a remote +target. + + Each initialization module defines up to four procedures with +standard names and purposes. The names of these procedures begin with +`$tool', the string that identifies tests for a particular tool: +`$tool_start', `$tool_load', `$tool_exit', and `$tool_version'. For +example, the start procedure for GDB is called `gdb_start'. (Since +start procedures are used differently for batch and interactive tools, +however, `runtest' itself never calls the start procedure. Init files +for interactive tools are expected to end by running the start +procedure.) + + The initialization module is also a good place to call `load_lib' to +get any collections of utility procedures meant for a family of test +cases, and to set up default values for any additional Tcl variables +needed for a specific set of tests. + + *Note Target dependent procedures: Target Dependent, for full +descriptions of these procedures. + + +File: dejagnu.info, Node: DejaGnu Builtins, Next: Target Dependent, Prev: Init Module, Up: Internals + +DejaGnu procedures +================== + + DejaGnu provides these Tcl procedures for use in test scripts. You +can also use any standard `expect' or Tcl function. These procedures +are stored in libraries, which DejaGnu loads at runtime. Here's +explanation of the library procedures that get loaded at runtime. All +other librarys are optional, and need to be loaded by the testsuite. + +* Menu: + +* framework.exp:: Core Internal Procedures. +* remote.exp:: Procedures for remote communication. +* utils.exp:: Utility procedures. +* target.exp:: Cross target procedures. +* debugger.exp:: Procedures for debugging your Tcl code. + + +File: dejagnu.info, Node: framework.exp, Next: remote.exp, Up: DejaGnu Builtins + +Core Internal Procedures +------------------------ + + *Note A POSIX conforming test framework: Posix, for more detailed +explanations of the test outcomes (`FAIL', `PASS', `UNTESTED', +`UNRESOLVED', `UNSUPPORTED'). + +`perror "STRING NUMBER"' + Declares a severe error in the testing framework itself. `perror' + writes in the log files a message beginning with `ERROR', + appending the argument STRING. If the optional NUMBER is supplied, + then this is used to set the internal count of errors to that + value. + + As a side effect, `perror' also changes the effect of the next + `pass' or `fail' command: the test outcome becomes `UNRESOLVED', + since an automatic `PASS' or `FAIL' cannot be trusted after a + severe error in the test framework. If the optional numeric value + is `0', then there are no further side effects to calling this + function, and the following test outcome doesn't become + `UNRESOLVED'. This can be used for errors with no known side + effects. + +`warning "STRING NUMBER"' + Declares detection of a minor error in the test case itself. + `warning' writes in the log files a message beginning with + `WARNING', appending the argument STRING. Use `warning' rather + than `error' for cases (such as communication failure to be + followed by a retry) where the test case can recover from the + error. If the optional NUMBER is supplied, then this is used to + set the internal count of warnings to that value. + + As a side effect, `warning_threshold' or more calls to `warning' + in a single test case also changes the effect of the next `pass' + or `fail' command: the test outcome becomes `UNRESOLVED' since an + automatic `PASS' or `FAIL' may not be trustworthy after many + warnings. If the optional numeric value is `0', then there are no + further side effects to calling this function, and the following + test outcome doesn't become `UNRESOLVED'. This can be used for + errors with no known side effects. + +`note "STRING"' + Appends an informational message to the log file. `note' writes + in the log files a message beginning with `NOTE', appending the + argument STRING. Use `note' sparingly. `verbose' should be used + for most such messages, but in cases where a message is needed in + the log file regardless of the verbosity level use `note'. + +`pass "STRING"' + Declares a test to have passed. `pass' writes in the log files a + message beginning with `PASS' (or `XPASS', if failure was + expected), appending the argument STRING. + +`fail "STRING"' + Declares a test to have failed. `fail' writes in the log files a + message beginning with `FAIL' (or `XFAIL', if failure was + expected), appending the argument STRING. + +`unresolved "STRING"' + Declares a test to have an unresolved outcome. `unresolved' writes + in the log file a message beginning with `UNRESOLVED', appending + the argument STRING. This usually means the test did not execute + as expected, and a human being must go over results to determine + if it passed or failed (and to improve the test case). + +`untested "STRING"' + Declares a test was not run. `untested' writes in the log file a + message beginning with `UNTESTED', appending the argument STRING. + For example, you might use this in a dummy test whose only role is + to record that a test does not yet exist for some feature. + +`unsupported "STRING"' + Declares that a test case depends on some facility that does not + exist in the testing environment. `unsupported' writes in the log + file a message beginning with `UNSUPPORTED', appending the argument + STRING. + +`get_warning_threshold' + Returns the current value of `warning_threshold'. The default + value is 3. + +`set_warning_threshold THRESHOLD' + Sets the value of `warning_threshold'. A value of `0' disables + it: calls to `warning' will not turn a `PASS' or `FAIL' into an + `UNRESOLVED'. + +`transform "TOOLNAME"' + Generates a string for the name of a tool as it was configured and + installed, given its native name (as the argument TOOLNAME). This + makes the assumption that all tools are installed using the same + naming conventions: it extrapolates from the invocation name for + `runtest'. For example, if you call `runtest' as + `m68k-vxworks-runtest', the result of ` transform "gcc" ' is + `m68k-vxworks-gcc'. + +`ishost "HOST"' + Tests for a particular *host* environment. If the currently + configured host matches the argument string, the result is `1'; + otherwise the result is `0'. HOST must be a full three-part + `configure' host name; in particular, you may not use the shorter + nicknames supported by `configure' (but you can use wildcard + characters, using shell syntax, to specify sets of names). + +`istarget "TARGET"' + Tests for a particular *target* environment. If the currently + configured target matches the argument string, the result is `1'; + otherwise the result is `0'. TARGET must be a full three-part + `configure' target name; in particular, you may not use the + shorter nicknames supported by `configure' (but you can use + wildcard characters, using shell syntax, to specify sets of + names). If it is passed a `NULL' string, then it returns the name + of the build canonical configuration. + +`isbuild "HOST"' + Tests for a particular *build host* environment. If the currently + configured host matches the argument string, the result is `1'; + otherwise the result is `0'. HOST must be a full three-part + `configure' host name; in particular, you may not use the shorter + nicknames supported by `configure' (but you can use wildcard + characters, using shell syntax, to specify sets of names). If it is + passed a `NULL' string, then it returns the name of the build + canonical configuration. + + item is3way "HOST" Tests for a canadian cross. This is when the + tests will be run on a remotly hosted cross compiler. If it is a + canadian cross, then the result is `1'; otherwise the result is + `0'. + +`isnative' + Tests whether the current configuration has the same host and + target. When it runs in a *native* configuration this procedure + returns a `1'; otherwise it returns a `0'. + +`load_lib "LIBRARY-FILE"' + Loads the file LIBRARY-FILE by searching a fixed path built into + `runtest'. If DejaGnu has been installed, it looks in a path + starting with the installed library directory. If you are running + DejaGnu directly from a source directory, without first running + `make install', this path defaults to the current directory. In + either case, it then looks in the current directory for a directory + called `lib'. If there are duplicate definitions, the last one + loaded takes precedence over the earlier ones. + +`setup_xfail "CONFIG [BUGID]"' + Declares that the test is expected to fail on a particular set of + configurations. The CONFIG argument must be a list of full + three-part `configure' target name; in particular, you may not use + the shorter nicknames supported by `configure' (but you can use the + common shell wildcard characters to specify sets of names). The + BUGID argument is optional, and used only in the logging file + output; use it as a link to a bug-tracking system such as GNATS + (*note Overview: (gnats.info)Overview.). + + Once you use `setup_xfail', the `fail' and `pass' procedures + produce the messages `XFAIL' and `XPASS' respectively, allowing + you to distinguish expected failures (and unexpected success!) + from other test outcomes. + + *Warning:* you must clear the expected failure after using + `setup_xfail' in a test case. Any call to `pass' or `fail' clears + the expected failure implicitly; if the test has some other + outcome, e.g. an error, you can call `clear_xfail' to clear the + expected failure explicitly. Otherwise, the expected-failure + declaration applies to whatever test runs next, leading to + surprising results. + +`clear_xfail CONFIG' + Cancel an expected failure (previously declared with `setup_xfail') + for a particular set of configurations. The CONFIG argument is a + list of configuration target names. It is only necessary to call + `clear_xfail' if a test case ends without calling either `pass' or + `fail', after calling `setup_xfail'. + +`verbose [-log] [-n] [--] "STRING" NUMBER' + Test cases can use this function to issue helpful messages + depending on the number of `--verbose' options on the `runtest' + command line. It prints STRING if the value of the variable + `verbose' is higher than or equal to the optional NUMBER. The + default value for NUMBER is 1. Use the optional `-log' argument + to cause STRING to always be added to the log file, even if it + won't be printed. Use the optional `-n' argument to print STRING + without a trailing newline. Use the optional `--' argument if + STRING begins with "-". + + +File: dejagnu.info, Node: remote.exp, Next: utils.exp, Prev: framework.exp, Up: DejaGnu Builtins + +Remote Communication Procedures +------------------------------- + +`lib/remote.exp' defines these functions, for establishing and managing +communications: + + *Procedures to establish a connection:* Each of these procedures +tries to establish the connection up to three times before returning. +Warnings (if retries will continue) or errors (if the attempt is +abandoned) report on communication failures. The result for any of +these procedures is either `-1', when the connection cannot be +established, or the spawn ID returned by the `expect' command `spawn'. + + It use the value of the `connect' field in the `target_info' array +(was `connectmode' as the type of connection to make. Current supported +connection types are tip, kermit, telnet, rsh, rlogin, and netdata. If +the `--reboot' option was used on the runtest command line, then the +target is rebooted before the connection is made. + +`remote_open TYPE' + *Remote Connection Procedure.* This is passed *host* or *target*. + Host or target refers to whether it is a connection to a remote + target, or a remote host. This opens the connection to the desired + target or host using the default values in the configuration + system. It returns that `spawn_id' of the process that manages the + connection. This value can be used in `expect' or `exp_send' + statements, or passed to other procedures that need the connection + process's id. This also sets the `fileid' field in the + `target_info' array. + +`remote_close SHELLID' + *shellid* is value returned by a call to `remote_open'. This + closes the connection to the target so resources can be used by + others. This parameter can be left off if the `fileid' field in the + `target_info' array is set. + +`telnet HOSTNAME PORT' +`rlogin HOSTNAME' +`rsh HOSTNAME' + *IP network procedures.* HOSTNAME refers to the IP address or name + (for example, an entry in `/etc/hosts') for this target. The + procedure names reflect the Unix utility used to establish a + connection. The optional PORT is used to specify the IP port + number. The value of the `netport' field in the `target_info' + array is used. (was `$netport') This value has two parts, the + hostname and the port number, seperated by a *:*. If `host' or + `target' is used in the `hostname' field, than the config array is + used for all information. + +`tip PORT' + *Serial line procedure.* Connect using the Unix utility `tip'. + PORT must be a name from the `tip' configuration file + `/etc/remote'. Often, this is called `hardwire', or something + like `ttya'. This file holds all the configuration data for the + serial port. The value of the `serial' field in the `target_info' + array is used. (was `$serialport') If `host' or `target' is used + in the `port' field, than the config array is used for all + information. + +`kermit PORT BPS' + *Serial line procedure.* Connect using the program `kermit'. + PORT is the device name, e.g. `/dev/ttyb'. BPS is the line speed + to use (in bits per second) for the connection. The value of the + `serial' field in the `target_info' array is used. (was + `$serialport') If `host' or `target' is used in the `port' field, + than the config array is used for all information. + +*Procedures to manage a connection:* + +`tip_download SPAWNID FILE' + Download `FILE' to the process SPAWNID (the value returned when + the connection was established), using the `~put' command under + `tip'. Most often used for single board computers that require + downloading programs in ASCII S-records. Returns `1' if an error + occurs, `0' otherwise. + +`exit_remote_shell SPAWNID' + Exits a remote process started by any of the connection procedures. + SPAWNID is the result of the connection procedure that started the + remote process. + +`download FILE [ SPAWNID ]' + After you establish a connection to a target, you can download + programs using this command. `download' reads in FILE (object + code in S-record format) and writes it to the device controlling + this SPAWNID. (From the point of view of the target, the S-record + file comes in via standard input.) + + If you have more than one target active, you can use the optional + argument SPAWNID to specify an alternative target (the default is + the most recently established SPAWNID.) + + +File: dejagnu.info, Node: utils.exp, Next: target.exp, Prev: remote.exp, Up: DejaGnu Builtins + +Utility Procedures +------------------ + +`lib/utils.exp' defines these utility procedures: + +`getdirs DIR' +`getdirs DIR PATTERN' + Returns a list of all the directories in the single directory DIR + that match PATTERN. If you do not specify PATTERN, `getdirs' + assumes `*'. You may use the common shell wildcard characters in + PATTERN. If no directories match the pattern, then a `NULL' string + is returned. + +`find DIR PATTERN' + Search for files whose names match PATTERN (using shell wildcard + characters for filename expansion). Search subdirectories + recursively, starting at DIR. The result is the list of files + whose names match; if no files match, the result is empty. + Filenames in the result include all intervening subdirectory + names. If no files match the pattern, then a `NULL' string is + returned. + +`which BINARY' + Searches the execution path for an executable file BINARY, like + the the BSD `which' utility. This procedure uses the shell + environment variable `PATH'. It returns `0' if the binary is not + in the path, or if there is no `PATH' environment variable. If + BINARY is in the path, it returns the full path to BINARY. + +`grep FILENAME REGEXP' + +`grep FILENAME REGEXP line' + Search the file called FILENAME (a fully specified path) for lines + that contain a match for regular expression REGEXP. The result is + a list of all the lines that match. If no lines match, the result + is an empty string. Specify REGEXP using the standard regular + expression style used by the Unix utility program `grep'. + + Use the optional third argument `line' to start lines in the result + with the line number in FILENAME. (This argument is simply an + option flag; type it just as shown--`line'.) + +`diff FILENAME FILENAME' + Compares the two files and returns a 1 if they match, or a 0 if + they don't. If `verbose' is set, then it'll print the differences + to the screen. + +`slay NAME' + This look in the process tabel for NAME and send it a unix + `SIGINT', killing the process. + +`absolute PATH' + This procedure takes the relative PATH, and converts it to an + absolute path. + +`psource FILENAME' + This sources the file FILENAME, and traps all errors. It also + ignores all extraneous output. If there was an error it returns a + 1, otherwise it returns a 0. + +`prune LIST PATTERN' + Remove elements of the Tcl list LIST. Elements are fields + delimited by spaces. The result is a copy of LIST, without any + elements that match PATTERN. You can use the common shell + wildcard characters to specify PATTERN. + +`setenv VAR VAL' + Sets the variable VAR to the value VAL. + +`unsetenv VAR' + Unsets the environment variable VAR + +`getenv VAR' + returns the value of VAR in the environment if it exists, + otherwise it returns `NULL'. + +`runtest_file_p RUNTESTS TESTCASE' + Search RUNTESTS for TESTCASE and return 1 if found, 0 if not. + RUNTESTS is a list of two elements. The first is the pathname of + the testsuite expect script running. The second is a copy of what + was on the right side of the `=' if `foo.exp="..."' was specified, + or an empty string if no such argument is present. This is used + by tools like compilers where each testcase is a file. + +`prune_system_crud SYSTEM TEXT' + For system SYSTEM, delete text the host or target operating system + might issue that will interfere with pattern matching of program + output in TEXT. An example is the message that is printed if a + shared library is out of date. + + +File: dejagnu.info, Node: target.exp, Next: debugger.exp, Prev: utils.exp, Up: DejaGnu Builtins + +Cross target procedure +---------------------- + +`lib/target.exp' defines these utility procedures: + +`push_target *name*' + This makes the target named *name* be the current target + connection. The value of *name* is an index into the `target_info' + array and is set in the global config file. + +`pop_target' + This unsets the current target connection. + +`list_targets' + This lists all the supported targets for this architecture. + +`push_host *name*' + This makes the host named *name* be the current remote host + connection. The value of *name* is an index into the `target_info' + array and is set in the global config file. + +`pop_host' + This unsets the current host connection. + + This invokes the compiler as set by `CC' to compile the file + *file*. The default options for many cross compilation targets are + *guessed* by DejaGnu, and these options can be added to by passing + in more parameters as arguments to `compile'. Optionally, this will + also use the value of the `cflags' field in the target config + array. If the host is not the same as the build machines, then then + compiler is run on the remote host using `execute_anywhere'. + + This produces an archive file. Any parameters passed to `archive' + are used in addition to the default flags. Optionally, this will + also use the value of the `arflags' field in the target config + array. If the host is not the same as the build machines, then then + archiver is run on the remote host using `execute_anywhere'. + + This generates an index for the archive file for systems that + aren't POSIX yet. Any parameters passed to `ranlib' are used in + for the flags. + +`execute_anywhere *cmdline*' + This executes the *cmdline* on the proper host. This should be used + as a replacement for the Tcl command `exec' as this version + utilizes the target config info to execute this command on the + build machine or a remote host. All config information for the + remote host must be setup to have this command work. If this is a + canadian cross, (where we test a cross compiler that runs on a + different host then where DejaGnu is running) then a connection is + made to the remote host and the command is executed there. It + returns either *REMOTERROR* (for an error) or the output produced + when the command was executed. This is used for running the tool + to be tested, not a test case. + + +File: dejagnu.info, Node: debugger.exp, Prev: target.exp, Up: DejaGnu Builtins + +Debugging Procedures +-------------------- + + `lib/debugger.exp' defines these utility procedures: + +`dumpvars *expr*' + This takes a csh style regular expression (glob rules) and prints + the values of the global variable names that match. It is + abbreviated as `dv' + +`dumplocals *expr*' + This takes a csh style regular expression (glob rules) and prints + the values of the local variable names that match. It is + abbreviated as `dl'. + +`dumprocs *expr*' + This takes a csh style regular expression (glob rules) and prints + the body of all procs that match. It is abbreviated as `dp' + +`dumpwatch *expr*' + This takes a csh style regular expression (glob rules) and prints + all the watchpoints. It is abbreviated as `dw'. + +`watchunset *var*' + This breaks program execution when the variable *var* is unset. It + is abbreviated as `wu'. + +`watchwrite *var*' + This breaks program execution when the variable *var* is written. + It is abbreviated as `ww'. + +`watchread *var*' + This breaks program execution when the variable *var* is read. It + is abbreviated as `wr'. + +`watchdel *watch*' + This deletes a the watchpoint for *watch*. It is abbreviated as + `wd'. + +`print *var*' + This prints the value of the variable *var*. It is abbreviated as + `p'. + +`quit' + This makes runtest exit. It is abbreviated as `q'. + +`bt' + This prints a backtrace of the executed Tcl commands. + + +File: dejagnu.info, Node: Target Dependent, Next: Cross Targets, Prev: DejaGnu Builtins, Up: Internals + +Target dependent procedures +=========================== + + Each combination of target and tool requires some target-dependent +procedures. The names of these procedures have a common form: the tool +name, followed by an underbar `_', and finally a suffix describing the +procedure's purpose. For example, a procedure to extract the version +from GDB is called `gdb_version'. *Note Initialization Module: Init +Module, for a discussion of how DejaGnu arranges to find the right +procedures for each target. + + `runtest' itself calls only two of these procedures, `TOOL_exit' and +`TOOL_version'; these procedures use no arguments. + + The other two procedures, `TOOL_start' and `TOOL_load', are only +called by the test suites themselves (or by testsuite-specific +initialization code); they may take arguments or not, depending on the +conventions used within each test suite. + +`TOOL_start' + Starts a particular tool. For an interactive tool, `TOOL_start' + starts and initializes the tool, leaving the tool up and running + for the test cases; an example is `gdb_start', the start function + for GDB. For a batch oriented tool, `TOOL_start' is optional; the + recommended convention is to let `TOOL_start' run the tool, + leaving the output in a variable called `comp_output'. Test + scripts can then analyze `$comp_output' to determine the test + results. An example of this second kind of start function is + `gcc_start', the start function for GCC. + + `runtest' itself *does not call* `TOOL_start'. The initialization + module `TOOL_init.exp' must call `TOOL_start' for interactive + tools; for batch-oriented tools, each individual test script calls + `TOOL_start' (or makes other arrangements to run the tool). + +`TOOL_load' + Loads something into a tool. For an interactive tool, this + conditions the tool for a particular test case; for example, + `gdb_load' loads a new executable file into the debugger. For + batch oriented tools, `TOOL_load' may do nothing--though, for + example, the GCC support uses `gcc_load' to load and run a binary + on the target environment. Conventionally, `TOOL_load' leaves the + output of any program it runs in a variable called `exec_output'. + Writing `TOOL_load' can be the most complex part of extending + DejaGnu to a new tool or a new target, if it requires much + communication coding or file downloading. + + Test scripts call `TOOL_load'. + +`TOOL_exit' + Cleans up (if necessary) before `runtest' exits. For interactive + tools, this usually ends the interactive session. You can also use + `TOOL_exit' to remove any temporary files left over from the tests. + + `runtest' calls `TOOL_exit'. + +`TOOL_version' + Prints the version label and number for TOOL. This is called by + the DejaGnu procedure that prints the final summary report. The + output should consist of the full path name used for the tested + tool, and its version number. + + `runtest' calls `TOOL_version'. + + The usual convention for return codes from any of these procedures +(although it is not required by `runtest') is to return `0' if the +procedure succeeded, `1' if it failed, and `-1' if there was a +communication error. + + +File: dejagnu.info, Node: Cross Targets, Next: Input Files, Prev: Target Dependent, Up: Internals + +Remote targets supported +======================== + + The DejaGnu distribution includes support for the following remote +targets. You can set the target name and the connect mode in the +`site.exp' file (using the Tcl variables `targetname' and +`connectmode', respectively), or on the `runtest' command line (using +`--name' and `--connect'). + +*AMD 29000, with UDI protocol* + Configure DejaGnu for target `a29k-amd-udi'. (Cygnus `configure' + also recognizes the abbreviation `udi29k'.) Then, to run tests, + use the `runtest' target name to specify whether you want to use a + simulator, or a particular hardware board. The particular string + to use with `--name' will depend on your UDI setup file, `udi_soc' + (if `udi_soc' is not in your working directory, the environment + variable `UDICONF' should contain a path to this file). For + example, if your UDI setup file includes these lines: + + iss AF_UNIX * isstip -r /home/gnu/29k/src/osboot/sim/osboot + mon AF_UNIX * montip -t serial -baud 9600 -com /dev/ttyb + +* * + You can use `--name iss' to run tests on the simulator, and + `--name mon' to run tests on the 29K hardware. See the + manufacturer's manuals for more information on UDI and `udi_soc'. + + The default connect protocol is `mondfe' with either back end. + `mondfe' is the only shell DejaGnu supports for UDI targets. + `mondfe' is an AMD specific monitor program freely available from + AMD. + + *Warning:* This target requires GDB version 4.7.2 (or greater). + Earlier versions of GDB do not fully support the `load' command on + this target, so DejaGnu has no way to load executable files from + the debugger. + +*Motorola 680x0 boards, a.out or COFF object format* + Configure DejaGnu for any remote target matching `m68k-*'. + + *Warning:* Most `m68k-*' configurations run all tests only for + native testing (when the target is the same as the host). When you + specify most of these targets for a cross configuration, you will + only be able to use tests that run completely within the host (for + example, tests of the binary utilities such as the archiver; or + compiler tests that only generate code rather than running it). + + To run a.out or COFF binaries on a remote M68K, you must configure + DejaGnu for a particular target board. `m68k-abug' is an example. + (In general for an embedded environment, because it does not have + absolute addresses, a.out is not a good choice for output format + in any case; most often S-records or Hex-32 are used instead.) + +*Motorola 68K MVME 135 board running ABug boot monitor* + Configure for `m68k-abug-aout' or `m68k-abug-coff' (as a target). + This boot monitor can only download S-records; therefore, the + DejaGnu tests for this environment require a linker command script + to convert either output format to S-records, setting the default + addresses for `.text', `.bss', and `.data'. + + With this configuration, the default for `--connect' is `tip'. + `tip' is the only communications protocol supported for connecting + to `m68k-abug-*' targets. `tip' uses an ASCII downloader (the + `~put' command) to load S-records into the target board. The + `--name' string must be a machine name that `tip' understands (for + example, on some `tip' implementations it must be an entry from + the initialization file for `tip'; this file is sometimes called + `/etc/remote'). + + See your system documentation for information on how to create new + entries in `/etc/remote'. (Some UNIX systems are distributed with + at least one default entry with a name resembling `hardwire'; if + your system has one, you can edit it, or make a modified copy with + a new name.) When you have a working `/etc/remote' entry + ABUGTARGET, you should be able to type `tip ABUGTARGET', and get + the prompt `135ABUG>' from the board. Use the same ABUGTARGET + string with `runtest --name'. + +*Motorola IDP board running the rom68k boot monitor* + This is the same in functionality as the MVME board running the + `BUG' boot monitor. Only the monitor commands and the addresses are + different. + +*VxWorks (Motorola 68K or Intel 960)* + Configure DejaGnu for either `m68k-wrs-vxworks' (abbreviated + `vxworks68') or `i960-wrs-vxworks' (abbreviated `vxworks960'). + Since both targets support IP addressing, specify the network + address (for example, a host name from `/etc/hosts') with `--name'. + + The default connect protocol is `rlogin', but you can use any of + `--connect rlogin', `--connect telnet', or `--connect rsh'. + + Test scripts need no special code to load programs into these + targets; since VxWorks supports NFS, all you must do is ensure + test programs are on an exported filesystem. + + When you compile for VxWorks, use the linker `-r' option to make + the linker output relocatable--at least if you want to use library + routines. Many standard C routines are included in VxWorks; often + no additional libraries are needed. See your VxWorks system + documentation for additional details. + + +File: dejagnu.info, Node: Input Files, Next: Output Files, Prev: Cross Targets, Up: Internals + +The files DejaGnu reads +======================= + + The `runtest' program used to invoke DejaGnu is a short shell script +generated by `make' during the configuration process. Its main task is +to read the main test framework driver, `runtest.exp'. + + `runtest.exp', in turn, reads `expect' code from certain other +files, in this order: + + 1. Each of the `site.exp' local definition files available. *Note + Setting `runtest' defaults: Customizing, for details. + + 2. `lib/utils.exp', a collection of utility procedures. *Note + DejaGnu Builtins: DejaGnu Builtins, for descriptions of these + procedures. + + 3. `lib/framework.exp', a file of subroutines meant for `runtest' + itself rather than for general-purpose use in both `runtest' and + test suites. + + 4. `debugger.exp', Don Libes' Tcl Debugger. (See `A Debugger for Tcl + Applications' by Don Libes. This paper is distributed with + `expect' in PostScript form as the file `expect/tcl-debug.ps'.) + + 5. `lib/remote.exp', a collection of subroutines meant for connecting + to remote machines. + + 6. `lib/target.exp', a collection of subroutines used for the + configuration systems in DejaGnu. These procedures typically + manipulate or utilize the configuration system. + + 7. An initialization file `TOOL_init.exp'. *Note Initialization + module: Init Module, for more discussion of init files. + + +File: dejagnu.info, Node: Output Files, Prev: Input Files, Up: Internals + +The files DejaGnu writes +======================== + + `runtest' always writes two kinds of output files: summary logs and +detailed logs. The contents of both of these are determined by your +tests. + + For troubleshooting, a third kind of output file is useful: use +`--debug' to request an output file showing details of what `expect' is +doing internally. + +* Menu: + +* Summary:: Files that summarize tests +* Detail:: Files that contain complete test results +* Debug:: Logging expect internal actions + + +File: dejagnu.info, Node: Summary, Next: Detail, Up: Output Files + +Summary log +----------- + + `runtest' always produces a summary output file `TOOL.sum'. This +summary shows the names of all test files run; for each test file, one +line of output from each `pass' command (showing status `PASS' or +`XPASS') or `fail' command (status `FAIL' or `XFAIL'); trailing summary +statistics that count passing and failing tests (expected and +unexpected); and the full pathname and version number of the tool +tested. (All possible outcomes, and all errors, are always reflected in +the summary output file, regardless of whether or not you specify +`--all'.) + + If any of your tests use the procedures `unresolved', `unsupported', +or `untested', the summary output also tabulates the corresponding +outcomes. + + For example, after `runtest --tool binutils', look for a summary log +in `binutils.sum'. Normally, `runtest' writes this file in your +current working directory; use the `--outdir' option to select a +different directory. + +Here is a short sample summary log: + + Test Run By rob on Mon May 25 21:40:57 PDT 1992 + === gdb tests === + Running ./gdb.t00/echo.exp ... + PASS: Echo test + Running ./gdb.all/help.exp ... + PASS: help add-symbol-file + PASS: help aliases + PASS: help breakpoint "bre" abbreviation + FAIL: help run "r" abbreviation + Running ./gdb.t10/crossload.exp ... + PASS: m68k-elf (elf-big) explicit format; loaded + XFAIL: mips-ecoff (ecoff-bigmips) "ptype v_signed_char" signed + C types + === gdb Summary === + # of expected passes 5 + # of expected failures 1 + # of unexpected failures 1 + /usr/latest/bin/gdb version 4.6.5 -q + + +File: dejagnu.info, Node: Detail, Next: Debug, Prev: Summary, Up: Output Files + +Detailed log +------------ + + `runtest' also saves a detailed log file `TOOL.log', showing any +output generated by tests as well as the summary output. For example, +after `runtest --tool binutils', look for a detailed log in +`binutils.log'. Normally, `runtest' writes this file in your current +working directory; use the `--outdir' option to select a different +directory. + +Here is a brief example showing a detailed log for G++ tests: + + Test Run By rob on Mon May 25 21:40:43 PDT 1992 + + === g++ tests === + + --- Running ./g++.other/t01-1.exp --- + PASS: operate delete + + --- Running ./g++.other/t01-2.exp --- + FAIL: i960 bug EOF + p0000646.C: In function `int warn_return_1 ()': + p0000646.C:109: warning: control reaches end of non-void function + p0000646.C: In function `int warn_return_arg (int)': + p0000646.C:117: warning: control reaches end of non-void function + p0000646.C: In function `int warn_return_sum (int, int)': + p0000646.C:125: warning: control reaches end of non-void function + p0000646.C: In function `struct foo warn_return_foo ()': + p0000646.C:132: warning: control reaches end of non-void function + + --- Running ./g++.other/t01-4.exp --- + FAIL: abort + 900403_04.C:8: zero width for bit-field `foo' + --- Running ./g++.other/t01-3.exp --- + FAIL: segment violation + 900519_12.C:9: parse error before `;' + 900519_12.C:12: Segmentation violation + /usr/latest/bin/gcc: Internal compiler error: program cc1plus got + fatal signal + + === g++ Summary === + + # of expected passes 1 + # of expected failures 3 + /usr/ps/bin/g++ version cygnus-2.0.1 + + +File: dejagnu.info, Node: Debug, Prev: Detail, Up: Output Files + +Logging `expect' internal actions +--------------------------------- + + With the `--debug' option, you can request a log file showing the +output from `expect' itself, running in debugging mode. This file +(`dbg.log', in the directory where you start `runtest') shows each +pattern `expect' considers in analyzing test output. + + This file reflects each `send' command, showing the string sent as +input to the tool under test; and each `expect' command, showing each +pattern it compares with the tool output. + + The log messages for `expect' begin with a message of the form + + expect: does {TOOL OUTPUT} (spawn_id N) match pattern + {EXPECTED PATTERN}? + +For every unsuccessful match, `expect' issues a `no' after this +message; if other patterns are specified for the same `expect' command, +they are reflected also, but without the first part of the message +(`expect...match pattern'). + + When `expect' finds a match, the log for the successful match ends +with `yes', followed by a record of the `expect' variables set to +describe a successful match. Here is an excerpt from the debugging log +for a GDB test: + + send: sent {break gdbme.c:34\n} to spawn id 6 + expect: does {} (spawn_id 6) match pattern {Breakpoint.*at.* file + gdbme.c, line 34.*\(gdb\) $}? no + {.*\(gdb\) $}? no + expect: does {} (spawn_id 0) match pattern {}? no + {\(y or n\) }? no + {buffer_full}? no + {virtual}? no + {memory}? no + {exhausted}? no + {Undefined}? no + {command}? no + break gdbme.c:34 + Breakpoint 8 at 0x23d8: file gdbme.c, line 34. + (gdb) expect: does {break gdbme.c:34\r\nBreakpoint 8 at 0x23d8: + file gdbme.c, line 34.\r\n(gdb) } (spawn_id 6) match pattern + {Breakpoint.*at.* file gdbme.c, line 34.*\(gdb\) $}? yes + expect: set expect_out(0,start) {18} + expect: set expect_out(0,end) {71} + expect: set expect_out(0,string) {Breakpoint 8 at 0x23d8: file + gdbme.c, line 34.\r\n(gdb) } + expect: set expect_out(spawn_id) {6} + expect: set expect_out(buffer) {break gdbme.c:34\r\nBreakpoint 8 + at 0x23d8: file gdbme.c, line 34.\r\n(gdb) } + PASS: 70 0 breakpoint line number in file + +This example exhibits three properties of `expect' and DejaGnu that +might be surprising at first glance: + + * Empty output for the first attempted match. The first set of + attempted matches shown ran against the output `{}'--that is, no + output. `expect' begins attempting to match the patterns supplied + immediately; often, the first pass is against incomplete output (or + completely before all output, as in this case). + + * Interspersed tool output. The beginning of the log entry for the + second attempted match may be hard to spot: this is because the + prompt `(gdb) ' appears on the same line, just before the `expect:' + that marks the beginning of the log entry. + + * Fail-safe patterns. Many of the patterns tested are fail-safe + patterns provided by GDB testing utilities, to reduce possible + indeterminacy. It is useful to anticipate potential variations + caused by extreme system conditions (GDB might issue the message + `virtual memory exhausted' in rare circumstances), or by changes in + the tested program (`Undefined command' is the likeliest outcome if + the name of a tested command changes). + + The pattern `{}' is a particularly interesting fail-safe + to notice; it checks for an unexpected prompt. This may + happen, for example, if the tested tool can filter output through a + pager. + + These fail-safe patterns (like the debugging log itself) are + primarily useful while developing test scripts. Use the `error' + procedure to make the actions for fail-safe patterns produce + messages starting with `ERROR' on the `runtest' standard output, + and in the detailed log file. + + +File: dejagnu.info, Node: Tests, Next: Extending, Prev: Internals, Up: Top + +How To Write a Test Case +************************ + +* Menu: + +* Writing:: Writing a test case +* Debugging:: Debugging a test case +* Adding:: Adding a test case to a test suite +* Hints:: Hints on writing a test case +* Variables:: Special variables used by test cases + + +File: dejagnu.info, Node: Writing, Next: Debugging, Up: Tests + +Writing a test case +=================== + + The easiest way to prepare a new test case is to base it on an +existing one for a similar situation. There are two major categories +of tests: batch or interactive. Batch oriented tests are usually +easier to write. + + The GCC tests are a good example of batch oriented tests. All GCC +tests consist primarily of a call to a single common procedure, since +all the tests either have no output, or only have a few warning +messages when successfully compiled. Any non-warning output is a test +failure. All the C code needed is kept in the test directory. The test +driver, written in `expect', need only get a listing of all the C files +in the directory, and compile them all using a generic procedure. This +procedure and a few others supporting for these tests are kept in the +library module `lib/c-torture.exp' in the GCC test suite. Most tests +of this kind use very few `expect' features, and are coded almost +purely in Tcl. + +Writing the complete suite of C tests, then, consisted of these steps: + + 1. Copying all the C code into the test directory. These tests were + based on the C-torture test created by Torbjorn Granlund (on + behalf of the Free Software Foundation) for GCC development. + + 2. Writing (and debugging) the generic `expect' procedures for + compilation. + + 3. Writing the simple test driver: its main task is to search the + directory (using the Tcl procedure `glob' for filename expansion + with wildcards) and call a Tcl procedure with each filename. It + also checks for a few errors from the testing procedure. + + Testing interactive programs is intrinsically more complex. Tests +for most interactive programs require some trial and error before they +are complete. + + However, some interactive programs can be tested in a simple fashion +reminiscent of batch tests. For example, prior to the creation of +DejaGnu, the GDB distribution already included a wide-ranging testing +procedure. This procedure was very robust, and had already undergone +much more debugging and error checking than many recent DejaGnu test +cases. Accordingly, the best approach was simply to encapsulate the +existing GDB tests, for reporting purposes. Thereafter, new GDB tests +built up a family of `expect' procedures specialized for GDB testing. + + `gdb.t10/crossload.exp' is a good example of an interactive test. + diff --git a/contrib/bluegnu2.0.3/doc/dejagnu.info-3 b/contrib/bluegnu2.0.3/doc/dejagnu.info-3 new file mode 100644 index 0000000..3e91476 --- /dev/null +++ b/contrib/bluegnu2.0.3/doc/dejagnu.info-3 @@ -0,0 +1,1016 @@ +This is Info file dejagnu.info, produced by Makeinfo version 1.68 from +the input file ./dejagnu.texi. + +START-INFO-DIR-ENTRY +* DejaGnu: (dejagnu). The GNU testing framework. +END-INFO-DIR-ENTRY + + Copyright (C) 92, 93, 94, 95, 1996 Free Software Foundation, Inc. + + Permission is granted to make and distribute verbatim copies of this +manual provided the copyright notice and this permission notice are +preserved on all copies. + + Permission is granted to copy and distribute modified versions of +this manual under the conditions for verbatim copying, provided also +that the entire resulting derived work is distributed under the terms +of a permission notice identical to this one. + + Permission is granted to copy and distribute translations of this +manual into another language, under the above conditions for modified +versions. + + +File: dejagnu.info, Node: Debugging, Next: Adding, Prev: Writing, Up: Tests + +Debugging a test case +===================== + +These are the kinds of debugging information available from DejaGnu: + + 1. Output controlled by test scripts themselves, explicitly allowed + for by the test author. This kind of debugging output appears in + the detailed output recorded in the `TOOL.log' file. To do the + same for new tests, use the `verbose' procedure (which in turn + uses the variable also called `verbose') to control how much + output to generate. This will make it easier for other people + running the test to debug it if necessary. Whenever possible, if + `$verbose' is `0', there should be no output other than the output + from `pass', `fail', `error', and `warning'. Then, to whatever + extent is appropriate for the particular test, allow successively + higher values of `$verbose' to generate more information. Be kind + to other programmers who use your tests: provide for a lot of + debugging information. + + 2. Output from the internal debugging functions of Tcl and `expect'. + There is a command line options for each; both forms of debugging + output are recorded in the file `dbg.log' in the current directory. + + Use `--debug' for information from the `expect' level; it + generates displays of the `expect' attempts to match the tool + output with the patterns specified (*note Debug Log: Debug.). This + output can be very helpful while developing test scripts, since it + shows precisely the characters received. Iterating between the + latest attempt at a new test script and the corresponding + `dbg.log' can allow you to create the final patterns by "cut and + paste". This is sometimes the best way to write a test case. + + Use `--strace' to see more detail at the Tcl level; this shows how + Tcl procedure definitions expand, as they execute. The associated + number controls the depth of definitions expanded; see the + discussion of `--strace' in *Note Running the Tests: Invoking + runtest. + + 3. Finally, if the value of `verbose' is 3 or greater, `runtest' + turns on the `expect' command `log_user'. This command prints all + `expect' actions to the `expect' standard output, to the detailed + log file, and (if `--debug' is on) to `dbg.log'. + + +File: dejagnu.info, Node: Adding, Next: Hints, Prev: Debugging, Up: Tests + +Adding a test case to a test suite +================================== + + There are two slightly different ways to add a test case. One is to +add the test case to an existing directory. The other is to create a new +directory to hold your test. The existing test directories represent +several styles of testing, all of which are slightly different; examine +the directories for the tool of interest to see which (if any) is most +suitable. + + Adding a GCC test can be very simple: just add the C code to any +directory beginning with `gcc.' and it runs on the next `runtest --tool +gcc'. + + To add a test to GDB, first add any source code you will need to the +test directory. Then you can either create a new `expect' file, or add +your test to an existing one (any file with a `.exp' suffix). Creating +a new `.exp' file is probably a better idea if the test is +significantly different from existing tests. Adding it as a separate +file also makes upgrading easier. If the C code has to be already +compiled before the test will run, then you'll have to add it to the +`Makefile.in' file for that test directory, then run `configure' and +`make'. + + Adding a test by creating a new directory is very similar: + + 1. Create the new directory. All subdirectory names begin with the + name of the tool to test; e.g. G++ tests might be in a directory + called `g++.other'. There can be multiple test directories that + start with the same tool name (such as `g++'). + + 2. Add the new directory name to the `configdirs' definition in the + `configure.in' file for the test suite directory. This way when + `make' and `configure' next run, they include the new directory. + + 3. Add the new test case to the directory, as above. + + 4. To add support in the new directory for configure and make, you + must also create a `Makefile.in' and a `configure.in'. *Note What + Configure Does: (configure.info)What Configure Does. + + +File: dejagnu.info, Node: Hints, Next: Variables, Prev: Adding, Up: Tests + +Hints on writing a test case +============================ + + There may be useful existing procedures already written for your +test in the `lib' directory of the DejaGnu distribution. *Note DejaGnu +Builtins: DejaGnu Builtins. + + It is safest to write patterns that match *all* the output generated +by the tested program; this is called "closure". If a pattern does not +match the entire output, any output that remains will be examined by +the *next* `expect' command. In this situation, the precise boundary +that determines which `expect' command sees what is very sensitive to +timing between the `expect' task and the task running the tested tool. +As a result, the test may sometimes appear to work, but is likely to +have unpredictable results. (This problem is particularly likely for +interactive tools, but can also affect batch tools--especially for +tests that take a long time to finish.) The best way to ensure closure +is to use the `-re' option for the `expect' command to write the +pattern as a full regular expressions; then you can match the end of +output using a `$'. It is also a good idea to write patterns that +match all available output by using `.*\' after the text of interest; +this will also match any intervening blank lines. Sometimes an +alternative is to match end of line using `\r' or `\n', but this is +usually too dependent on terminal settings. + + Always escape punctuation, such as `(' or `"', in your patterns; for +example, write `\('. If you forget to escape punctuation, you will +usually see an error message like `extra characters after close-quote'. + + If you have trouble understanding why a pattern does not match the +program output, try using the `--debug' option to `runtest', and +examine the debug log carefully. *Note Debug Log: Debug. + + Be careful not to neglect output generated by setup rather than by +the interesting parts of a test case. For example, while testing GDB, +I issue a send `set height 0\n' command. The purpose is simply to make +sure GDB never calls a paging program. The `set height' command in GDB +does not generate any output; but running *any* command makes GDB issue +a new `(gdb) ' prompt. If there were no `expect' command to match this +prompt, the output `(gdb) ' begins the text seen by the next `expect' +command--which might make *that* pattern fail to match. + + To preserve basic sanity, I also recommended that no test ever pass +if there was any kind of problem in the test case. To take an extreme +case, tests that pass even when the tool will not spawn are misleading. +Ideally, a test in this sort of situation should not fail either. +Instead, print an error message by calling one of the DejaGnu procedures +`error' or `warning'. + + +File: dejagnu.info, Node: Variables, Prev: Hints, Up: Tests + +Special variables used by test cases +==================================== + + Your test cases can use these variables, with conventional meanings +(as well as the variables saved in `site.exp' *note Setting `runtest' +defaults: Customizing.): + + *These variables are available to all test cases.* + +`prms_id' + The tracking system (e.g. GNATS) number identifying a corresponding + bugreport. (`0' if you do not specify it in the test script.) + +`bug_id' + An optional bug id; may reflect a bug identification from another + organization. (`0' if you do not specify it.) + +`subdir' + The subdirectory for the current test case. + + *These variables should never be changed. They appear in most + tests.* + +`expect_out(buffer)' + The output from the last command. This is an internal variable set + by `expect'. + +`exec_output' + This is the output from a `TOOL_load' command. This only applies + to tools like GCC and GAS which produce an object file that must + in turn be executed to complete a test. + +`comp_output' + This is the output from a `TOOL_start' command. This is + conventionally used for batch oriented programs, like GCC and GAS, + that may produce interesting output (warnings, errors) without + further interaction. + + +File: dejagnu.info, Node: Extending, Next: Installation, Prev: Tests, Up: Top + +New Tools, Targets, or Hosts +**************************** + + The most common ways to extend the DejaGnu framework are: adding a +suite of tests for a new tool to be tested; adding support for testing +on a new target; and porting `runtest' to a new host. + +* Menu: + +* Adding Tools:: How to add tests for a new tool +* Adding Targets:: How to add a new target +* Porting:: Porting DejaGnu to a new host + + +File: dejagnu.info, Node: Adding Tools, Next: Adding Targets, Up: Extending + +Writing tests for a new tool +============================ + + In general, the best way to learn how to write (code or even prose) +is to read something similar. This principle applies to test cases and +to test suites. Unfortunately, well-established test suites have a way +of developing their own conventions: as test writers become more +experienced with DejaGnu and with Tcl, they accumulate more utilities, +and take advantage of more and more features of `expect' and Tcl in +general. + + Inspecting such established test suites may make the prospect of +creating an entirely new test suite appear overwhelming. Nevertheless, +it is quite straightforward to get a new test suite going. + + There is one test suite that is guaranteed not to grow more elaborate +over time: both it and the tool it tests were created expressly to +illustrate what it takes to get started with DejaGnu. The `example/' +directory of the DejaGnu distribution contains both an interactive tool +called `calc', and a test suite for it. Reading this test suite, and +experimenting with it, is a good way to supplement the information in +this section. (Thanks to Robert Lupton for creating `calc' and its +test suite--and also the first version of this section of the manual!) + + To help orient you further in this task, here is an outline of the +steps to begin building a test suite for a program EXAMPLE. + + 1. Create or select a directory to contain your new collection of + tests. Change to that directory (shown here as `testsuite'): + + eg$ cd testsuite/ + + 2. Create a `configure.in' file in this directory, to control + configuration-dependent choices for your tests. So far as DejaGnu + is concerned, the important thing is to set a value for the + variable `target_abbrev'; this value is the link to the init file + you will write soon. (For simplicity, we assume the environment + is Unix, and use `unix' as the value.) + + What else is needed in `configure.in' depends on the requirements + of your tool, your intended test environments, and which + `configure' system you use. This example is a minimal + `configure.in' for use with Cygnus Configure. (For an alternative + based on the FSF `autoconf' system, see the `calc' example + distributed with DejaGnu.) Replace EXAMPLE with the name of your + program: + + # This file is a shell script fragment + # for use with Cygnus configure. + + srctrigger="EXAMPLE.0" + srcname="The DejaGnu EXAMPLE tests" + + # per-host: + + # per-target: + + # everything defaults to unix for a target + target_abbrev=unix + + # post-target: + + 3. Create `Makefile.in', the source file used by `configure' to build + your `Makefile'. Its leading section should as usual contain the + values that `configure' may override: + + srcdir = . + prefix = /usr/local + + exec_prefix = $(prefix) + bindir = $(exec_prefix)/bin + libdir = $(exec_prefix)/lib + tooldir = $(libdir)/$(target_alias) + + datadir = $(exec_prefix)/lib/dejagnu + + RUNTEST = runtest + RUNTESTFLAGS = + FLAGS_TO_PASS = + + #### host, target, site specific Makefile frags come in here. + + This should be followed by the standard targets at your site. To + begin with, they need not do anything--for example, these + definitions will do: + + + all: + + info: + + install-info: + + install: + uninstall: + + clean: + -rm -f *~ core *.info* + + It is also a good idea to make sure your `Makefile' can rebuild + itself if `Makefile.in' changes, with a target like this (which + works for either Cygnus or FSF Configure): + + Makefile : $(srcdir)/Makefile.in $(host_makefile_frag) \ + $(target_makefile_frag) + $(SHELL) ./config.status + + You also need to include two targets important to DejaGnu: `check', + to run the tests, and `site.exp', to set up the Tcl copies of + configuration-dependent values. The `check' target must run + `runtest --tool EXAMPLE': + + check: site.exp all + $(RUNTEST) $(RUNTESTFLAGS) $(FLAGS_TO_PASS) \ + --tool EXAMPLE --srcdir $(srcdir) + + The `site.exp' target should usually set up (among other things!) a + Tcl variable for the name of your program: + + site.exp: ./config.status Makefile + @echo "Making a new config file..." + -@rm -f ./tmp? + @touch site.exp + + -@mv site.exp site.bak + @echo "## these variables are automatically\ + generated by make ##" > ./tmp0 + @echo "# Do not edit here. If you wish to\ + override these values" >> ./tmp0 + @echo "# add them to the last section" >> ./tmp0 + @echo "set host_os ${host_os}" >> ./tmp0 + @echo "set host_alias ${host_alias}" >> ./tmp0 + @echo "set host_cpu ${host_cpu}" >> ./tmp0 + @echo "set host_vendor ${host_vendor}" >> ./tmp0 + @echo "set target_os ${target_os}" >> ./tmp0 + @echo "set target_alias ${target_alias}" >> ./tmp0 + @echo "set target_cpu ${target_cpu}" >> ./tmp0 + @echo "set target_vendor ${target_vendor}" >> ./tmp0 + @echo "set host_triplet ${host_canonical}" >> ./tmp0 + @echo "set target_triplet ${target_canonical}">>./tmp0 + @echo "set tool binutils" >> ./tmp0 + @echo "set srcdir ${srcdir}" >> ./tmp0 + @echo "set objdir `pwd`" >> ./tmp0 + @echo "set EXAMPLENAME EXAMPLE" >> ./tmp0 + @echo "## All variables above are generated by\ + configure. Do Not Edit ##" >> ./tmp0 + @cat ./tmp0 > site.exp + @sed < site.bak \ + -e '1,/^## All variables above are.*##/ d' \ + >> site.exp + -@rm -f ./tmp? + + 4. Create a directory (in `testsuite/') called `config/': + + eg$ mkdir config + + 5. Make an init file in this directory; its name must start with the + `target_abbrev' value, so call it `config/unix.exp'. This is the + file that contains the target-dependent procedures; fortunately, + most of them do not have to do very much in order for `runtest' to + run. + + If EXAMPLE is not interactive, you can get away with this minimal + `unix.exp' to begin with: + + proc foo_exit {} {} + proc foo_version {} {} + + If EXAMPLE is interactive, however, you might as well define a + start routine *and invoke it* by using an init file like this: + + proc foo_exit {} {} + proc foo_version {} {} + + proc foo_start {} { + global EXAMPLENAME + spawn $EXAMPLENAME + expect { + -re "" {} + } + } + foo_start + + 6. Create a directory whose name begins with your tool's name, to + contain tests: + + eg$ mkdir EXAMPLE.0 + + 7. Create a sample test file in `EXAMPLE.0'. Its name must end with + `.exp'; you can use `first-try.exp' To begin with, just write + there a line of Tcl code to issue a message: + + send_user "Testing: one, two...\n" + + 8. Back in the `testsuite/' (top level) directory, run + + eg$ configure + + (You may have to specify more of a path, if a suitable `configure' + is not available in your execution path.) + + 9. You are now ready to triumphantly type `make check' or `runtest + --tool EXAMPLE'. You should see something like this: + + Test Run By rhl on Fri Jan 29 16:25:44 EST 1993 + + === EXAMPLE tests === + + Running ./EXAMPLE.0/first-try.exp ... + Testing: one, two... + + === EXAMPLE Summary === + + There is no output in the summary, because so far the example does + not call any of the procedures that establish a test outcome. + + 10. Begin writing some real tests. For an interactive tool, you should + probably write a real exit routine in fairly short order; in any + case, you should also write a real version routine soon. + + +File: dejagnu.info, Node: Adding Targets, Next: Porting, Prev: Adding Tools, Up: Extending + +Adding a target +=============== + + DejaGnu has some additional requirements for target support, beyond +the general-purpose provisions of Cygnus `configure'. `runtest' must +actively communicate with the target, rather than simply generating or +managing code for the target architecture. Therefore, each tool +requires an initialization module for each target. For new targets, you +must supply a few Tcl procedures to adapt DejaGnu to the target. This +permits DejaGnu itself to remain target independent. *Note +Initialization module: Init Module, for a discussion of the naming +conventions that enable DejaGnu to locate and use init files. + + Usually the best way to write a new initialization module is to edit +an existing initialization module; some trial and error will be +required. If necessary, you can use the `--debug' option to see what +is really going on. + + When you code an initialization module, be generous in printing +information controlled by the `verbose' procedure (*note DejaGnu +procedures: DejaGnu Builtins.). + + Most of the work is in getting the communications right. +Communications code (for several situations involving IP networks or +serial lines) is available in a DejaGnu library file, `lib/remote.exp'. +*Note DejaGnu Builtins: DejaGnu Builtins. + + If you suspect a communication problem, try running the connection +interactively from `expect'. (There are three ways of running `expect' +as an interactive interpreter. You can run `expect' with no arguments, +and control it completely interactively; or you can use `expect -i' +together with other command-line options and arguments; or you can run +the command `interpreter' from any `expect' procedure. Use `return' to +get back to the calling procedure (if any), or `return -tcl' to make +the calling procedure itself return to its caller; use `exit' or +end-of-file to leave `expect' altogether.) Run the program whose name +is recorded in `$connectmode', with the arguments in `$targetname', to +establish a connection. You should at least be able to get a prompt +from any target that is physically connected. + + +File: dejagnu.info, Node: Porting, Prev: Adding Targets, Up: Extending + +Porting to a new host +===================== + + The task of porting DejaGnu is basically that of porting Tcl and +`expect'. Tcl and `expect', as distributed with DejaGnu, both use +`autoconf'; they should port automatically to most Unix systems. + + Once Tcl and `expect' are ported, DejaGnu should run. Most system +dependencies are taken care of by using `expect' as the main command +shell. + + +File: dejagnu.info, Node: Installation, Next: Index, Prev: Extending, Up: Top + +Installing DejaGnu +****************** + + Once you have the DejaGnu source unpacked and available, you must +first configure the software to specify where it is to run (and the +associated defaults); then you can proceed to installing it. + +* Menu: + +* Configuring DejaGnu:: +* Installing DejaGnu:: + + +File: dejagnu.info, Node: Configuring DejaGnu, Next: Installing DejaGnu, Up: Installation + +Configuring the DejaGnu test driver +=================================== + + It is usually best to configure in a directory separate from the +source tree, specifying where to find the source with the optional +`--srcdir' option to `configure'. DejaGnu uses the GNU `autoconf' to +configure itself. For more info on using autoconf, read the GNU +autoconf manual. To configure, execute the `configure' program, no +other options are required. For an example, to configure in a seperate +tree for objects, execute the configure script from the source tree +like this: + + ../dejagnu-1.3/configure + + DejaGnu doesn't care at config time if it's for testing a native +system or a cross system. That is determined at runtime by using the +config files. + + You may also want to use the `configure' option `--prefix' to +specify where you want DejaGnu and its supporting code installed. By +default, installation is in subdirectories of `/usr/local', but you can +select any alternate directory ALTDIR by including `--prefix=ALTDIR' on +the `configure' command line. (This value is captured in the Makefile +variables `prefix' and `exec_prefix'.) + + Save for a small number of example tests, the DejaGnu distribution +itself does not include any test suites; these are available separately. +Test suites for the GNU compiler (testing both GCC and G++) and for the +GNU binary utilities are distributed in parallel with the DejaGnu +distribution (but packaged as separate files). The test suite for the +GNU debugger is distributed in parallel with each release of GDB +itself, starting with GDB 4.9. After configuring the top-level DejaGnu +directory, unpack and configure the test directories for the tools you +want to test; then, in each test directory, run `make' to build +auxiliary programs required by some of the tests. + + +File: dejagnu.info, Node: Installing DejaGnu, Prev: Configuring DejaGnu, Up: Installation + +Installing DejaGnu +================== + + To install DejaGnu in your filesystem (either in `/usr/local', or as +specified by your `--prefix' option to `configure'), execute + + eg$ make install + +`make install' does these things for DejaGnu: + + 1. Look in the path specified for executables (`$exec_prefix') for + directories called `lib' and `bin'. If these directories do not + exist, `make install' creates them. + + 2. Create another directory in the `lib' directory, called `dejagnu'. + + 3. Copy the `runtest' shell script into `$exec_prefix/bin'. + + 4. Copy all the library files (used to support the framework) into + `$exec_prefix/lib/dejagnu'. + + 5. Copy `runtest.exp' into `$exec_prefix/lib/dejagnu'. This is the + main Tcl code implementing DejaGnu. + + + Each test suite collection comes with simple installation +instructions in a `README' file; in general, the test suites are +designed to be unpacked in the source directory for the corresponding +tool, and extract into a directory called `testsuite'. + + +File: dejagnu.info, Node: Index, Prev: Installation, Up: Top + +Index +***** + +* Menu: + +* --all (runtest option): Invoking runtest. +* --baud (runtest option): Invoking runtest. +* --build (runtest option): Invoking runtest. +* --connect (runtest option): Invoking runtest. +* --debug (runtest option): Invoking runtest. +* --help (runtest option): Invoking runtest. +* --host (runtest option): Invoking runtest. +* --name (runtest option): Invoking runtest. +* --objdir (runtest option): Invoking runtest. +* --outdir (runtest option): Invoking runtest. +* --reboot (runtest option): Invoking runtest. +* --srcdir (runtest option): Invoking runtest. +* --strace (runtest option): Invoking runtest. +* --target (runtest option): Invoking runtest. +* --tool (runtest option): Invoking runtest. +* --tool and naming conventions: Names. +* --verbose (runtest option): Invoking runtest. +* --version (runtest option): Invoking runtest. +* -b (runtest option): Invoking runtest. +* -V (runtest option): Invoking runtest. +* -v (runtest option): Invoking runtest. +* .exp: Overview. +* absolute PATH: utils.exp. +* adding a target: Adding Targets. +* adding a test case: Adding. +* all_flag: Config Values. +* ambiguity, required for POSIX: Posix. +* archive object files: target.exp. +* auxiliary files, building: Running Tests. +* auxiliary programs: Configuring DejaGnu. +* auxiliary test programs: Invoking runtest. +* baud: Config Values. +* baud rate, specifying: Invoking runtest. +* bps, specifying: Invoking runtest. +* bt: debugger.exp. +* bug number: Variables. +* bug number, extra: Variables. +* bug_id: Variables. +* build config name, changing: Invoking runtest. +* build host configuration test: framework.exp. +* build_triplet: Config Values. +* built in procedures, DejaGnu: DejaGnu Builtins. +* C torture test: Writing. +* canadian cross configuration test: framework.exp. +* cancelling expected failure: framework.exp. +* check makefile target: Running Tests. +* clear_xfail CONFIG: framework.exp. +* Closing a remote connection: remote.exp. +* command line option variables: Config Values. +* command line options: Invoking runtest. +* command line Tcl variable definition: Invoking runtest. +* communications procedures: remote.exp. +* comp_output: Variables. +* comparing files: utils.exp. +* compile a file: target.exp. +* configuration dependent defaults: Config Values. +* configuring DejaGnu: Installation. +* connecting to target: Invoking runtest. +* connectmode: Config Values. +* converting relative paths to absolute: utils.exp. +* Core Internal Procedures: framework.exp. +* cross configuration: Running Tests. +* current test subdirectory: Variables. +* dbg.log file: Invoking runtest. +* debug log: Debug. +* debug log for test cases: Invoking runtest. +* debugger.exp: debugger.exp. +* debugging a test case: Debugging. +* default options, controlling: Config Values. +* defaults, option: Config Values. +* defaults, setting in init file: Init Module. +* DejaGnu configuration: Installation. +* DejaGnu test driver: Invoking runtest. +* DejaGnu, the name: Design Goals. +* Delete a watchpoint.: debugger.exp. +* design goals: Design Goals. +* detailed log: Detail. +* diff FILENAME FILENAME: utils.exp. +* directories matching a pattern: utils.exp. +* directory names and --tool: Names. +* download a file: remote.exp. +* download FILE [ SPAWNID ]: remote.exp. +* download, tip: remote.exp. +* dumplocals *expr*: debugger.exp. +* dumprocs *expr*: debugger.exp. +* dumpvars *expr*: debugger.exp. +* dumpwatch *expr*: debugger.exp. +* echo.exp: Sample Test. +* ERROR <1>: framework.exp. +* ERROR: Invoking runtest. +* example: Sample Test. +* exec_output: Variables. +* exec_prefix, configure options.: Configuring DejaGnu. +* execute_anywhere *cmdline*: target.exp. +* executing commands remotely: target.exp. +* existing tests, running: Running Tests. +* exit code from runtest: Invoking runtest. +* exit procedure, tested tools: Target Dependent. +* exit_remote_shell SPAWNID: remote.exp. +* exp filename suffix: Names. +* expect internal tracing: Invoking runtest. +* expect script names: Overview. +* expect scripting language: Tcl and Expect. +* expect_out(buffer): Variables. +* expected failure <1>: framework.exp. +* expected failure: Invoking runtest. +* expected failure, cancelling: framework.exp. +* FAIL <1>: Invoking runtest. +* FAIL: Posix. +* fail "STRING": framework.exp. +* failing test, expected: Invoking runtest. +* failing test, unexpected: Invoking runtest. +* failure, expected: framework.exp. +* failure, POSIX definition: Posix. +* filename for test files: Names. +* files matching a pattern: utils.exp. +* find DIR PATTERN: utils.exp. +* findfile: Init Module. +* finding file differences: utils.exp. +* future directions: Future Directions. +* gdb.t00/echo.exp: Sample Test. +* get_warning_threshold: framework.exp. +* getdirs DIR: utils.exp. +* getdirs DIR PATTERN: utils.exp. +* getenv VAR: utils.exp. +* getting environment variables: utils.exp. +* GNATS bug number: Variables. +* Granlund, Torbjorn: Writing. +* grep FILENAME REGEXP: utils.exp. +* grep FILENAME REGEXP line: utils.exp. +* help with runtest: Invoking runtest. +* hints on test case writing: Hints. +* host config name, changing: Invoking runtest. +* host configuration test: framework.exp. +* host, explained: Installation. +* host_triplet: Config Values. +* ignoretests: Config Values. +* init file name: Init Module. +* init file, purpose: Init Module. +* initialization: Init Module. +* input files: Input Files. +* installed tool name: framework.exp. +* installing DejaGnu: Installing DejaGnu. +* internal details: Internals. +* invoking: Invoking runtest. +* IP network procedures: remote.exp. +* isbuild "HOST": framework.exp. +* ishost "HOST": framework.exp. +* isnative: framework.exp. +* istarget "TARGET": framework.exp. +* kermit PORT BPS: remote.exp. +* kermit, remote testing via: Invoking runtest. +* last command output: Variables. +* lib/debugger.exp: debugger.exp. +* lib/remote.exp: remote.exp. +* lib/target.exp: target.exp. +* lib/utils.exp: utils.exp. +* Libes, Don: Tcl and Expect. +* list, pruning: utils.exp. +* list_targets: target.exp. +* lists supported targets: target.exp. +* load library file: framework.exp. +* load procedure, tested tools: Target Dependent. +* load_lib "LIBRARY-FILE": framework.exp. +* local site.exp: Local Config File. +* log files, where to write: Invoking runtest. +* Lupton, Robert: Adding Tools. +* make builds part of tests: Configuring DejaGnu. +* make check: Running Tests. +* master site.exp: Master Config File. +* Menapace, Julia: Design Goals. +* mondfe: Cross Targets. +* mondfe, remote testing via: Invoking runtest. +* name "DejaGnu": Design Goals. +* name for remote test machine: Invoking runtest. +* name transformations: framework.exp. +* name, initialization module: Init Module. +* naming conventions: Names. +* naming tests to run: Invoking runtest. +* native configuration: Running Tests. +* native configuration test: framework.exp. +* network (IP) procedures: remote.exp. +* NOTE <1>: framework.exp. +* NOTE: Invoking runtest. +* note "STRING": framework.exp. +* objdir: Config Values. +* object directory: Invoking runtest. +* Opening a remote connection: remote.exp. +* operating principles: Internals. +* option defaults: Config Values. +* option list, runtest: Invoking runtest. +* options: Invoking runtest. +* options for runtest, common: Running Tests. +* options, Tcl variables for defaults: Config Values. +* order of tests: Names. +* Ousterhout, John K.: Tcl and Expect. +* outdir: Config Values. +* output directory: Invoking runtest. +* output files: Output Files. +* output, additional: Invoking runtest. +* overriding site.exp: Customizing. +* overview: Overview. +* PASS <1>: Invoking runtest. +* PASS: Posix. +* pass "STRING": framework.exp. +* path lookup: utils.exp. +* pattern match, directory: utils.exp. +* pattern match, filenames: utils.exp. +* perror "STRING NUMBER": framework.exp. +* personal config site.exp: Personal Config File. +* pop_host: target.exp. +* pop_target: target.exp. +* porting to a new host: Porting. +* POSIX conformance: Posix. +* prefix, configure options: Configuring DejaGnu. +* print *var*: debugger.exp. +* Print a backtrace: debugger.exp. +* Print global variable values: debugger.exp. +* Print local variable value: debugger.exp. +* Print procedure bodies: debugger.exp. +* Print watchpoints: debugger.exp. +* Printing variable values: debugger.exp. +* PRMS bug number: Variables. +* prms_id: Variables. +* problem, detected by test case: Invoking runtest. +* prune LIST PATTERN: utils.exp. +* prune_system_crud SYSTEM TEXT: utils.exp. +* pruning system output, examining program output: utils.exp. +* psource FILENAME: utils.exp. +* push_host *name*: target.exp. +* push_target *name*: target.exp. +* quit: debugger.exp. +* Quiting DejaGnu: debugger.exp. +* ranlib a file: target.exp. +* reboot: Config Values. +* rebooting remote targets: Invoking runtest. +* regular expression, file contents: utils.exp. +* remote connection procedures: remote.exp. +* remote connection, ending: remote.exp. +* remote test machine name: Invoking runtest. +* remote testbed, connecting to: Invoking runtest. +* remote testing: Cross Targets. +* remote testing via kermit: Invoking runtest. +* remote testing via mondfe: Invoking runtest. +* remote testing via rlogin: Invoking runtest. +* remote testing via rsh: Invoking runtest. +* remote testing via telnet: Invoking runtest. +* remote testing via tip: Invoking runtest. +* remote.exp: remote.exp. +* remote_close SHELLID: remote.exp. +* remote_open TYPE: remote.exp. +* rlogin HOSTNAME: remote.exp. +* rlogin, remote testing via: Invoking runtest. +* rsh HOSTNAME: remote.exp. +* rsh, remote testing via: Invoking runtest. +* running: Invoking runtest. +* running tests: Running Tests. +* runtest description: Invoking runtest. +* runtest exit code: Invoking runtest. +* runtest option defaults: Config Values. +* runtest option list: Invoking runtest. +* runtest, listing options: Invoking runtest. +* runtest, most common options: Running Tests. +* runtest, variable defns on cmdline: Invoking runtest. +* runtest.exp: Internals. +* runtest_file_p RUNTESTS TESTCASE: utils.exp. +* runtests: Config Values. +* searching file contents: utils.exp. +* selecting a range of tests <1>: utils.exp. +* selecting a range of tests: Invoking runtest. +* selecting tests for a tool: Invoking runtest. +* serial download, tip: remote.exp. +* serial line connection, kermit: remote.exp. +* serial line connection, tip: remote.exp. +* set current host: target.exp. +* set current target: target.exp. +* set_warning_threshold THRESHOLD: framework.exp. +* setenv VAR VAL: utils.exp. +* setting defaults for DejaGnu variables: Config Values. +* setting environment variables: utils.exp. +* setting up targets: Init Module. +* setup_xfail "CONFIG [BUGID]": framework.exp. +* site.exp: Customizing. +* site.exp for all of DejaGnu: Master Config File. +* site.exp for each person: Personal Config File. +* site.exp for each tool: Local Config File. +* site.exp, multiple: Customizing. +* slay NAME: utils.exp. +* slaying processes: utils.exp. +* source directory: Invoking runtest. +* sourcing Tcl files: utils.exp. +* special variables: Variables. +* specifying target name: Invoking runtest. +* specifying the build config name: Invoking runtest. +* specifying the host config name: Invoking runtest. +* specifying the target configuration: Invoking runtest. +* srcdir: Config Values. +* standard conformance: POSIX 1003.3: Posix. +* start procedure, tested tools: Target Dependent. +* starting interactive tools: Init Module. +* starting the tcl debugger: Invoking runtest. +* subdir: Variables. +* success, POSIX definition: Posix. +* successful test: Invoking runtest. +* successful test, unexpected: Invoking runtest. +* suffix, expect scripts: Overview. +* summary log: Summary. +* target configuration test: framework.exp. +* target configuration, specifying: Invoking runtest. +* target dependent procedures: Target Dependent. +* target machine name: Invoking runtest. +* target, explained: Installation. +* target.exp: target.exp. +* target_triplet: Config Values. +* targetname: Config Values. +* targets: Cross Targets. +* tcl: Tcl and Expect. +* tcl debugger: Invoking runtest. +* Tcl variables for option defaults: Config Values. +* Tcl variables, defining for runtest: Invoking runtest. +* TCLVAR=VALUE: Invoking runtest. +* telnet HOSTNAME PORT: remote.exp. +* telnet, remote testing via: Invoking runtest. +* terminating remote connection: remote.exp. +* test case cannot run: Invoking runtest. +* test case messages: Invoking runtest. +* test case warnings: Invoking runtest. +* test case, debugging: Debugging. +* test case, declaring ambiguity: framework.exp. +* test case, declaring failure: framework.exp. +* test case, declaring no support: framework.exp. +* test case, declaring no test: framework.exp. +* test case, declaring success: framework.exp. +* test case, ERROR in: framework.exp. +* test case, expecting failure: framework.exp. +* test case, informational messages: framework.exp. +* test case, WARNING in: framework.exp. +* test case, WARNING threshold: framework.exp. +* test case, writing: Tests. +* test cases, debug log: Invoking runtest. +* test directories, naming: Names. +* test filename: Names. +* test output, displaying all: Invoking runtest. +* test programs, auxiliary: Invoking runtest. +* test suite distributions: Configuring DejaGnu. +* test, failing: Invoking runtest. +* test, successful: Invoking runtest. +* test, unresolved outcome: Invoking runtest. +* test, unsupported: Invoking runtest. +* tests, running: Running Tests. +* tests, running order: Names. +* tests, running specifically <1>: utils.exp. +* tests, running specifically: Invoking runtest. +* TET: Posix. +* tip PORT: remote.exp. +* tip, remote testing via: Invoking runtest. +* tip_download SPAWNID FILE: remote.exp. +* tool: Config Values. +* tool command language: Tcl and Expect. +* tool initialization: Init Module. +* tool name, as installed: framework.exp. +* tool names and naming conventions: Names. +* TOOL_exit: Target Dependent. +* TOOL_load: Target Dependent. +* TOOL_start: Target Dependent. +* TOOL_version: Target Dependent. +* tracelevel: Config Values. +* tracing Tcl commands: Invoking runtest. +* transform: Init Module. +* transform "TOOLNAME": framework.exp. +* transform tool name: framework.exp. +* turning on output: Invoking runtest. +* unexpected success: Invoking runtest. +* UNRESOLVED <1>: Invoking runtest. +* UNRESOLVED: Posix. +* unresolved "STRING": framework.exp. +* unset current host: target.exp. +* unset current target: target.exp. +* unsetenv VAR: utils.exp. +* unsetting environment variables: utils.exp. +* UNSUPPORTED <1>: Invoking runtest. +* UNSUPPORTED: Posix. +* unsupported "STRING": framework.exp. +* unsupported test: Invoking runtest. +* UNTESTED <1>: Invoking runtest. +* UNTESTED: Posix. +* untested "STRING": framework.exp. +* untested properties: Invoking runtest. +* utilities, loading from init file: Init Module. +* utils.exp: utils.exp. +* variables for all tests: Variables. +* variables for option defaults: Config Values. +* variables of DejaGnu, defaults: Customizing. +* verbose: Config Values. +* verbose [-log] [-n] [-] "STRING" NUMBER: framework.exp. +* verbose builtin function: framework.exp. +* version numbers: Invoking runtest. +* version procedure, tested tools: Target Dependent. +* VxWorks, link with -r: Cross Targets. +* WARNING <1>: framework.exp. +* WARNING: Invoking runtest. +* warning "STRING NUMBER": framework.exp. +* Watch when a variable is read: debugger.exp. +* Watch when a variable is unset: debugger.exp. +* Watch when a variable is written: debugger.exp. +* watchdel *watch*: debugger.exp. +* watchread *var*: debugger.exp. +* watchunset *var*: debugger.exp. +* watchwrite *var*: debugger.exp. +* What is New: What is New. +* which BINARY: utils.exp. +* writing a test case: Tests. +* XFAIL <1>: Invoking runtest. +* XFAIL: Posix. +* XFAIL, avoiding for POSIX: Posix. +* XFAIL, producing: framework.exp. +* XPASS: Invoking runtest. +* XPASS, producing: framework.exp. + + diff --git a/contrib/bluegnu2.0.3/install-sh b/contrib/bluegnu2.0.3/install-sh new file mode 100755 index 0000000..89fc9b0 --- /dev/null +++ b/contrib/bluegnu2.0.3/install-sh @@ -0,0 +1,238 @@ +#! /bin/sh +# +# install - install a program, script, or datafile +# This comes from X11R5. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. +# + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +tranformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +else + true +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + else + instcmd=mkdir + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' +' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0 diff --git a/contrib/bluegnu2.0.3/mkinstalldirs b/contrib/bluegnu2.0.3/mkinstalldirs new file mode 100755 index 0000000..0801ec2 --- /dev/null +++ b/contrib/bluegnu2.0.3/mkinstalldirs @@ -0,0 +1,32 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman +# Created: 1993-05-16 +# Last modified: 1994-03-25 +# Public domain + +errstatus=0 + +for file in ${1+"$@"} ; do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d in ${1+"$@"} ; do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" 1>&2 + mkdir "$pathcomp" || errstatus=$? + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# mkinstalldirs ends here diff --git a/contrib/bluegnu2.0.3/runtest b/contrib/bluegnu2.0.3/runtest new file mode 100755 index 0000000..a80d1ea --- /dev/null +++ b/contrib/bluegnu2.0.3/runtest @@ -0,0 +1,90 @@ +#!/bin/sh +# +# runtest -- basically all this script does is find the proper expect shell +# and then +# run BlueGnu. +# + +# +# Get the execution path to this script and the current directory. +# +execpath=`echo ${0-.} | sed -e 's@/[^/]*$@@'` +# rootme=`pwd` + +# +# get the name by which bluegnu was invoked and extract the config triplet +# +bluegnu=`echo ${0-.} | sed -e 's@^.*/@@'` +target=`echo $bluegnu | sed -e 's/-runtest$//'` +if [ "$target" != runtest ] ; then + target="--target ${target}" +else + target="" +fi + +# +# Find the right expect binary to use. If a variable EXPECT exists, +# it takes precedence over all other tests. Otherwise look for a freshly +# built one, and then use one in the path. +# +if [ x"$EXPECT" != x ] ; then + expectbin=$EXPECT +else + if [ -x "$execpath/expect" ] ; then + expectbin=$execpath/expect + else + expectbin=expect + fi +fi + +# just to be safe... +if [ -z "$expectbin" ]; then + echo "ERROR: No expect shell found" + exit 1 +fi + +# +# Extract a few options from the option list. +# +verbose=0 +debug="" +for a in "$@" ; do + case $a in + -v|--v|-verb*|--verb*) verbose=`expr $verbose + 1`;; + -D0|--D0) debug="-D 0" ;; + -D1|--D1) debug="-D 1" ;; + esac +done + +if expr $verbose \> 0 > /dev/null ; then + echo Expect binary is $expectbin +fi + +# +# find runtest.exp. First we look in it's installed location, otherwise +# start if from the source tree. +# +for i in $execpath/../lib/bluegnu $execpath ; do + if expr $verbose \> 1 > /dev/null ; then + echo Looking for $i/runtest.exp. + fi + if [ -f $i/runtest.exp ] ; then + runpath=$i + if expr $verbose \> 0 > /dev/null ; then + echo Using $i/runtest.exp as main test driver + fi + fi +done +# check for an environment variable +if [ x"$BLUEGNULIBS" != x ] ; then + runpath=$BLUEGNULIBS + if expr $verbose \> 0 > /dev/null ; then + echo Using $BLUEGNULIBS/runtest.exp as main test driver + fi +fi +if [ x"$runpath" = x ] ; then + echo "ERROR: runtest.exp does not exist." + exit 1 +fi + +exec $expectbin $debug -- $runpath/runtest.exp $target ${1+"$@"} diff --git a/contrib/bluegnu2.0.3/runtest.exp b/contrib/bluegnu2.0.3/runtest.exp new file mode 100755 index 0000000..b436e2d --- /dev/null +++ b/contrib/bluegnu2.0.3/runtest.exp @@ -0,0 +1,1146 @@ +# Test Framework Driver +# Copyright (C) 92, 93, 94, 95, 1996 Free Software Foundation, Inc. +# Copyright (C) 1998 jotOmega dsc, 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 of the License, 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., 675 Mass Ave, Cambridge, MA 02139, USA. + +# Please email any bugs, comments, and/or additions to this file to: +# + +# This file was written by Rob Savoye. (rob@welcomehome.org) +# and modified by Jan-Willem Neurdenburg. (neurdenburgj@acm.org) + +set frame_version 1.3 +if ![info exists argv0] { + send_error "Must use a version of Expect greater than 5.0\n" + exit 1 +} + +# +# trap some signals so we know whats happening. These definitions are only +# temporary until we read in the library stuff +# +trap { send_user "\nterminated\n"; exit 1 } SIGTERM +trap { send_user "\ninterrupted by user\n"; exit 1 } SIGINT +trap { send_user "\nsegmentation violation\n"; exit 1 } SIGSEGV +trap { send_user "\nsigquit\n"; exit 1 } SIGQUIT + +# +# Initialize a few global variables used by all tests. +# `reset_vars' resets several of these, we define them here to document their +# existence. In fact, it would be nice if all globals used by some interface +# of bluegnu proper were documented here. +# +# Keep these all lowercase. Interface variables used by the various +# testsuites (eg: the gcc testsuite) should be in all capitals +# (eg: TORTURE_OPTIONS). +# +set mail_logs 0 ;# flag for mailing of summary and diff logs +set psum_file "latest" ;# file name of previous summary to diff against +set testcnt 0 ;# number of testcases that ran +set passcnt 0 ;# number of testcases that passed +set failcnt 0 ;# number of testcases that failed +set xfailcnt 0 ;# number of testcases expected to fail which did +set xpasscnt 0 ;# number of testcases that passed unexpectedly +set warncnt 0 ;# number of warnings +set errcnt 0 ;# number of errors +set unsupportedcnt 0 ;# number of testcases that can't run +set unresolvedcnt 0 ;# number of testcases whose result is unknown +set untestedcnt 0 ;# number of untested testcases +set exit_status 0 ;# exit code returned by this program +set xfail_flag 0 +set xfail_prms 0 +set sum_file "" ;# name of the file that contains the summary log +set base_dir "" ;# the current working directory +set logname "" ;# the users login name +set passwd "" +set prms_id 0 ;# GNATS prms id number +set bug_id 0 ;# optional bug id number +set dir "" ;# temp variable for directory names +set srcdir "." ;# source directory containing the test suite +set ignoretests "" ;# list of tests to not execute +set objdir "." ;# directory where test case binaries live +set makevars "" ;# FIXME: Is this used anywhere? +set reboot 0 +set configfile site.exp ;# (local to this file) +set multipass "" ;# list of passes and var settings +set target_abbrev "unix" ;# environment (unix, sim, vx, etc.). +set errno ""; ;# +# +# set communication parameters here +# +set netport "" +set targetname "" +set connectmode "" +set serialport "" +set baud "" +# +# These describe the host and target environments. +# +set build_triplet "" ;# type of architecture to run tests on +set build_os "" ;# type of os the tests are running on +set build_vendor "" ;# vendor name of the OS or workstation the test are running on +set build_cpu "" ;# type of the cpu tests are running on +set host_triplet "" ;# type of architecture to run tests on, sometimes remotely +set host_os "" ;# type of os the tests are running on +set host_vendor "" ;# vendor name of the OS or workstation the test are running on +set host_cpu "" ;# type of the cpu tests are running on +set target_triplet "" ;# type of architecture to run tests on, final remote +set target_os "" ;# type of os the tests are running on +set target_vendor "" ;# vendor name of the OS or workstation the test are running on +set target_cpu "" ;# type of the cpu tests are running on +set target_alias "" ;# standard abbreviation of target + +# +# some convenience abbreviations +# +if ![info exists hex] { + set hex "0x\[0-9A-Fa-f\]+" +} +if ![info exists decimal] { + set decimal "\[0-9\]+" +} + +# +# set the base dir (current working directory) +# +set base_dir [pwd] + +# +# These are tested in case they are not initialized in $configfile. They are +# tested here instead of the init module so they can be overridden by command +# line options. +# +if ![info exists all_flag] { + set all_flag 0 +} +if ![info exists binpath] { + set binpath "" +} +if ![info exists debug] { + set debug 0 +} +if ![info exists options] { + set options "" +} +if ![info exists outdir] { + set outdir "." +} +if ![info exists reboot] { + set reboot 1 +} +if ![info exists all_runtests] { + # FIXME: Can we create an empty array? + # we don't have to (JWN 20 March 1998) + #set all_runtests(empty) "" +} +if ![info exists tracelevel] { + set tracelevel 0 +} +if ![info exists verbose] { + set verbose 0 +} + +# +# verbose [-n] [-log] [--] message [level] +# +# Print MESSAGE if the verbose level is >= LEVEL. +# The default value of LEVEL is 1. +# "-n" says to not print a trailing newline. +# "-log" says to add the text to the log file even if it won't be printed. +# Note that the apparent behaviour of `send_user' dictates that if the message +# is printed it is also added to the log file. +# Use "--" if MESSAGE begins with "-". +# +# This is defined here rather than in framework.exp so we can use it +# while still loading in the support files. +# +proc verbose { args } { + global verbose + set newline 1 + set logfile 0 + + set i 0 + if { [string index [lindex $args 0] 0] == "-" } { + for { set i 0 } { $i < [llength $args] } { incr i } { + if { [lindex $args $i] == "--" } { + incr i + break + } elseif { [lindex $args $i] == "-n" } { + set newline 0 + } elseif { [lindex $args $i] == "-log" } { + set logfile 1 + } elseif { [string index [lindex $args $i] 0] == "-" } { + clone_output "ERROR: verbose: illegal argument: [lindex $args $i]" + return + } else { + break + } + } + if { [llength $args] == $i } { + clone_output "ERROR: verbose: nothing to print" + return + } + } + + set level 1 + if { [llength $args] > $i + 1 } { + set level [lindex $args [expr $i+1]] + } + set message [lindex $args $i] + + if { $verbose >= $level } { + # There is no need for the "--" argument here, but play it safe. + # We assume send_user also sends the text to the log file (which + # appears to be the case though the docs aren't clear on this). + if { $newline } { + send_user -- "$message\n" + } else { + send_user -- "$message" + } + } elseif { $logfile } { + if { $newline } { + send_log "$message\n" + } else { + send_log "$message" + } + } +} + +# +# Transform a tool name to get the installed name. +# target_triplet is the canonical target name. target_alias is the +# target name used when configure was run. +# +proc transform { name } { + global target_triplet + global target_alias + global host_triplet + + if [string match $target_triplet $host_triplet] { + return $name + } + if [string match "native" $target_triplet] { + return $name + } + if [string match "" $target_triplet] { + return $name + } else { + set tmp ${target_alias}-${name} + verbose "Transforming $name to $tmp" + return $tmp + } +} + +# +# findfile arg0 [arg1] [arg2] +# +# Find a file and see if it exists. If you only care about the false +# condition, then you'll need to pass a null "" for arg1. +# arg0 is the filename to look for. If the only arg, +# then that's what gets returned. If this is the +# only arg, then if it exists, arg0 gets returned. +# if it doesn't exist, return only the prog name. +# arg1 is optional, and it's what gets returned if +# the file exists. +# arg2 is optional, and it's what gets returned if +# the file doesn't exist. +# +proc findfile { args } { + # look for the file + verbose "Seeing if [lindex $args 0] exists." 2 + if [file exists [lindex $args 0]] { + if { [llength $args] > 1 } { + verbose "Found file, returning [lindex $args 1]" + return [lindex $args 1] + } else { + verbose "Found file, returning [lindex $args 0]" + return [lindex $args 0] + } + } else { + if { [llength $args] > 2 } { + verbose "Didn't find file, returning [lindex $args 2]" + return [lindex $args 2] + } else { + verbose "Didn't find file, returning [file tail [lindex $args 0]]" + return [transform [file tail [lindex $args 0]]] + } + } +} + +# +# load_file [-1] [--] file1 [ file2 ... ] +# +# Utility to source a file. All are sourced in order unless the flag "-1" +# is given in which case we stop after finding the first one. +# The result is 1 if a file was found, 0 if not. +# If a tcl error occurs while sourcing a file, we print an error message +# and exit. +# +# ??? Perhaps add an optional argument of some descriptive text to add to +# verbose and error messages (eg: -t "library file" ?). +# +proc load_file { args } { + set i 0 + set only_one 0 + if { [lindex $args $i] == "-1" } { + set only_one 1 + incr i + } + if { [lindex $args $i] == "--" } { + incr i + } + + set found 0 + foreach file [lrange $args $i end] { + verbose "Looking for $file" 2 + if [file exists $file] { + set found 1 + verbose "Found $file" + if { [catch "uplevel #0 source $file"] == 1 } { + send_error "ERROR: tcl error sourcing $file.\n" + global errorInfo + if [info exists errorInfo] { + send_error "$errorInfo\n" + } + exit 1 + } + if $only_one { + break + } + } + } + return $found +} + +# +# Parse the arguments the first time looking for these. We will ultimately +# parse them twice. Things are complicated because: +# - we want to parse --verbose early on +# - we don't want config files to override command line arguments +# (eg: $base_dir/$configfile vs --host/--target; $BLUEGNU vs --baud, +# --connectmode, and --name) +# - we need some command line arguments before we can process some config files +# (eg: --objdir before $objdir/$configfile, --host/--target before $BLUEGNU) +# The use of `arg_host_triplet' and `arg_target_triplet' lets us avoid parsing +# the arguments three times. +# + +set arg_host_triplet "" +set arg_target_triplet "" +set arg_build_triplet "" +set argc [ llength $argv ] +for { set i 0 } { $i < $argc } { incr i } { + set option [lindex $argv $i] + + # make all options have two hyphens + switch -glob -- $option { + "--*" { + } + "-*" { + set option "-$option" + } + } + + # split out the argument for options that take them + switch -glob -- $option { + "--*=*" { + set optarg [lindex [split $option =] 1] + } + "--ba*" - + "--bu*" - + "--co*" - + "--ho*" - + "--i*" - + "--m*" - + "--n*" - + "--ob*" - + "--ou*" - + "--sr*" - + "--st*" - + "--ta*" - + "--to*" { + incr i + set optarg [lindex $argv $i] + } + } + + switch -glob -- $option { + "--bu*" { # (--build) the build host configuration + set arg_build_triplet $optarg + continue + } + + "--ho*" { # (--host) the host configuration + set arg_host_triplet $optarg + continue + } + + "--ob*" { # (--objdir) where the test case object code lives + set objdir $optarg + continue + } + + "--sr*" { # (--srcdir) where the testsuite source code lives + set srcdir $optarg + continue + } + + "--ta*" { # (--target) the target configuration + set arg_target_triplet $optarg + continue + } + + "--to*" { # (--tool) specify tool name + set tool $optarg + continue + } + + "--v" - + "--verb*" { # (--verbose) verbose output + incr verbose + continue + } + } +} +verbose "Verbose level is $verbose" + +# +# get the users login name +# +if [string match "" $logname] { + if [info exists env(USER)] { + set logname $env(USER) + } else { + if [info exists env(LOGNAME)] { + set logname $env(LOGNAME) + } else { + # try getting it with whoami + catch "set logname [exec whoami]" tmp + if [string match "*couldn't find*to execute*" $tmp] { + # try getting it with who am i + unset tmp + catch "set logname [exec who am i]" tmp + if [string match "*Command not found*" $tmp] { + send_user "ERROR: couldn't get the users login name\n" + set logname "Unknown" + } else { + set logname [lindex [split $logname " !"] 1] + } + } + } + } +} +verbose "Login name is $logname" + +# +# Begin sourcing the config files. +# All are sourced in order. +# +# Search order: +# $HOME/.bluegnurc -> $base_dir/$configfile -> $objdir/$configfile +# -> installed -> $BLUEGNU +# +# ??? It might be nice to do $HOME last as it would allow it to be the +# ultimate override. Though at present there is still $BLUEGNU. +# +# For the normal case, we rely on $base_dir/$configfile to set +# host_triplet and target_triplet. +# + +load_file ~/.bluegnurc $base_dir/$configfile + +# +# If objdir didn't get set in $base_dir/$configfile, set it to $base_dir. +# Make sure we source $objdir/$configfile in case $base_dir/$configfile doesn't +# exist and objdir was given on the command line. +# + +if [expr [string match "." $objdir] || [string match $srcdir $objdir]] { + set objdir $base_dir +} else { + load_file $objdir/$configfile +} +verbose "Using test sources in $srcdir" +verbose "Using test binaries in $objdir" + +set execpath [file dirname $argv0] +set libdir [file dirname $execpath]/bluegnu +if [info exists env(BLUEGNULIBS)] { + set libdir $env(BLUEGNULIBS) +} +verbose "Using $libdir to find libraries" + +# +# If the host or target was given on the command line, override the above +# config files. We allow $BLUEGNU to massage them though in case it would +# ever want to do such a thing. +# +if { $arg_host_triplet != "" } { + set host_triplet $arg_host_triplet +} +if { $arg_build_triplet != "" } { + set build_triplet $arg_build_triplet +} + +# if we only specify --host, then that must be the build machne too, and we're +# stuck using the old functionality of a simple cross test +if [expr { $build_triplet == "" && $host_triplet != "" } ] { + set build_triplet $host_triplet +} +# if we only specify --build, then we'll use that as the host too +if [expr { $build_triplet != "" && $host_triplet == "" } ] { + set host_triplet $build_triplet +} +unset arg_host_triplet arg_build_triplet + +# +# If the build machine type hasn't been specified by now, use config.guess. +# + +if [expr { $build_triplet == "" && $host_triplet == ""} ] { + # find config.guess + foreach dir "$libdir $libdir/.. $srcdir/.. $srcdir/../.." { + verbose "Looking for $dir" 2 + if [file exists $dir/config.guess] { + set config_guess $dir/config.guess + verbose "Found $dir/config.guess" + break + } + } + + # get the canonical config name + if ![info exists config_guess] { + send_error "ERROR: Couldn't guess configuration.\n" + exit 1 + } + catch "exec $config_guess" build_triplet + case $build_triplet in { + { "No uname command or uname output not recognized" "Unable to guess system type" } { + verbose "WARNING: Uname output not recognized" + set build_triplet unknown + } + } + verbose "Assuming build host is $build_triplet" + if { $host_triplet == "" } { + set host_triplet $build_triplet + } + +} + +# +# Figure out the target. If the target hasn't been specified, then we have to assume +# we are native. +# +if { $arg_target_triplet != "" } { + set target_triplet $arg_target_triplet +} elseif { $target_triplet == "" } { + set target_triplet $build_triplet + verbose "Assuming native target is $target_triplet" 2 +} +unset arg_target_triplet +# +# Default target_alias to target_triplet. +# +if ![info exists target_alias] { + set target_alias $target_triplet +} + +# +# Find and load the global config file if it exists. +# The global config file is used to set the connect mode and other +# parameters specific to each particular target. +# These files assume the host and target have been set. +# + +if { [load_file -- $libdir/$configfile] == 0 } { + # If $BLUEGNU isn't set either then there isn't any global config file. + # Warn the user as there really should be one. + if { ! [info exists env(BLUEGNU)] } { + send_error "WARNING: Couldn't find the global config file.\n" + } +} + +if [info exists env(BLUEGNU)] { + if { [load_file -- $env(BLUEGNU)] == 0 } { + # It may seem odd to only issue a warning if there isn't a global + # config file, but issue an error if $BLUEGNU is erroneously defined. + # Since $BLUEGNU is set there is *supposed* to be a global config file, + # so the current behaviour seems reasonable. + send_error "ERROR: global config file $env(BLUEGNU) not found.\n" + exit 1 + } +} + +# +# parse out the config parts of the triplet name +# + +# build values +if { $build_cpu == "" } { + regsub -- "-.*-.*" ${build_triplet} "" build_cpu +} +if { $build_vendor == "" } { + regsub -- "^\[a-z0-9\]*-" ${build_triplet} "" build_vendor + regsub -- "-.*" ${build_vendor} "" build_vendor +} +if { $build_os == "" } { + regsub -- ".*-.*-" ${build_triplet} "" build_os +} + +# host values +if { $host_cpu == "" } { + regsub -- "-.*-.*" ${host_triplet} "" host_cpu +} +if { $host_vendor == "" } { + regsub -- "^\[a-z0-9\]*-" ${host_triplet} "" host_vendor + regsub -- "-.*" ${host_vendor} "" host_vendor +} +if { $host_os == "" } { + regsub -- ".*-.*-" ${host_triplet} "" host_os +} + +# target values +if { $target_cpu == "" } { + regsub -- "-.*-.*" ${target_triplet} "" target_cpu +} +if { $target_vendor == "" } { + regsub -- "^\[a-z0-9\]*-" ${target_triplet} "" target_vendor + regsub -- "-.*" ${target_vendor} "" target_vendor +} +if { $target_os == "" } { + regsub -- ".*-.*-" ${target_triplet} "" target_os +} + +# +# Parse the command line arguments. +# + +set argc [ llength $argv ] +for { set i 0 } { $i < $argc } { incr i } { + set option [ lindex $argv $i ] + + # make all options have two hyphens + switch -glob -- $option { + "--*" { + } + "-*" { + set option "-$option" + } + } + + # split out the argument for options that take them + switch -glob -- $option { + "--*=*" { + set optarg [lindex [split $option =] 1] + } + "--ba*" - + "--bu*" - + "--co*" - + "--ho*" - + "--i*" - + "--m*" - + "--n*" - + "--ob*" - + "--ou*" - + "--sr*" - + "--st*" - + + "--ta*" - + "--to*" { + incr i + set optarg [lindex $argv $i] + } + } + + switch -glob -- $option { + "--V*" - + "--vers*" { # (--version) version numbers + send_user "Expect version is\t[exp_version]\n" + send_user "Tcl version is\t\t[ info tclversion ]\n" + send_user "Framework version is\t$frame_version\n" + exit + } + + "--v*" { # (--verbose) verbose output + # Already parsed. + continue + } + + "--bu*" { # (--build) the build host configuration + # Already parsed (and don't set again). Let $BLUEGNU rename it. + continue + } + + "--ho*" { # (--host) the host configuration + # Already parsed (and don't set again). Let $BLUEGNU rename it. + continue + } + + "--ta*" { # (--target) the target configuration + # Already parsed (and don't set again). Let $BLUEGNU rename it. + continue + } + + "--a*" { # (--all) print all test output to screen + set all_flag 1 + verbose "Print all test output to screen" + continue + } + + "--ba*" { # (--baud) the baud to use for a serial line + set baud $optarg + verbose "The baud rate is now $baud" + continue + } + + "--co*" { # (--connect) the connection mode to use + set connectmode $optarg + verbose "Comm method is $connectmode" + continue + } + + "--d*" { # (--debug) expect internal debugging + if [file exists ./dbg.log] { + catch "exec rm -f ./dbg.log" + } + if { $verbose > 2 } { + exp_internal -f dbg.log 1 + } else { + exp_internal -f dbg.log 0 + } + verbose "Expect Debugging is ON" + continue + } + + "--D[01]" { # (-Debug) turn on Tcl debugger + verbose "Tcl debugger is ON" + continue + } + + "--m*" { # (--mail) mail the output + set mailing_list $optarg + set mail_logs 1 + verbose "Mail results to $mailing_list" + continue + } + + "--r*" { # (--reboot) reboot the target + set reboot 1 + verbose "Will reboot the target (if supported)" + continue + } + + "--ob*" { # (--objdir) where the test case object code lives + # Already parsed, but parse again to make sure command line + # options override any config file. + set objdir $optarg + verbose "Using test binaries in $objdir" + continue + } + + "--ou*" { # (--outdir) where to put the output files + set outdir $optarg + verbose "Test output put in $outdir" + continue + } + + "*.exp" { # specify test names to run + set all_runtests($option) "" + verbose "Running only tests $option" + continue + } + + "*.exp=*" { # specify test names to run + set j [string first "=" $option] + set tmp [list [string range $option 0 [expr $j - 1]] \ + [string range $option [expr $j + 1] end]] + set all_runtests([lindex $tmp 0]) [lindex $tmp 1] + verbose "Running only tests $option" + unset tmp j + continue + } + + "--i*" { # (--ignore) specify test names to exclude + set ignoretests $optarg + verbose "Ignoring test $ignoretests" + continue + } + + "--sr*" { # (--srcdir) where the testsuite source code lives + # Already parsed, but parse again to make sure command line + # options override any config file. + + set srcdir $optarg + continue + } + + "--st*" { # (--strace) expect trace level + set tracelevel $optarg + strace $tracelevel + verbose "Source Trace level is now $tracelevel" + continue + } + + "--n*" { # (--name) the target's name + # ??? `targetname' is a confusing word to use here. + set targetname $optarg + verbose "Target name is now $targetname" + continue + } + + "--to*" { # (--tool) specify tool name + set tool $optarg + verbose "Testing $tool" + continue + } + + "[A-Z]*=*" { # process makefile style args like CC=gcc, etc... + if [regexp "^(\[A-Z_\]+)=(.*)$" $option junk var val] { + if {0 > [lsearch -exact $makevars $var]} { + lappend makevars "$var" + set $var $val + } else { + set $var [concat [set $var] $val] + } + verbose "$var is now [set $var]" + #append makevars "set $var $val;" ;# FIXME: Used anywhere? + unset junk var val + } else { + send_error "Illegal variable specification:\n" + send_error "$option\n" + } + continue + } + + "--he*" { # (--help) help text + send_user "USAGE: bluegnu \[options...\]\n" + send_user "\t--all (-a)\t\tPrint all test output to screen\n" + send_user "\t--baud (-ba)\t\tThe baud rate\n" + send_user "\t--build \[string\]\t\tThe canonical config name of the build machine\n" + send_user "\t--host \[string\]\t\tThe canonical config name of the host machine\n" + send_user "\t--target \[string\]\tThe canonical config name of the target board\n" + send_user "\t--connect (-co)\t\[type\]\tThe type of connection to use\n" + send_user "\t--debug (-de)\t\tSet expect debugging ON\n" + send_user "\t--help (-he)\t\tPrint help text\n" + send_user "\t--ignore \[name(s)\]\tThe names of specific tests to ignore\n" + send_user "\t--mail \[name(s)\]\tWho to mail the results to\n" + send_user "\t--name \[name\]\t\tThe hostname of the target board\n" + send_user "\t--objdir \[name\]\t\tThe test suite binary directory\n" + send_user "\t--outdir \[name\]\t\tThe directory to put logs in\n" + send_user "\t--reboot \[name\]\t\tReboot the target (if supported)\n" + send_user "\t--srcdir \[name\]\t\tThe test suite source code directory\n" + send_user "\t--strace \[number\]\tSet expect tracing ON\n" + send_user "\t--tool\[name(s)\]\t\tRun tests on these tools\n" + send_user "\t--verbose (-v)\t\tEmit verbose output\n" + send_user "\t--version (-V)\t\tEmit all version numbers\n" + send_user "\t--D\[0-1\]\t\tTcl debugger\n" + send_user "\tscript.exp\[=arg(s)\]\tRun these tests only\n" + send_user "\tMakefile style arguments can also be used, ex. CC=gcc\n\n" + exit 0 + } + + default { + send_error "\nIllegal Argument \"$option\"\n" + send_error "try \"bluegnu --help\" for option list\n" + exit 1 + } + + } +} + +# +# check for a few crucial variables +# +if ![info exists tool] { + send_error "WARNING: No tool specified\n" + set tool "" +} + +# +# initialize a few Tcl variables to something other than their default +# +if { $verbose > 2 } { + log_user 1 +} else { + log_user 0 +} + +set timeout 10 + +# +# load_lib -- load a library by sourcing it +# +# If there a multiple files with the same name, stop after the first one found. +# The order is first look in the install dir, then in a parallel dir in the +# source tree, (up one or two levels), then in the current dir. +# +proc load_lib { file } { + global verbose libdir srcdir base_dir execpath tool + + # ??? We could use `load_file' here but then we'd lose the "library file" + # specific text in verbose and error messages. Worth it? + set found 0 + foreach dir "$libdir $libdir/lib [file dirname [file dirname $srcdir]]/bluegnu/lib $srcdir/lib . [file dirname [file dirname [file dirname $srcdir]]]/bluegnu/lib" { + verbose "Looking for library file $dir/$file" 2 + if [file exists $dir/$file] { + set found 1 + verbose "Loading library file $dir/$file" + if { [catch "uplevel #0 source $dir/$file"] == 1 } { + send_error "ERROR: tcl error sourcing library file $dir/$file.\n" + global errorInfo + if [info exists errorInfo] { + send_error "$errorInfo\n" + } + exit 1 + } + break + } + } + if { $found == 0 } { + send_error "ERROR: Couldn't find library file $file.\n" + exit 1 + } +} + +# +# load the testing framework libraries +# +load_lib utils.exp +load_lib framework.exp +load_lib debugger.exp +load_lib remote.exp +load_lib target.exp + +# +# open log files +# +open_logs + +# print the config info +clone_output "Test Run By $logname on [timestamp -format %c]" +if [is3way] { + clone_output "Target is $target_triplet" + clone_output "Host is $host_triplet" + clone_output "Build is $build_triplet" +} else { + if [isnative] { + clone_output "Native configuration is $target_triplet" + } else { + clone_output "Target is $target_triplet" + clone_output "Host is $host_triplet" + } +} + +clone_output "\n\t\t=== $tool tests ===\n" + +# +# Find the tool init file. This is in the config directory of the tool's +# testsuite directory. These used to all be named $target_abbrev-$tool.exp, +# but as the $tool variable goes away, it's now just $target_abbrev.exp. +# First we look for a file named with both the abbrev and the tool names. +# Then we look for one named with just the abbrev name. Finally, we look for +# a file called default, which is the default actions, as some tools could +# be purely host based. Unknown is mostly for error trapping. +# + +set found 0 +if ![info exists target_abbrev] { + set target_abbrev "unix" +} +foreach dir "${srcdir}/config ${srcdir}/../config ${srcdir}/../../config ${srcdir}/../../../config" { + foreach initfile "${target_abbrev}-${tool}.exp ${target_abbrev}.exp ${target_os}.exp default.exp unknown.exp" { + verbose "Looking for tool init file ${dir}/${initfile}" 2 + if [file exists ${dir}/${initfile}] { + set found 1 + verbose "Using ${dir}/${initfile} as tool init file." + if [catch "uplevel #0 source ${dir}/${initfile}"]==1 { + send_error "ERROR: tcl error sourcing tool init file ${dir}/${initfile}.\n" + if [info exists errorInfo] { + send_error "$errorInfo\n" + } + exit 1 + } + break + } + } + if $found { + break + } +} + +if { $found == 0 } { + send_error "ERROR: Couldn't find tool init file.\n" + exit 1 +} +unset found + +# +# Trap some signals so we know what's happening. These replace the previous +# ones because we've now loaded the library stuff. +# +if ![exp_debug] { + foreach sig "{SIGTERM {terminated}} \ + {SIGINT {interrupted by user}} \ + {SIGQUIT {interrupted by user}} \ + {SIGSEGV {segmentation violation}}" { + trap { send_error "Got a [trap -name] signal, [lindex $sig 1]\n"; \ + log_summary } [lindex $sig 0] + verbose "setting trap for [lindex $sig 0] to \"[lindex $sig 1]\"" 1 + } +} + +# +# main test execution loop +# + +if [info exists errorInfo] { + unset errorInfo +} +reset_vars +# FIXME: The trailing '/' is deprecated and will go away at some point. +# Do not assume $srcdir has a trailing '/'. +append srcdir "/" +# make sure we have only single path delimiters +regsub -all "//*" $srcdir "/" srcdir + +# If multiple passes requested, set them up. Otherwise prepare just one. +# The format of `MULTIPASS' is a list of elements containing +# "{ name var1=value1 ... }" where `name' is a generic name for the pass and +# currently has no other meaning. + +if { [info exists MULTIPASS] } { + set multipass $MULTIPASS +} +if { $multipass == "" } { + set multipass { "" } +} + +foreach pass $multipass { + # multipass_name is set for `record_test' to use (see framework.exp). + if { [lindex $pass 0] != "" } { + set multipass_name [lindex $pass 0] + clone_output "Running pass `$multipass_name' ..." + } else { + set multipass_name "" + } + set restore "" + foreach varval [lrange $pass 1 end] { + # FIXME: doesn't handle a=b=c. + set tmp [split $varval "="] + set var [lindex $tmp 0] + # Save previous value. + if [info exists $var] { + lappend restore "$var [list [eval concat \$$var]]" + } else { + lappend restore "$var" + } + # Handle "CFLAGS=$CFLAGS foo". + # FIXME: Do we need to `catch' this? + eval set $var \[concat [lindex $tmp 1]\] + verbose "$var is now [eval concat \$$var]" + unset tmp var + } + + # look for the top level testsuites. if $tool doesn't + # exist and there are no subdirectories in $srcdir, then + # we default to srcdir. + set test_top_dirs [lsort [getdirs ${srcdir} "$tool*"]] + if { ${test_top_dirs} == "" } { + set test_top_dirs ${srcdir} + } + verbose "Top level testsuite dirs are ${test_top_dirs}" 2 + foreach dir "${test_top_dirs}" { + foreach test_name [lsort [find ${dir} *.exp]] { + if { ${test_name} == "" } { + continue + } + # Ignore this one if asked to. + if ![string match "" ${ignoretests}] { + if { 0 <= [lsearch ${ignoretests} [file tail ${test_name}]]} { + continue + } + } + # Get the path after the $srcdir so we know the subdir we're in. + set subdir "" + regsub $srcdir [file dirname $test_name] "" subdir + if { "$srcdir" == "$subdir/" } { + set subdir "" + } + # Check to see if the range of tests is limited, + # set `runtests' to a list of two elements: the script name + # and any arguments ("" if none). + if { [array size all_runtests] > 0 } { + if { 0 > [lsearch [array names all_runtests] [file tail $test_name]]} { + continue + } + set runtests [list [file tail $test_name] $all_runtests([file tail $test_name])] + } else { + set runtests [list [file tail $test_name] ""] + } + clone_output "Running $test_name ..." + set prms_id 0 + set bug_id 0 + set test_result "" + if [file exists $test_name] { + if { [catch "uplevel #0 source $test_name"] == 1 } { + # We can't call `perror' here, it resets `errorInfo' + # before we want to look at it. Also remember that perror + # increments `errcnt'. If we do call perror we'd have to + # reset errcnt afterwards. + clone_output "ERROR: tcl error sourcing $test_name." + if [info exists errorInfo] { + clone_output "ERROR: $errorInfo" + unset errorInfo + } + } + } else { + # This should never happen, but maybe if the file got removed + # between the `find' above and here. + perror "$test_name does not exist." + # ??? This is a hack. We want to send a message to stderr and + # to the summary file (just like perror does), but we don't + # want the next testcase to get a spurious "unresolved" because + # errcnt != 0. Calling `clone_output' is also supposed to be a + # no-no (see the comments for clone_output). + set errcnt 0 + } + } + } + + # Restore the variables set by this pass. + foreach varval $restore { + if { [llength $varval] > 1 } { + verbose "Restoring [lindex $varval 0] to [lindex $varval 1]" 4 + set [lindex $varval 0] [lindex $varval 1] + } else { + verbose "Restoring [lindex $varval 0] to `unset'" 4 + unset [lindex $varval 0] + } + } +} + +# +# all done, cleanup +# +if { [info procs ${tool}_exit] != "" } { + if {[catch "${tool}_exit" tmp]} { + # ??? We can get away with calling `warning' here without ensuring + # `warncnt' isn't changed because we're about to exit. + warning "${tool}_exit failed:\n$tmp" + } +} + +log_summary diff --git a/contrib/bluegnu2.0.3/site.tmpl b/contrib/bluegnu2.0.3/site.tmpl new file mode 100644 index 0000000..9508c35 --- /dev/null +++ b/contrib/bluegnu2.0.3/site.tmpl @@ -0,0 +1,307 @@ +# +# site.tmpl -- Sample template for a global config file. +# NOTE: This file contains mostly site specific +# configuration data that is custom to Cygnus +# Support. You'll have to change most of the +# values to work at your site. +# Written by rob@welcomehome.org +# + +# +# transform -- transform a tool name to get the installed name. We only define +# this if there wasn't one. This was the global config file can +# override how the tool names are calculated. +# + +# +# uncomment this if you wish to redefine the transform procedure +# + +#if ![string match "transform" [info procs transform]] then { +# proc transform { name } { +# global target_triplet +# +# if [string match "" $target_triplet] then { +# return $name +# } else { +# return ${target_triplet}-$name +# } +# } +#} + +set noargs 0 +set noresults 0 +set nosignals 0 + +# +# Set default setting for all know targets +# +case "$target_triplet" in { + { "hppa*-*-proelf*" } { + + # By default we'll use the Winbond for testing, use the OKI + # only if explicitly asked for. + case "$target_triplet" in { + { "hppa*-oki-proelf*" } { + set target_abbrev hppro + set targetname op50n + set serialport hellcab:1024 + set netport {} + set baud 9600 + } + default { + set target_abbrev hppro + set targetname w89k + set serialport hellcab:1023 + set netport {} + set baud 9600 + } + } + + # Now stuff that's common to all proelf targets. + # We can't pass arguments or do IO with the PA boards, nor do we + # get status results or signals back from the board. + set noargs 1 + set noresults 1 + set nosignals 1 + set noinferiorio 1 + + # Disgusting hack because directories in libgloss don't + # necessarily match the value in target_cpu. + set target_cpu "pa" + + # The proelf targets are absurdly slow downloading, so we limit + # the number of tests we run on them + set TORTURE_OPTIONS [list \ + { -O0 -g } { -O2 } \ + { -O2 -fomit-frame-pointer -finline-functions -funroll-all-loops }] + + set target_info(target,name) $targetname + set target_info(target,ldflags) "-T$targetname.ld" + set target_info(target,config) "hppa1.1-hp-proelf" + set target_info(target,cflags) "-T$targetname.ld" + set target_info(target,connect) "" + set target_info(target,target) "" + set target_info(target,serial) $serialport + set target_info(target,netport) $netport + set target_info(target,baud) $baud + } + { "i386-*-aout" } { + set target_abbrev aout + set connectmode "" + set targetname "" + set netport "" + set serialport "" + set baud "" + } + { "m68k-mvme135-*" } { # Motorola MVME135 board running Bug monitor + set target_abbrev bug + set connectmode "telnet" + append targetname "s8" + append serialport "/dev/ttyr8" + append netport "termserv:90008" + append baud "9600" + append CFLAGS "-Tmvme135.ld" + append CXXFLAGS "-Tmvme135.ld" + } + { "m68k-idp-*" "m68k-rom68k-*" } { # Motorola IDP board running rom68k monitor + append target_abbrev idp + append connectmode "telnet" + append targetname "s12" + append serialport "/dev/tstty12" + append netport "termserv:900012" + append baud "9600" + append CFLAGS "-Tidp.ld" + append CXXFLAGS "-Tidp.ld" + } + { "m68k-*-aout" } { + append target_abbrev aout + append connectmode "" + append targetname "" + append netport "" + append serialport "" + append baud "" + } + { "m68k-est-coff" } { + append target_abbrev est + append connectmode telnet + append targetname est + append serialport /dev/ttyb + append netport "" + append baud 9600 + set noargs 1 + set noresults 1 + set nosignals 1 + append CFLAGS -Tidp.ld + append CXXFLAGS -Tidp.ld + } + { "m68k-cpu32bug-coff" } { + append target_abbrev cpu32bug + append connectmode telnet + append targetname cpu32bug + append serialport /dev/ttyb + append netport "" + append baud 9600 + set noargs 1 + set noresults 1 + set nosignals 1 + append CFLAGS -Tidp.ld + append CXXFLAGS -Tidp.ld + } + { "m68k-*-coff" } { + set target_abbrev rom68k + set connectmode telnet + set targetname rom68k + set serialport /dev/ttya + set netport "" + set baud 9600 + set noargs 1 + set noresults 1 + set nosignals 1 + set CFLAGS -Tidp.ld + set CXXFLAGS -Tidp.ld + } + { "i960-*-nindy" } { + append target_abbrev nind + append connectmode "" + append targetname "" + append netport "" + append serialport "" + append baud "" + } + { "m68*-*-vxworks" "m68*-vxworks" } { # Motorola MVME167 board running VxWorks + append target_abbrev vx + append connectmode "telnet" + append targetname "foobar" + append serialport "/dev/tstty16" + append netport "termserv:900016" + append baud "9600" + append CFLAGS "-r" + append CXXFLAGS "-r" + append LDFLAGS "-r" + } + { "m68*-*-spectra" "m68*-spectra-*" } { + append target_abbrev vrtx + append connectmode "" + append targetname "" + append netport "" + append serialport "" + append baud "" + } + { "sparc-*-vxworks" } { + append target_abbrev vx + append connectmode "" + append targetname "" + append netport "" + append serialport "" + append baud "" + append CFLAGS "-r" + append CXXFLAGS "-r" + append LDFLAGS "-r" + } + { "i960-*-vxworks" } { + append target_abbrev vx + append connectmode "telnet" + append targetname "barfoo" + append netport "" + append serialport "" + append baud "9600" + append CFLAGS "-r" + append CXXFLAGS "-r" + append LDFLAGS "-r" + } + { "a29k-*-udi" } { + append target_abbrev udi + append connectmode "mondfe" + append targetname "ser" + append netport "" + append serialport "" + append baud "" + } + { "a29k-isstip-*" } { + append target_abbrev itip + append connectmode "mondfe" + append targetname "isst" + append netport "" + append serialport "" + append baud "" + } + { "mips-idt-ecoff" } { + append target_abbrev mips + append connectmode "" + append targetname "" + append netport "" + append serialport "" + append baud "" + } + { "h8300*-*-*" } { + append target_abbrev sim + append connectmode "" + append targetname "" + append netport "" + append serialport "" + append baud "" + } + { "h8500*-*-*" } { + append target_abbrev sim + append connectmode "" + append targetname "" + append netport "" + append serialport "" + append baud "" + } + { "sh-*-*" } { + append target_abbrev sh + append connectmode "" + append targetname "" + append netport "" + append serialport "" + append baud "" + } + { "sparc-*-aout" } { + append target_abbrev aout + append connectmode "" + append targetname "" + append netport "" + append serialport "" + append baud "" + } + { "sparclite-*-*" } { + append target_abbrev slite + append connectmode "aload" + append targetname "" + append netport "" + append serialport "" + append baud "" + append CFLAGS "-Tex930" + append CXXFLAGS "" + } + { "sparclitefrwcompat-*-*" } { + append target_abbrev frwcom + append connectmode "" + append targetname "" + append netport "" + append serialport "" + append baud "" + } + default { + # For now only run default gdbserver framework for lynx cross + # targets in the future it should be the default for any cross + # targets not explicitly handled above. + if { $host_triplet != $target_triplet } then { + set target_abbrev gdbserver + set targetname extended-remote + append connectmode "" + append netport "" + append serialport "" + append baud "" + } else { + append target_abbrev unix + append connectmode "" + append targetname "" + append netport "" + append serialport "" + append baud "" + } + } +} diff --git a/contrib/bluegnu2.0.3/tcl-mode.el b/contrib/bluegnu2.0.3/tcl-mode.el new file mode 100644 index 0000000..90b3503 --- /dev/null +++ b/contrib/bluegnu2.0.3/tcl-mode.el @@ -0,0 +1,2223 @@ +;; tcl.el --- Tcl code editing commands for Emacs + +;; Copyright (C) 1994 Free Software Foundation, Inc. + +;; Maintainer: Tom Tromey +;; Author: Tom Tromey +;; Chris Lindblad +;; Keywords: languages tcl modes +;; Version: 1.49 + +;; This file is part of GNU Emacs. + +;; GNU Emacs 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 1, or (at your option) +;; any later version. + +;; GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to +;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + +;; HOW TO INSTALL: +;; Put the following forms in your .emacs to enable autoloading of Tcl +;; mode, and auto-recognition of ".tcl" files. +;; +;; (autoload 'tcl-mode "tcl" "Tcl mode." t) +;; (autoload 'inferior-tcl "tcl" "Run inferior Tcl process." t) +;; (setq auto-mode-alist (append '(("\\.tcl$" . tcl-mode)) auto-mode-alist)) +;; +;; If you plan to use the interface to the TclX help files, you must +;; set the variable tcl-help-directory-list to point to the topmost +;; directories containing the TclX help files. Eg: +;; +;; (setq tcl-help-directory-list '("/usr/local/lib/tclx/help")) +;; +;; Also you will want to add the following to your .emacs: +;; +;; (autoload 'tcl-help-on-word "tcl" "Help on Tcl commands" t) +;; +;; FYI a *very* useful thing to do is nroff all the Tk man pages and +;; put them in a subdir of the help system. +;; + +;;; Commentary: + +;; LCD Archive Entry: +;; tcl|Tom Tromey|tromey@busco.lanl.gov| +;; Major mode for editing Tcl| +;; 1995/12/07 18:27:47|1.49|~/modes/tcl.el.Z| + +;; CUSTOMIZATION NOTES: +;; * tcl-proc-list can be used to customize a list of things that +;; "define" other things. Eg in my project I put "defvar" in this +;; list. +;; * tcl-typeword-list is similar, but uses font-lock-type-face. +;; * tcl-keyword-list is a list of keywords. I've generally used this +;; for flow-control words. Eg I add "unwind_protect" to this list. +;; * tcl-type-alist can be used to minimally customize indentation +;; according to context. + +;; Change log: +;; tcl.el,v +;; Revision 1.49 1995/12/07 18:27:47 tromey +;; (add-log-tcl-defun): Don't use tcl-beginning-of-defun; just go to end +;; of line before searching. +;; +;; Revision 1.48 1995/12/07 18:18:21 tromey +;; (add-log-tcl-defun): Now uses tcl-beginning-of-defun. +;; +;; Revision 1.47 1995/08/22 17:49:45 tromey +;; (tcl-hilit): New function from "Chris Alfeld" +;; (tcl-mode): Call it +;; +;; Revision 1.46 1995/08/07 16:02:01 tromey +;; (tcl-do-auto-fill): Only fill past fill-column; for 19.29. +;; (tcl-auto-fill-mode): Use force-mode-line-update. +;; +;; Revision 1.45 1995/07/23 23:51:25 tromey +;; (tcl-word-no-props): New function. +;; (tcl-figure-type): Use it. +;; (tcl-current-word): Ditto. +;; +;; Revision 1.44 1995/07/23 20:26:47 tromey +;; Doc fixes. +;; +;; Revision 1.43 1995/07/17 19:59:49 tromey +;; (inferior-tcl-mode): Use modeline-process if it exists. +;; +;; Revision 1.42 1995/07/17 19:55:25 tromey +;; XEmacs currently must use tcl-internal-end-of-defun +;; +;; Revision 1.41 1995/07/14 21:54:56 tromey +;; Changes to make menus work in XEmacs. +;; From Mike Scheidler +;; +;; Revision 1.40 1995/07/11 03:13:15 tromey +;; (tcl-mode): Customize for new dabbrev. +;; +;; Revision 1.39 1995/07/09 21:58:03 tromey +;; (tcl-do-fill-paragraph): New function. +;; (tcl-mode): Set up for paragraph filling. +;; +;; Revision 1.38 1995/07/09 21:30:32 tromey +;; (tcl-mode): Fixes to 19.29 paragraph variables. +;; +;; Revision 1.37 1995/07/09 18:52:16 tromey +;; (tcl-do-auto-fill): Set fill-prefix. +;; +;; Revision 1.36 1995/07/09 01:07:57 tromey +;; (tcl-imenu-create-index-function): Work with imenu from Emacs 19.29 +;; +;; Revision 1.35 1995/06/27 20:12:00 tromey +;; (tcl-type-alist): More itcl changes. +;; +;; Revision 1.34 1995/06/27 20:06:05 tromey +;; More changes for itcl. +;; Bug fixes for Emacs 19.29. +;; +;; Revision 1.33 1995/06/27 20:01:29 tromey +;; (tcl-set-proc-regexp): Allow leading spaces. +;; (tcl-proc-list): Changes for itcl. +;; (tcl-typeword-list): Ditto. +;; (tcl-keyword-list): Ditto. +;; +;; Revision 1.32 1995/05/11 22:12:49 tromey +;; (tcl-type-alist): Include entry for "proc". +;; +;; Revision 1.31 1995/05/10 23:38:12 tromey +;; (tcl-add-fsf-menu): Use make-lucid-menu-keymap, not +;; "make-xemacs-menu-keymap". +;; +;; Revision 1.30 1995/05/10 18:22:21 tromey +;; Bug fix in menu code for XEmacs. +;; +;; Revision 1.29 1995/05/09 21:36:53 tromey +;; Changed "Lucid Emacs" to "XEmacs". +;; Tcl's popup menu now added to existing one, courtesy +;; dfarmer@evolving.com (Doug Farmer) +;; +;; Revision 1.28 1995/04/08 19:52:50 tromey +;; (tcl-outline-level): New function +;; (tcl-mode): Added outline-handling stuff. +;; From Jesper Pedersen +;; +;; Revision 1.27 1994/10/11 02:01:27 tromey +;; (tcl-mode): imenu-create-index-function made buffer local. +;; +;; Revision 1.26 1994/09/01 18:06:24 tromey +;; Added filename completion in inferior tcl mode +;; +;; Revision 1.25 1994/08/22 15:56:24 tromey +;; tcl-load-file default to current buffer. +;; +;; Revision 1.24 1994/08/21 20:33:05 tromey +;; Fixed bug in tcl-guess-application. +;; +;; Revision 1.23 1994/08/21 03:54:45 tromey +;; Keybindings don't overshadown comint bindings. +;; +;; Revision 1.22 1994/07/26 00:46:07 tromey +;; Emacs 18 changes from Carl Witty. +;; +;; Revision 1.21 1994/07/14 22:49:21 tromey +;; Added ";;;###autoload" comments where appropriate. +;; +; Revision 1.20 1994/06/05 16:57:22 tromey +; tcl-current-word does the right thing in inferior-tcl-mode. +; +; Revision 1.19 1994/06/03 21:09:19 tromey +; Another menu fix. +; +; Revision 1.18 1994/06/03 20:39:14 tromey +; Fixed menu bug. +; +; Revision 1.17 1994/06/03 00:47:15 tromey +; Fixed bug in bug-reporting code. +; +; Revision 1.16 1994/05/26 05:06:14 tromey +; Menu items now sensitive as appropriate. +; +; Revision 1.15 1994/05/22 20:38:11 tromey +; Added bug-report keybindings and menu entries. +; +; Revision 1.14 1994/05/22 20:18:28 tromey +; Even more compile stuff. +; +; Revision 1.13 1994/05/22 20:17:15 tromey +; Moved emacs version checking code to very beginning. +; +; Revision 1.12 1994/05/22 20:14:59 tromey +; Compile fixes. +; +; Revision 1.11 1994/05/22 20:12:44 tromey +; Fixed mark-defun for 19.23. +; More menu fixes. +; +; Revision 1.10 1994/05/22 20:02:03 tromey +; Fixed bug with M-;. +; Wrote bug-reporting code. +; +; Revision 1.9 1994/05/22 05:26:51 tromey +; Fixes for imenu. +; +; Revision 1.8 1994/05/22 03:38:07 tromey +; Fixed menu support. +; +; Revision 1.7 1994/05/03 01:23:42 tromey +; *** empty log message *** +; +; Revision 1.6 1994/04/23 16:23:36 tromey +; Wrote tcl-indent-for-comment +; +;; +;; 18-Mar-1994 Tom Tromey Fourth beta release. +;; Added {un,}comment-region to menu. Idea from +;; Mike Scheidler +;; 17-Mar-1994 Tom Tromey +;; Fixed tcl-restart-with-file. Bug fix attempt in +;; tcl-internal-end-of-defun. +;; 16-Mar-1994 Tom Tromey Third beta release +;; Added support code for menu (from Tcl mode written by +;; schmid@fb3-s7.math.TU-Berlin.DE (Gregor Schmid)). +;; 12-Mar-1994 Tom Tromey +;; Better documentation for inferior-tcl-buffer. Wrote +;; tcl-restart-with-file. Wrote Lucid Emacs menu (but no +;; code to install it). +;; 12-Mar-1994 Tom Tromey +;; Wrote tcl-guess-application. Another stab at making +;; tcl-omit-ws-regexp work. +;; 10-Mar-1994 Tom Tromey Second beta release +;; Last Modified: Thu Mar 10 01:24:25 1994 (Tom Tromey) +;; Wrote perl-mode style line indentation command. +;; Wrote more documentation. Added tcl-continued-indent-level. +;; Integrated help code. +;; 8-Mar-1994 Tom Tromey +;; Last Modified: Tue Mar 8 11:58:44 1994 (Tom Tromey) +;; Bug fixes. +;; 6-Mar-1994 Tom Tromey +;; Last Modified: Sun Mar 6 18:55:41 1994 (Tom Tromey) +;; Updated auto-newline support. +;; 6-Mar-1994 Tom Tromey Beta release +;; Last Modified: Sat Mar 5 17:24:32 1994 (Tom Tromey) +;; Wrote tcl-hashify-buffer. Other minor bug fixes. +;; 5-Mar-1994 Tom Tromey +;; Last Modified: Sat Mar 5 16:11:20 1994 (Tom Tromey) +;; Wrote electric-hash code. +;; 3-Mar-1994 Tom Tromey +;; Last Modified: Thu Mar 3 02:53:40 1994 (Tom Tromey) +;; Added code to handle auto-fill in comments. +;; Added imenu support code. +;; Cleaned up code. +;; Better font-lock support. +;; 28-Feb-1994 Tom Tromey +;; Last Modified: Mon Feb 28 14:08:05 1994 (Tom Tromey) +;; Made tcl-figure-type more easily configurable. +;; 28-Feb-1994 Tom Tromey +;; Last Modified: Mon Feb 28 01:02:58 1994 (Tom Tromey) +;; Wrote inferior-tcl mode. +;; 16-Feb-1994 Tom Tromey +;; Last Modified: Wed Feb 16 17:05:19 1994 (Tom Tromey) +;; Added support for font-lock-mode. +;; 29-Oct-1993 Tom Tromey +;; Last Modified: Sun Oct 24 17:39:14 1993 (Tom Tromey) +;; Patches from Guido Bosch to make things work with Lucid Emacs. +;; 22-Oct-1993 Tom Tromey +;; Last Modified: Fri Oct 22 15:26:46 1993 (Tom Tromey) +;; Made many characters have "_" syntax class; suggested by Guido +;; Bosch . Note that this includes the "$" +;; character, which might be a change you'd notice. +;; 21-Oct-1993 Tom Tromey +;; Last Modified: Thu Oct 21 20:28:40 1993 (Tom Tromey) +;; More fixes for tcl-omit-ws-regexp. +;; 20-Oct-1993 Tom Tromey +;; Started keeping history. Fixed tcl-{beginning,end}-of-defun. +;; Added some code to make things work with Emacs 18. + +;; THANKS TO: +;; Guido Bosch +;; pgs1002@esc.cam.ac.uk (Dr P.G. Sjoerdsma) +;; Mike Scheidler +;; Matt Newman +;; rwhitby@research.canon.oz.au (Rod Whitby) +;; h9118101@hkuxa.hku.hk (Yip Chi Lap [Beta]) +;; Pertti Tapio Kasanen +;; schmid@fb3-s7.math.TU-Berlin.DE (Gregor Schmid) +;; warsaw@nlm.nih.gov (Barry A. Warsaw) +;; Carl Witty +;; T. V. Raman +;; Jesper Pedersen +;; dfarmer@evolving.com (Doug Farmer) +;; "Chris Alfeld" + +;; KNOWN BUGS: +;; * indent-region should skip blank lines. (It does in v19, so I'm +;; not motivated to fix it here). +;; * In Tcl "#" is not always a comment character. This can confuse +;; tcl.el in certain circumstances. For now the only workaround is +;; to enclose offending hash characters in quotes or precede it with +;; a backslash. Note that using braces won't work -- quotes change +;; the syntax class of characters between them, while braces do not. +;; The electric-# mode helps alleviate this problem somewhat. +;; * indent-tcl-exp is untested. +;; * Doesn't work under Emacs 18 yet. +;; * There's been a report that font-lock does strange things under +;; Lucid Emacs 19.6. For instance in "proc foobar", the space +;; before "foobar" is highlighted. + +;; TODO: +;; * make add-log-tcl-defun smarter. should notice if we are in the +;; middle of a defun, or between defuns. should notice if point is +;; on first line of defun (or maybe even in comments before defun). +;; * Allow continuation lines to be indented under the first argument +;; of the preceeding line, like this: +;; [list something \ +;; something-else] +;; * There is a request that indentation work like this: +;; button .fred -label Fred \ +;; -command {puts fred} +;; * Should have tcl-complete-symbol that queries the inferior process. +;; * Should have describe-symbol that works by sending the magic +;; command to a tclX process. +;; * Need C-x C-e binding (tcl-eval-last-exp). +;; * Write indent-region function that is faster than indenting each +;; line individually. +;; * tcl-figure-type should stop at "beginning of line" (only ws +;; before point, and no "\" on previous line). (see tcl-real-command-p). +;; * overrides some comint keybindings; fix. +;; * Trailing \ will eat blank lines. Should deal with this. +;; (this would help catch some potential bugs). +;; * Inferior should display in half the screen, not the whole screen. +;; * Indentation should deal with "switch". +;; * Consider writing code to find help files automatically (for +;; common cases). +;; * `#' shouldn't insert `\#' when point is in string. + + + +;;; Code: + +;; I sure wish Emacs had a package that made it easy to extract this +;; sort of information. +(defconst tcl-using-emacs-19 (string-match "19\\." emacs-version) + "Nil unless using Emacs 19 (XEmacs or FSF).") + +;; FIXME this will break on Emacs 19.100. +(defconst tcl-using-emacs-19-23 + (string-match "19\\.\\(2[3-9]\\|[3-9][0-9]\\)" emacs-version) + "Nil unless using Emacs 19-23 or later.") + +(defconst tcl-using-xemacs-19 (string-match "XEmacs" emacs-version) + "Nil unless using XEmacs).") + +(require 'comint) + +;; When compiling under GNU Emacs, load imenu during compilation. If +;; you have 19.22 or earlier, comment this out, or get imenu. +(and (fboundp 'eval-when-compile) + (eval-when-compile + (if (and (string-match "19\\." emacs-version) + (not (string-match "XEmacs" emacs-version))) + (require 'imenu)) + ())) + +(defconst tcl-version "1.49") +(defconst tcl-maintainer "Tom Tromey ") + +;; +;; User variables. +;; + +(defvar tcl-indent-level 4 + "*Indentation of Tcl statements with respect to containing block.") + +(defvar tcl-continued-indent-level 4 + "*Indentation of continuation line relative to first line of command.") + +(defvar tcl-auto-newline nil + "*Non-nil means automatically newline before and after braces +inserted in Tcl code.") + +(defvar tcl-tab-always-indent t + "*Control effect of TAB key. +If t (the default), always indent current line. +If nil and point is not in the indentation area at the beginning of +the line, a TAB is inserted. +Other values cause the first possible action from the following list +to take place: + + 1. Move from beginning of line to correct indentation. + 2. Delete an empty comment. + 3. Move forward to start of comment, indenting if necessary. + 4. Move forward to end of line, indenting if necessary. + 5. Create an empty comment. + 6. Move backward to start of comment, indenting if necessary.") + +(defvar tcl-use-hairy-comment-detector t + "*If not `nil', the the more complicated, but slower, comment +detecting function is used. This variable is only used in GNU Emacs +19 (the fast function is always used elsewhere).") + +(defvar tcl-electric-hash-style 'smart + "*Style of electric hash insertion to use. +Possible values are 'backslash, meaning that `\\' quoting should be +done; 'quote, meaning that `\"' quoting should be done; 'smart, +meaning that the choice between 'backslash and 'quote should be +made depending on the number of hashes inserted; or nil, meaning that +no quoting should be done. Any other value for this variable is +taken to mean 'smart. The default is 'smart.") + +(defvar tcl-help-directory-list nil + "*List of topmost directories containing TclX help files") + +(defvar tcl-use-smart-word-finder t + "*If not nil, use a better way of finding the current word when +looking up help on a Tcl command.") + +(defvar tcl-application "wish" + "*Name of Tcl application to run in inferior Tcl mode.") + +(defvar tcl-command-switches nil + "*Switches to supply to `tcl-application'.") + +(defvar tcl-prompt-regexp "^\\(% \\|\\)" + "*If not nil, a regexp that will match the prompt in the inferior process. +If nil, the prompt is the name of the application with \">\" appended. + +The default is \"^\\(% \\|\\)\", which will match the default primary +and secondary prompts for tclsh and wish.") + +(defvar inferior-tcl-source-command "source %s\n" + "*Format-string for building a Tcl command to load a file. +This format string should use `%s' to substitute a file name +and should result in a Tcl expression that will command the +inferior Tcl to load that file. The filename will be appropriately +quoted for Tcl.") + +;; +;; Keymaps, abbrevs, syntax tables. +;; + +(defvar tcl-mode-abbrev-table nil + "Abbrev table in use in Tcl-mode buffers.") +(if tcl-mode-abbrev-table + () + (define-abbrev-table 'tcl-mode-abbrev-table ())) + +(defvar tcl-mode-map () + "Keymap used in Tcl mode.") + +(defvar tcl-mode-syntax-table nil + "Syntax table in use in Tcl-mode buffers.") +(if tcl-mode-syntax-table + () + (setq tcl-mode-syntax-table (make-syntax-table)) + (modify-syntax-entry ?% "_" tcl-mode-syntax-table) + (modify-syntax-entry ?@ "_" tcl-mode-syntax-table) + (modify-syntax-entry ?& "_" tcl-mode-syntax-table) + (modify-syntax-entry ?* "_" tcl-mode-syntax-table) + (modify-syntax-entry ?+ "_" tcl-mode-syntax-table) + (modify-syntax-entry ?- "_" tcl-mode-syntax-table) + (modify-syntax-entry ?. "_" tcl-mode-syntax-table) + (modify-syntax-entry ?: "_" tcl-mode-syntax-table) + (modify-syntax-entry ?! "_" tcl-mode-syntax-table) + (modify-syntax-entry ?$ "_" tcl-mode-syntax-table) ; FIXME use "'"? + (modify-syntax-entry ?/ "_" tcl-mode-syntax-table) + (modify-syntax-entry ?~ "_" tcl-mode-syntax-table) + (modify-syntax-entry ?< "_" tcl-mode-syntax-table) + (modify-syntax-entry ?= "_" tcl-mode-syntax-table) + (modify-syntax-entry ?> "_" tcl-mode-syntax-table) + (modify-syntax-entry ?| "_" tcl-mode-syntax-table) + (modify-syntax-entry ?\( "()" tcl-mode-syntax-table) + (modify-syntax-entry ?\) ")(" tcl-mode-syntax-table) + (modify-syntax-entry ?\; "." tcl-mode-syntax-table) + (modify-syntax-entry ?\n "> " tcl-mode-syntax-table) + (modify-syntax-entry ?\f "> " tcl-mode-syntax-table) + (modify-syntax-entry ?# "< " tcl-mode-syntax-table)) + +(defvar inferior-tcl-mode-map nil + "Keymap used in Inferior Tcl mode.") + +;; XEmacs menu. +(defvar tcl-xemacs-menu + '(["Beginning of function" tcl-beginning-of-defun t] + ["End of function" tcl-end-of-defun t] + ["Mark function" tcl-mark-defun t] + ["Indent region" indent-region (tcl-mark)] + ["Comment region" comment-region (tcl-mark)] + ["Uncomment region" tcl-uncomment-region (tcl-mark)] + "----" + ["Show Tcl process buffer" inferior-tcl t] + ["Send function to Tcl process" tcl-eval-defun + (and inferior-tcl-buffer (get-buffer inferior-tcl-buffer))] + ["Send region to Tcl process" tcl-eval-region + (and inferior-tcl-buffer (get-buffer inferior-tcl-buffer))] + ["Send file to Tcl process" tcl-load-file + (and inferior-tcl-buffer (get-buffer inferior-tcl-buffer))] + ["Restart Tcl process with file" tcl-restart-with-file t] + "----" + ["Tcl help" tcl-help-on-word tcl-help-directory-list] + ["Send bug report" tcl-submit-bug-report t]) + "XEmacs menu for Tcl mode.") + +;; GNU Emacs does menus via keymaps. Do it in a function in case we +;; later decide to add it to inferior Tcl mode as well. +(defun tcl-add-fsf-menu (map) + (define-key map [menu-bar] (make-sparse-keymap)) + ;; This fails in Emacs 19.22 and earlier. + (require 'lmenu) + (let ((menu (make-lucid-menu-keymap "Tcl" tcl-xemacs-menu))) + (define-key map [menu-bar tcl] (cons "Tcl" menu)) + ;; The following is intended to compute the key sequence + ;; information for the menu. It doesn't work. + (x-popup-menu nil menu))) + +(defun tcl-fill-mode-map () + (define-key tcl-mode-map "{" 'tcl-electric-char) + (define-key tcl-mode-map "}" 'tcl-electric-brace) + (define-key tcl-mode-map "[" 'tcl-electric-char) + (define-key tcl-mode-map "]" 'tcl-electric-char) + (define-key tcl-mode-map ";" 'tcl-electric-char) + (define-key tcl-mode-map "#" 'tcl-electric-hash) + ;; FIXME. + (define-key tcl-mode-map "\e\C-a" 'tcl-beginning-of-defun) + ;; FIXME. + (define-key tcl-mode-map "\e\C-e" 'tcl-end-of-defun) + ;; FIXME. + (define-key tcl-mode-map "\e\C-h" 'tcl-mark-defun) + (define-key tcl-mode-map "\e\C-q" 'indent-tcl-exp) + (define-key tcl-mode-map "\177" 'backward-delete-char-untabify) + (define-key tcl-mode-map "\t" 'tcl-indent-command) + (define-key tcl-mode-map "\M-;" 'tcl-indent-for-comment) + (define-key tcl-mode-map "\M-\C-x" 'tcl-eval-defun) + (define-key tcl-mode-map "\C-c\C-b" 'tcl-submit-bug-report) + (and (fboundp 'comment-region) + (define-key tcl-mode-map "\C-c\C-c" 'comment-region)) + (define-key tcl-mode-map "\C-c\C-i" 'tcl-help-on-word) + (define-key tcl-mode-map "\C-c\C-v" 'tcl-eval-defun) + (define-key tcl-mode-map "\C-c\C-f" 'tcl-load-file) + (define-key tcl-mode-map "\C-c\C-t" 'inferior-tcl) + (define-key tcl-mode-map "\C-c\C-x" 'tcl-eval-region) + (define-key tcl-mode-map "\C-c\C-s" 'switch-to-tcl) + + ;; Make menus. + (if (and tcl-using-emacs-19 (not tcl-using-xemacs-19)) + (progn + (tcl-add-fsf-menu tcl-mode-map)))) + +(defun tcl-fill-inferior-map () + (define-key inferior-tcl-mode-map "\t" 'comint-dynamic-complete) + (define-key inferior-tcl-mode-map "\M-?" + 'comint-dynamic-list-filename-completions) + (define-key inferior-tcl-mode-map "\e\C-a" 'tcl-beginning-of-defun) + (define-key inferior-tcl-mode-map "\e\C-e" 'tcl-end-of-defun) + (define-key inferior-tcl-mode-map "\177" 'backward-delete-char-untabify) + (define-key inferior-tcl-mode-map "\M-\C-x" 'tcl-eval-defun) + (define-key inferior-tcl-mode-map "\C-c\C-b" 'tcl-submit-bug-report) + (define-key inferior-tcl-mode-map "\C-c\C-i" 'tcl-help-on-word) + (define-key inferior-tcl-mode-map "\C-c\C-v" 'tcl-eval-defun) + (define-key inferior-tcl-mode-map "\C-c\C-f" 'tcl-load-file) + (define-key inferior-tcl-mode-map "\C-c\C-t" 'inferior-tcl) + (define-key inferior-tcl-mode-map "\C-c\C-x" 'tcl-eval-region) + (define-key inferior-tcl-mode-map "\C-c\C-s" 'switch-to-tcl)) + +(if tcl-mode-map + () + (setq tcl-mode-map (make-sparse-keymap)) + (tcl-fill-mode-map)) + +(if inferior-tcl-mode-map + () + ;; FIXME Use keymap inheritance here? FIXME we override comint + ;; keybindings here. Maybe someone has a better set? + (setq inferior-tcl-mode-map (copy-keymap comint-mode-map)) + (tcl-fill-inferior-map)) + + +(defvar inferior-tcl-buffer nil + "*The current inferior-tcl process buffer. + +MULTIPLE PROCESS SUPPORT +=========================================================================== +To run multiple Tcl processes, you start the first up with +\\[inferior-tcl]. It will be in a buffer named `*inferior-tcl*'. +Rename this buffer with \\[rename-buffer]. You may now start up a new +process with another \\[inferior-tcl]. It will be in a new buffer, +named `*inferior-tcl*'. You can switch between the different process +buffers with \\[switch-to-buffer]. + +Commands that send text from source buffers to Tcl processes -- like +`tcl-eval-defun' or `tcl-load-file' -- have to choose a process to +send to, when you have more than one Tcl process around. This is +determined by the global variable `inferior-tcl-buffer'. Suppose you +have three inferior Lisps running: + Buffer Process + foo inferior-tcl + bar inferior-tcl<2> + *inferior-tcl* inferior-tcl<3> +If you do a \\[tcl-eval-defun] command on some Lisp source code, what +process do you send it to? + +- If you're in a process buffer (foo, bar, or *inferior-tcl*), + you send it to that process. +- If you're in some other buffer (e.g., a source file), you + send it to the process attached to buffer `inferior-tcl-buffer'. +This process selection is performed by function `inferior-tcl-proc'. + +Whenever \\[inferior-tcl] fires up a new process, it resets +`inferior-tcl-buffer' to be the new process's buffer. If you only run +one process, this does the right thing. If you run multiple +processes, you can change `inferior-tcl-buffer' to another process +buffer with \\[set-variable].") + +;; +;; Hooks and other customization. +;; + +(defvar tcl-mode-hook nil + "Hook run on entry to Tcl mode. + +Several functions exist which are useful to run from your +`tcl-mode-hook' (see each function's documentation for more +information): + + tcl-guess-application + Guesses a default setting for `tcl-application' based on any + \"#!\" line at the top of the file. + tcl-hashify-buffer + Quotes all \"#\" characters that don't correspond to actual + Tcl comments. (Useful when editing code not originally created + with this mode). + tcl-auto-fill-mode + Auto-filling of Tcl comments. + +Emacs 19 users can add functions to the hook with `add-hook': + + (add-hook 'tcl-mode-hook 'tcl-guess-application) + +Emacs 18 users must use `setq': + + (setq tcl-mode-hook (cons 'tcl-guess-application tcl-mode-hook))") + + +(defvar inferior-tcl-mode-hook nil + "Hook for customizing Inferior Tcl mode.") + +(defvar tcl-proc-list + '("proc" "method" "itcl_class") + "List of commands whose first argument defines something. +This exists because some people (eg, me) use \"defvar\" et al. +Call `tcl-set-proc-regexp' and `tcl-set-font-lock-keywords' +after changing this list.") + +(defvar tcl-proc-regexp nil + "Regexp to use when matching proc headers.") + +(defvar tcl-typeword-list + '("global" "upvar" "inherit" "public" "protected" "common") + "List of Tcl keywords denoting \"type\". Used only for highlighting. +Call `tcl-set-font-lock-keywords' after changing this list.") + +;; Generally I've picked control operators to be keywords. +(defvar tcl-keyword-list + '("if" "then" "else" "elseif" "for" "foreach" "break" "continue" "while" + "eval" "case" "in" "switch" "default" "exit" "error" "proc" "return" + "uplevel" "constructor" "destructor" "itcl_class" "loop" "for_array_keys" + "for_recursive_glob" "for_file") + "List of Tcl keywords. Used only for highlighting. +Default list includes some TclX keywords. +Call `tcl-set-font-lock-keywords' after changing this list.") + +(defvar tcl-font-lock-keywords nil + "Keywords to highlight for Tcl. See variable `font-lock-keywords'. +This variable is generally set from `tcl-proc-regexp', +`tcl-typeword-list', and `tcl-keyword-list' by the function +`tcl-set-font-lock-keywords'.") + +;; FIXME need some way to recognize variables because array refs look +;; like 2 sexps. +(defvar tcl-type-alist + '( + ("proc" nil tcl-expr tcl-commands) + ("method" nil tcl-expr tcl-commands) + ("destructor" tcl-commands) + ("constructor" tcl-commands) + ("expr" tcl-expr) + ("catch" tcl-commands) + ("if" tcl-expr "then" tcl-commands) + ("elseif" tcl-expr "then" tcl-commands) + ("elseif" tcl-expr tcl-commands) + ("if" tcl-expr tcl-commands) + ("while" tcl-expr tcl-commands) + ("for" tcl-commands tcl-expr tcl-commands tcl-commands) + ("foreach" nil nil tcl-commands) + ("for_file" nil nil tcl-commands) + ("for_array_keys" nil nil tcl-commands) + ("for_recursive_glob" nil nil nil tcl-commands) + ;; Loop handling is not perfect, because the third argument can be + ;; either a command or an expr, and there is no real way to look + ;; forward. + ("loop" nil tcl-expr tcl-expr tcl-commands) + ("loop" nil tcl-expr tcl-commands) + ) + "Alist that controls indentation. +\(Actually, this really only controls what happens on continuation lines). +Each entry looks like `(KEYWORD TYPE ...)'. +Each type entry describes a sexp after the keyword, and can be one of: +* nil, meaning that this sexp has no particular type. +* tcl-expr, meaning that this sexp is an arithmetic expression. +* tcl-commands, meaning that this sexp holds Tcl commands. +* a string, which must exactly match the string at the corresponding + position for a match to be made. + +For example, the entry for the \"loop\" command is: + + (\"loop\" nil tcl-expr tcl-commands) + +This means that the \"loop\" command has three arguments. The first +argument is ignored (for indentation purposes). The second argument +is a Tcl expression, and the last argument is Tcl commands.") + +(defvar tcl-explain-indentation nil + "If not `nil', debugging message will be printed during indentation.") + + + +;; +;; Work around differences between various versions of Emacs. +;; + +;; We use this because Lemacs 19.9 has what we need. +(defconst tcl-pps-has-arg-6 + (or tcl-using-emacs-19 + (and tcl-using-xemacs-19 + (condition-case nil + (progn + (parse-partial-sexp (point) (point) nil nil nil t) + t) + (error nil)))) + "t if using an emacs which supports sixth (\"commentstop\") argument +to parse-partial-sexp.") + +;; Its pretty bogus to have to do this, but there is no easier way to +;; say "match not syntax-1 and not syntax-2". Too bad you can't put +;; \s in [...]. This sickness is used in Emacs 19 to match a defun +;; starter. (It is used for this in v18 as well). +;;(defconst tcl-omit-ws-regexp +;; (concat "^\\(\\s" +;; (mapconcat 'char-to-string "w_.()\"\\$'/" "\\|\\s") +;; "\\)\\S(*") +;; "Regular expression that matches everything except space, comment +;;starter, and comment ender syntax codes.") + +;; FIXME? Instead of using the hairy regexp above, we just use a +;; simple one. +;;(defconst tcl-omit-ws-regexp "^[^] \t\n#}]\\S(*" +;; "Regular expression used in locating function definitions.") + +;; Here's another stab. I think this one actually works. Now the +;; problem seems to be that there is a bug in Emacs 19.22 where +;; end-of-defun doesn't really use the brace matching the one that +;; trails defun-prompt-regexp. +(defconst tcl-omit-ws-regexp "^[^ \t\n#}][^\n}]+}*[ \t]+") + +(defun tcl-internal-beginning-of-defun (&optional arg) + "Move backward to next beginning-of-defun. +With argument, do this that many times. +Returns t unless search stops due to end of buffer." + (interactive "p") + (if (or (null arg) (= arg 0)) + (setq arg 1)) + (let (success) + (while (progn + (setq arg (1- arg)) + (and (>= arg 0) + (setq success + (re-search-backward tcl-omit-ws-regexp nil 'move 1)))) + (while (and (looking-at "[]#}]") + (setq success + (re-search-backward tcl-omit-ws-regexp nil 'move 1))))) + (beginning-of-line) + (not (null success)))) + +(defun tcl-internal-end-of-defun (&optional arg) + "Move forward to next end of defun. +An end of a defun is found by moving forward from the beginning of one." + (interactive "p") + (if (or (null arg) (= arg 0)) (setq arg 1)) + (let ((start (point))) + ;; Was forward-char. I think this works a little better. + (forward-line) + (tcl-beginning-of-defun) + (while (> arg 0) + (while (and (re-search-forward tcl-omit-ws-regexp nil 'move 1) + (progn (beginning-of-line) t) + (looking-at "[]#}]") + (progn (forward-line) t))) + (let ((next-line (save-excursion + (forward-line) + (point)))) + (while (< (point) next-line) + (forward-sexp))) + (forward-line) + (if (> (point) start) (setq arg (1- arg)))))) + +;; In Emacs 19, we can use begining-of-defun as long as we set up a +;; certain regexp. In Emacs 18, we need our own function. +(fset 'tcl-beginning-of-defun + (if tcl-using-emacs-19 + 'beginning-of-defun + 'tcl-internal-beginning-of-defun)) + +;; Ditto end-of-defun. +(fset 'tcl-end-of-defun + (if (and tcl-using-emacs-19 (not tcl-using-xemacs-19)) + 'end-of-defun + 'tcl-internal-end-of-defun)) + +;; Internal mark-defun that is used for losing Emacsen. +(defun tcl-internal-mark-defun () + "Put mark at end of Tcl function, point at beginning." + (interactive) + (push-mark (point)) + (tcl-end-of-defun) + (if tcl-using-emacs-19 + (push-mark (point) nil t) + (push-mark (point))) + (tcl-beginning-of-defun) + (backward-paragraph)) + +;; In GNU Emacs 19-23 and later, mark-defun works as advertised. I +;; don't know about XEmacs, so for now it and Emacs 18 just lose. +(fset 'tcl-mark-defun + (if tcl-using-emacs-19-23 + 'mark-defun + 'tcl-internal-mark-defun)) + +;; In GNU Emacs 19, mark takes an additional "force" argument. I +;; don't know about XEmacs, so I'm just assuming it is the same. +;; Emacs 18 doesn't have this argument. +(defun tcl-mark () + "Return mark, or nil if none." + (if tcl-using-emacs-19 + (mark t) + (mark))) + + + +;; +;; Some helper functions. +;; + +(defun tcl-set-proc-regexp () + "Set `tcl-proc-regexp' from variable `tcl-proc-list'." + (setq tcl-proc-regexp (concat "^\\s-*\\(" + (mapconcat 'identity tcl-proc-list "\\|") + "\\)[ \t]+"))) + +(defun tcl-set-font-lock-keywords () + "Set `tcl-font-lock-keywords'. +Uses variables `tcl-proc-regexp' and `tcl-keyword-list'." + (setq tcl-font-lock-keywords + (list + ;; Names of functions (and other "defining things"). + (list (concat tcl-proc-regexp "\\([^ \t\n]+\\)") + 2 'font-lock-function-name-face) + + ;; Names of type-defining things. + (list (concat "\\(\\s-\\|^\\)\\(" + ;; FIXME Use 'regexp-quote? + (mapconcat 'identity tcl-typeword-list "\\|") + "\\)\\(\\s-\\|$\\)") + 2 'font-lock-type-face) + + ;; Keywords. Only recognized if surrounded by whitespace. + ;; FIXME consider using "not word or symbol", not + ;; "whitespace". + (cons (concat "\\(\\s-\\|^\\)\\(" + ;; FIXME Use regexp-quote? + (mapconcat 'identity tcl-keyword-list "\\|") + "\\)\\(\\s-\\|$\\)") + 2) + ))) + +(if tcl-proc-regexp + () + (tcl-set-proc-regexp)) + +(if tcl-font-lock-keywords + () + (tcl-set-font-lock-keywords)) + + + +;; +;; The mode itself. +;; + +;;;###autoload +(defun tcl-mode () + "Major mode for editing Tcl code. +Expression and list commands understand all Tcl brackets. +Tab indents for Tcl code. +Paragraphs are separated by blank lines only. +Delete converts tabs to spaces as it moves back. + +Variables controlling indentation style: + tcl-indent-level + Indentation of Tcl statements within surrounding block. + tcl-continued-indent-level + Indentation of continuation line relative to first line of command. + +Variables controlling user interaction with mode (see variable +documentation for details): + tcl-tab-always-indent + Controls action of TAB key. + tcl-auto-newline + Non-nil means automatically newline before and after braces, brackets, + and semicolons inserted in Tcl code. + tcl-electric-hash-style + Controls action of `#' key. + tcl-use-hairy-comment-detector + If t, use more complicated, but slower, comment detector. + This variable is only used in GNU Emacs 19. + tcl-use-smart-word-finder + If not nil, use a smarter, Tcl-specific way to find the current + word when looking up help on a Tcl command. + +Turning on Tcl mode calls the value of the variable `tcl-mode-hook' +with no args, if that value is non-nil. Read the documentation for +`tcl-mode-hook' to see what kinds of interesting hook functions +already exist. + +Commands: +\\{tcl-mode-map}" + (interactive) + (kill-all-local-variables) + (use-local-map tcl-mode-map) + (setq major-mode 'tcl-mode) + (setq mode-name "Tcl") + (setq local-abbrev-table tcl-mode-abbrev-table) + (set-syntax-table tcl-mode-syntax-table) + + (make-local-variable 'paragraph-start) + (make-local-variable 'paragraph-separate) + (if (and tcl-using-emacs-19-23 + (>= emacs-minor-version 29)) + (progn + ;; In Emacs 19.29, you aren't supposed to start these with a + ;; ^. + (setq paragraph-start "$\\| ") + (setq paragraph-separate paragraph-start)) + (setq paragraph-start (concat "^$\\|" page-delimiter)) + (setq paragraph-separate paragraph-start)) + (make-local-variable 'paragraph-ignore-fill-prefix) + (setq paragraph-ignore-fill-prefix t) + (make-local-variable 'fill-paragraph-function) + (setq fill-paragraph-function 'tcl-do-fill-paragraph) + + (make-local-variable 'indent-line-function) + (setq indent-line-function 'tcl-indent-line) + ;; Tcl doesn't require a final newline. + ;; (make-local-variable 'require-final-newline) + ;; (setq require-final-newline t) + + (make-local-variable 'comment-start) + (setq comment-start "# ") + (make-local-variable 'comment-start-skip) + (setq comment-start-skip "#+ *") + (make-local-variable 'comment-column) + (setq comment-column 40) + (make-local-variable 'comment-end) + (setq comment-end "") + + (make-local-variable 'outline-regexp) + (setq outline-regexp "[^\n\^M]") + (make-local-variable 'outline-level) + (setq outline-level 'tcl-outline-level) + + (make-local-variable 'font-lock-keywords) + (setq font-lock-keywords tcl-font-lock-keywords) + + ;; The following only really makes sense under GNU Emacs 19. + (make-local-variable 'imenu-create-index-function) + (setq imenu-create-index-function 'tcl-imenu-create-index-function) + (make-local-variable 'parse-sexp-ignore-comments) + + ;; Settings for new dabbrev code. + (make-local-variable 'dabbrev-case-fold-search) + (setq dabbrev-case-fold-search nil) + (make-local-variable 'dabbrev-case-replace) + (setq dabbrev-case-replace nil) + (make-local-variable 'dabbrev-abbrev-skip-leading-regexp) + (setq dabbrev-abbrev-skip-leading-regexp "[$!]") + (make-local-variable 'dabbrev-abbrev-char-regexp) + (setq dabbrev-abbrev-char-regexp "\\sw\\|\\s_") + + (if tcl-using-emacs-19 + (progn + ;; This can only be set to t in Emacs 19 and XEmacs. + ;; Emacs 18 and Epoch lose. + (setq parse-sexp-ignore-comments t) + ;; XEmacs has defun-prompt-regexp, but I don't believe + ;; that it works for end-of-defun -- only for + ;; beginning-of-defun. + (make-local-variable 'defun-prompt-regexp) + (setq defun-prompt-regexp tcl-omit-ws-regexp) + ;; The following doesn't work in Lucid Emacs 19.6, but maybe + ;; it will appear in later versions. + (make-local-variable 'add-log-current-defun-function) + (setq add-log-current-defun-function 'add-log-tcl-defun)) + (setq parse-sexp-ignore-comments nil)) + + ;; Put Tcl menu into menubar for XEmacs. This happens + ;; automatically for GNU Emacs. + (if (and tcl-using-xemacs-19 + current-menubar + (not (assoc "Tcl" current-menubar))) + (progn + (set-buffer-menubar (copy-sequence current-menubar)) + (add-menu nil "Tcl" tcl-xemacs-menu))) + ;; Append Tcl menu to popup menu for XEmacs. + (if (and tcl-using-xemacs-19 (boundp 'mode-popup-menu)) + (setq mode-popup-menu + (cons (concat mode-name " Mode Commands") tcl-xemacs-menu))) + + ;; If hilit19 is loaded, add our stuff. + (if (featurep 'hilit19) + (tcl-hilit)) + + (run-hooks 'tcl-mode-hook)) + + + +;; This is used for braces, brackets, and semi (except for closing +;; braces, which are handled specially). +(defun tcl-electric-char (arg) + "Insert character and correct line's indentation." + (interactive "p") + ;; Indent line first; this looks better if parens blink. + (tcl-indent-line) + (self-insert-command arg) + (if (and tcl-auto-newline (= last-command-char ?\;)) + (progn + (newline) + (tcl-indent-line)))) + +;; This is used for closing braces. If tcl-auto-newline is set, can +;; insert a newline both before and after the brace, depending on +;; context. FIXME should this be configurable? Does anyone use this? +(defun tcl-electric-brace (arg) + "Insert character and correct line's indentation." + (interactive "p") + ;; If auto-newlining and there is stuff on the same line, insert a + ;; newline first. + (if tcl-auto-newline + (progn + (if (save-excursion + (skip-chars-backward " \t") + (bolp)) + () + (tcl-indent-line) + (newline)) + ;; In auto-newline case, must insert a newline after each + ;; brace. So an explicit loop is needed. + (while (> arg 0) + (insert last-command-char) + (tcl-indent-line) + (newline) + (setq arg (1- arg)))) + (self-insert-command arg)) + (tcl-indent-line)) + + + +(defun tcl-indent-command (&optional arg) + "Indent current line as Tcl code, or in some cases insert a tab character. +If tcl-tab-always-indent is t (the default), always indent current line. +If tcl-tab-always-indent is nil and point is not in the indentation +area at the beginning of the line, a TAB is inserted. +Other values of tcl-tab-always-indent cause the first possible action +from the following list to take place: + + 1. Move from beginning of line to correct indentation. + 2. Delete an empty comment. + 3. Move forward to start of comment, indenting if necessary. + 4. Move forward to end of line, indenting if necessary. + 5. Create an empty comment. + 6. Move backward to start of comment, indenting if necessary." + (interactive "p") + (cond + ((not tcl-tab-always-indent) + ;; Indent if in indentation area, otherwise insert TAB. + (if (<= (current-column) (current-indentation)) + (tcl-indent-line) + (self-insert-command arg))) + ((eq tcl-tab-always-indent t) + ;; Always indent. + (tcl-indent-line)) + (t + ;; "Perl-mode" style TAB command. + (let* ((ipoint (point)) + (eolpoint (progn + (end-of-line) + (point))) + (comment-p (tcl-in-comment))) + (cond + ((= ipoint (save-excursion + (beginning-of-line) + (point))) + (beginning-of-line) + (tcl-indent-line) + ;; If indenting didn't leave us in column 0, go to the + ;; indentation. Otherwise leave point at end of line. This + ;; is a hack. + (if (= (point) (save-excursion + (beginning-of-line) + (point))) + (end-of-line) + (back-to-indentation))) + ((and comment-p (looking-at "[ \t]*$")) + ;; Empty comment, so delete it. We also delete any ";" + ;; characters at the end of the line. I think this is + ;; friendlier, but I don't know how other people will feel. + (backward-char) + (skip-chars-backward " \t;") + (delete-region (point) eolpoint)) + ((and comment-p (< ipoint (point))) + ;; Before comment, so skip to it. + (tcl-indent-line) + (indent-for-comment)) + ((/= ipoint eolpoint) + ;; Go to end of line (since we're not there yet). + (goto-char eolpoint) + (tcl-indent-line)) + ((not comment-p) + (tcl-indent-line) + (tcl-indent-for-comment)) + (t + ;; Go to start of comment. We don't leave point where it is + ;; because we want to skip comment-start-skip. + (tcl-indent-line) + (indent-for-comment))))))) + +(defun tcl-indent-line () + "Indent current line as Tcl code. +Return the amount the indentation changed by." + (let ((indent (calculate-tcl-indent nil)) + beg shift-amt + (case-fold-search nil) + (pos (- (point-max) (point)))) + (beginning-of-line) + (setq beg (point)) + (cond ((eq indent nil) + (setq indent (current-indentation))) + (t + (skip-chars-forward " \t") + (if (listp indent) (setq indent (car indent))) + (cond ((= (following-char) ?}) + (setq indent (- indent tcl-indent-level))) + ((= (following-char) ?\]) + (setq indent (- indent 1)))))) + (skip-chars-forward " \t") + (setq shift-amt (- indent (current-column))) + (if (zerop shift-amt) + (if (> (- (point-max) pos) (point)) + (goto-char (- (point-max) pos))) + (delete-region beg (point)) + (indent-to indent) + ;; If initial point was within line's indentation, + ;; position after the indentation. Else stay at same point in text. + (if (> (- (point-max) pos) (point)) + (goto-char (- (point-max) pos)))) + shift-amt)) + +(defun tcl-figure-type () + "Determine type of sexp at point. +This is either 'tcl-expr, 'tcl-commands, or nil. Puts point at start +of sexp that indicates types. + +See documentation for variable `tcl-type-alist' for more information." + (let ((count 0) + result + word-stack) + (while (and (< count 5) + (not result)) + (condition-case nil + (progn + ;; FIXME should use "tcl-backward-sexp", which would skip + ;; over entire variables, etc. + (backward-sexp) + (if (looking-at "[a-zA-Z_]+") + (let ((list tcl-type-alist) + entry) + (setq word-stack (cons (tcl-word-no-props) word-stack)) + (while (and list (not result)) + (setq entry (car list)) + (setq list (cdr list)) + (let ((index 0)) + (while (and entry (<= index count)) + ;; Abort loop if string does not match word on + ;; stack. + (and (stringp (car entry)) + (not (string= (car entry) + (nth index word-stack))) + (setq entry nil)) + (setq entry (cdr entry)) + (setq index (1+ index))) + (and (> index count) + (not (stringp (car entry))) + (setq result (car entry))) + ))) + (setq word-stack (cons nil word-stack)))) + (error nil)) + (setq count (1+ count))) + (and tcl-explain-indentation + (message "Indentation type %s" result)) + result)) + +(defun calculate-tcl-indent (&optional parse-start) + "Return appropriate indentation for current line as Tcl code. +In usual case returns an integer: the column to indent to. +Returns nil if line starts inside a string, t if in a comment." + (save-excursion + (beginning-of-line) + (let* ((indent-point (point)) + (case-fold-search nil) + (continued-line + (save-excursion + (if (bobp) + nil + (backward-char) + (= ?\\ (preceding-char))))) + (continued-indent-value (if continued-line + tcl-continued-indent-level + 0)) + state + containing-sexp + found-next-line) + (if parse-start + (goto-char parse-start) + (tcl-beginning-of-defun)) + (while (< (point) indent-point) + (setq parse-start (point)) + (setq state (parse-partial-sexp (point) indent-point 0)) + (setq containing-sexp (car (cdr state)))) + (cond ((or (nth 3 state) (nth 4 state)) + ;; Inside comment or string. Return nil or t if should + ;; not change this line + (nth 4 state)) + ((null containing-sexp) + ;; Line is at top level. + continued-indent-value) + (t + ;; Set expr-p if we are looking at the expression part of + ;; an "if", "expr", etc statement. Set commands-p if we + ;; are looking at the body part of an if, while, etc + ;; statement. FIXME Should check for "for" loops here. + (goto-char containing-sexp) + (let* ((sexpr-type (tcl-figure-type)) + (expr-p (eq sexpr-type 'tcl-expr)) + (commands-p (eq sexpr-type 'tcl-commands)) + (expr-start (point))) + ;; Find the first statement in the block and indent + ;; like it. The first statement in the block might be + ;; on the same line, so what we do is skip all + ;; "virtually blank" lines, looking for a non-blank + ;; one. A line is virtually blank if it only contains + ;; a comment and whitespace. FIXME continued comments + ;; aren't supported. They are a wart on Tcl anyway. + ;; We do it this funky way because we want to know if + ;; we've found a statement on some line _after_ the + ;; line holding the sexp opener. + (goto-char containing-sexp) + (forward-char) + (if (and (< (point) indent-point) + (looking-at "[ \t]*\\(#.*\\)?$")) + (progn + (forward-line) + (while (and (< (point) indent-point) + (looking-at "[ \t]*\\(#.*\\)?$")) + (setq found-next-line t) + (forward-line)))) + (if (or continued-line + (/= (char-after containing-sexp) ?{) + expr-p) + (progn + ;; Line is continuation line, or the sexp opener + ;; is not a curly brace, or we are are looking at + ;; an `expr' expression (which must be split + ;; specially). So indentation is column of first + ;; good spot after sexp opener (with some added + ;; in the continued-line case). If there is no + ;; nonempty line before the indentation point, we + ;; use the column of the character after the sexp + ;; opener. + (if (>= (point) indent-point) + (progn + (goto-char containing-sexp) + (forward-char)) + (skip-chars-forward " \t")) + (+ (current-column) continued-indent-value)) + ;; After a curly brace, and not a continuation line. + ;; So take indentation from first good line after + ;; start of block, unless that line is on the same + ;; line as the opening brace. In this case use the + ;; indentation of the opening brace's line, plus + ;; another indent step. If we are in the body part + ;; of an "if" or "while" then the indentation is + ;; taken from the line holding the start of the + ;; statement. + (if (and (< (point) indent-point) + found-next-line) + (current-indentation) + (if commands-p + (goto-char expr-start) + (goto-char containing-sexp)) + (+ (current-indentation) tcl-indent-level))))))))) + + + +(defun indent-tcl-exp () + "Indent each line of the Tcl grouping following point." + (interactive) + (let ((indent-stack (list nil)) + (contain-stack (list (point))) + (case-fold-search nil) + outer-loop-done inner-loop-done state ostate + this-indent last-sexp continued-line + (next-depth 0) + last-depth) + (save-excursion + (forward-sexp 1)) + (save-excursion + (setq outer-loop-done nil) + (while (and (not (eobp)) (not outer-loop-done)) + (setq last-depth next-depth) + ;; Compute how depth changes over this line + ;; plus enough other lines to get to one that + ;; does not end inside a comment or string. + ;; Meanwhile, do appropriate indentation on comment lines. + (setq inner-loop-done nil) + (while (and (not inner-loop-done) + (not (and (eobp) (setq outer-loop-done t)))) + (setq ostate state) + (setq state (parse-partial-sexp (point) (progn (end-of-line) (point)) + nil nil state)) + (setq next-depth (car state)) + (if (and (car (cdr (cdr state))) + (>= (car (cdr (cdr state))) 0)) + (setq last-sexp (car (cdr (cdr state))))) + (if (or (nth 4 ostate)) + (tcl-indent-line)) + (if (or (nth 3 state)) + (forward-line 1) + (setq inner-loop-done t))) + (if (<= next-depth 0) + (setq outer-loop-done t)) + (if outer-loop-done + nil + ;; If this line had ..))) (((.. in it, pop out of the levels + ;; that ended anywhere in this line, even if the final depth + ;; doesn't indicate that they ended. + (while (> last-depth (nth 6 state)) + (setq indent-stack (cdr indent-stack) + contain-stack (cdr contain-stack) + last-depth (1- last-depth))) + (if (/= last-depth next-depth) + (setq last-sexp nil)) + ;; Add levels for any parens that were started in this line. + (while (< last-depth next-depth) + (setq indent-stack (cons nil indent-stack) + contain-stack (cons nil contain-stack) + last-depth (1+ last-depth))) + (if (null (car contain-stack)) + (setcar contain-stack + (or (car (cdr state)) + (save-excursion + (forward-sexp -1) + (point))))) + (forward-line 1) + (setq continued-line + (save-excursion + (backward-char) + (= (preceding-char) ?\\))) + (skip-chars-forward " \t") + (if (eolp) + nil + (if (and (car indent-stack) + (>= (car indent-stack) 0)) + ;; Line is on an existing nesting level. + (setq this-indent (car indent-stack)) + ;; Just started a new nesting level. + ;; Compute the standard indent for this level. + (let ((val (calculate-tcl-indent + (if (car indent-stack) + (- (car indent-stack)))))) + (setcar indent-stack + (setq this-indent val)) + (setq continued-line nil))) + (cond ((not (numberp this-indent))) + ((= (following-char) ?}) + (setq this-indent (- this-indent tcl-indent-level))) + ((= (following-char) ?\]) + (setq this-indent (- this-indent 1)))) + ;; Put chosen indentation into effect. + (or (null this-indent) + (= (current-column) + (if continued-line + (+ this-indent tcl-indent-level) + this-indent)) + (progn + (delete-region (point) (progn (beginning-of-line) (point))) + (indent-to + (if continued-line + (+ this-indent tcl-indent-level) + this-indent))))))))) + ) + + + +;; +;; Interfaces to other packages. +;; + +(defun tcl-imenu-create-index-function () + "Generate alist of indices for imenu." + (let ((re (concat tcl-proc-regexp "\\([^ \t\n{]+\\)")) + alist prev-pos) + (goto-char (point-min)) + (imenu-progress-message prev-pos 0) + (save-match-data + (while (re-search-forward re nil t) + (imenu-progress-message prev-pos) + ;; Position on start of proc name, not beginning of line. + (setq alist (cons + (cons (buffer-substring (match-beginning 2) (match-end 2)) + (match-beginning 2)) + alist)))) + (imenu-progress-message prev-pos 100) + (nreverse alist))) + +;; FIXME Definition of function is very ad-hoc. Should use +;; tcl-beginning-of-defun. Also has incestuous knowledge about the +;; format of tcl-proc-regexp. +(defun add-log-tcl-defun () + "Return name of Tcl function point is in, or nil." + (save-excursion + (end-of-line) + (if (re-search-backward (concat tcl-proc-regexp "\\([^ \t\n{]+\\)") nil t) + (buffer-substring (match-beginning 2) + (match-end 2))))) + +(defun tcl-outline-level () + (save-excursion + (skip-chars-forward " \t") + (current-column))) + + + +;; +;; Helper functions for inferior Tcl mode. +;; + +;; This exists to let us delete the prompt when commands are sent +;; directly to the inferior Tcl. See gud.el for an explanation of how +;; it all works (I took it from there). This stuff doesn't really +;; work as well as I'd like it to. But I don't believe there is +;; anything useful that can be done. +(defvar inferior-tcl-delete-prompt-marker nil) + +(defun tcl-filter (proc string) + (let ((inhibit-quit t)) + (save-excursion + (set-buffer (process-buffer proc)) + (goto-char (process-mark proc)) + ;; Delete prompt if requested. + (if (marker-buffer inferior-tcl-delete-prompt-marker) + (progn + (delete-region (point) inferior-tcl-delete-prompt-marker) + (set-marker inferior-tcl-delete-prompt-marker nil))))) + (if tcl-using-emacs-19 + (comint-output-filter proc string) + (funcall comint-output-filter string))) + +(defun tcl-send-string (proc string) + (save-excursion + (set-buffer (process-buffer proc)) + (goto-char (process-mark proc)) + (beginning-of-line) + (if (looking-at comint-prompt-regexp) + (set-marker inferior-tcl-delete-prompt-marker (point)))) + (comint-send-string proc string)) + +(defun tcl-send-region (proc start end) + (save-excursion + (set-buffer (process-buffer proc)) + (goto-char (process-mark proc)) + (beginning-of-line) + (if (looking-at comint-prompt-regexp) + (set-marker inferior-tcl-delete-prompt-marker (point)))) + (comint-send-region proc start end)) + +(defun switch-to-tcl (eob-p) + "Switch to inferior Tcl process buffer. +With argument, positions cursor at end of buffer." + (interactive "P") + (if (get-buffer inferior-tcl-buffer) + (pop-to-buffer inferior-tcl-buffer) + (error "No current inferior Tcl buffer")) + (cond (eob-p + (push-mark) + (goto-char (point-max))))) + +(defun inferior-tcl-proc () + "Return current inferior Tcl process. +See variable `inferior-tcl-buffer'." + (let ((proc (get-buffer-process (if (eq major-mode 'inferior-tcl-mode) + (current-buffer) + inferior-tcl-buffer)))) + (or proc + (error "No Tcl process; see variable `inferior-tcl-buffer'")))) + +(defun tcl-eval-region (start end &optional and-go) + "Send the current region to the inferior Tcl process. +Prefix argument means switch to the Tcl buffer afterwards." + (interactive "r\nP") + (let ((proc (inferior-tcl-proc))) + (tcl-send-region proc start end) + (tcl-send-string proc "\n") + (if and-go (switch-to-tcl t)))) + +(defun tcl-eval-defun (&optional and-go) + "Send the current defun to the inferior Tcl process. +Prefix argument means switch to the Tcl buffer afterwards." + (interactive "P") + (save-excursion + (tcl-end-of-defun) + (let ((end (point))) + (tcl-beginning-of-defun) + (tcl-eval-region (point) end))) + (if and-go (switch-to-tcl t))) + + + +;; +;; Inferior Tcl mode itself. +;; + +(defun inferior-tcl-mode () + "Major mode for interacting with Tcl interpreter. + +A Tcl process can be started with M-x inferior-tcl. + +Entry to this mode runs the hooks comint-mode-hook and +inferior-tcl-mode-hook, in that order. + +You can send text to the inferior Tcl process from other buffers +containing Tcl source. + +Variables controlling Inferior Tcl mode: + tcl-application + Name of program to run. + tcl-command-switches + Command line arguments to `tcl-application'. + tcl-prompt-regexp + Matches prompt. + inferior-tcl-source-command + Command to use to read Tcl file in running application. + inferior-tcl-buffer + The current inferior Tcl process buffer. See variable + documentation for details on multiple-process support. + +The following commands are available: +\\{inferior-tcl-mode-map}" + (interactive) + (comint-mode) + (setq comint-prompt-regexp (or tcl-prompt-regexp + (concat "^" + (regexp-quote tcl-application) + ">"))) + (setq major-mode 'inferior-tcl-mode) + (setq mode-name "Inferior Tcl") + (if (boundp 'modeline-process) + (setq modeline-process '(": %s")) ; For XEmacs. + (setq mode-line-process '(": %s"))) + (use-local-map inferior-tcl-mode-map) + (setq local-abbrev-table tcl-mode-abbrev-table) + (set-syntax-table tcl-mode-syntax-table) + (if tcl-using-emacs-19 + (progn + (make-local-variable 'defun-prompt-regexp) + (setq defun-prompt-regexp tcl-omit-ws-regexp))) + (make-local-variable 'inferior-tcl-delete-prompt-marker) + (setq inferior-tcl-delete-prompt-marker (make-marker)) + (set-process-filter (get-buffer-process (current-buffer)) 'tcl-filter) + (run-hooks 'inferior-tcl-mode-hook)) + +;;;###autoload +(defun inferior-tcl (cmd) + "Run inferior Tcl process. +Prefix arg means enter program name interactively. +See documentation for function `inferior-tcl-mode' for more information." + (interactive + (list (if current-prefix-arg + (read-string "Run Tcl: " tcl-application) + tcl-application))) + (if (not (comint-check-proc "*inferior-tcl*")) + (progn + (set-buffer (apply (function make-comint) "inferior-tcl" cmd nil + tcl-command-switches)) + (inferior-tcl-mode))) + (make-local-variable 'tcl-application) + (setq tcl-application cmd) + (setq inferior-tcl-buffer "*inferior-tcl*") + (switch-to-buffer "*inferior-tcl*")) + +(and (fboundp 'defalias) + (defalias 'run-tcl 'inferior-tcl)) + + + +;; +;; Auto-fill support. +;; + +(defun tcl-real-command-p () + "Return nil if point is not at the beginning of a command. +A command is the first word on an otherwise empty line, or the +first word following a semicolon, opening brace, or opening bracket." + (save-excursion + (skip-chars-backward " \t") + (cond + ((bobp) t) + ((bolp) + (backward-char) + ;; Note -- continued comments are not supported here. I + ;; consider those to be a wart on the language. + (not (eq ?\\ (preceding-char)))) + (t + (memq (preceding-char) '(?\; ?{ ?\[)))))) + +;; FIXME doesn't actually return t. See last case. +(defun tcl-real-comment-p () + "Return t if point is just after the `#' beginning a real comment. +Does not check to see if previous char is actually `#'. +A real comment is either at the beginning of the buffer, +preceeded only by whitespace on the line, or has a preceeding +semicolon, opening brace, or opening bracket on the same line." + (save-excursion + (backward-char) + (tcl-real-command-p))) + +(defun tcl-hairy-scan-for-comment (state end always-stop) + "Determine if point is in a comment. +Returns a list of the form `(FLAG . STATE)'. STATE can be used +as input to future invocations. FLAG is nil if not in comment, +t otherwise. If in comment, leaves point at beginning of comment. +Only works in Emacs 19. See also `tcl-simple-scan-for-comment', a +simpler version that is often right, and works in Emacs 18." + (let ((bol (save-excursion + (goto-char end) + (beginning-of-line) + (point))) + real-comment + last-cstart) + (while (and (not last-cstart) (< (point) end)) + (setq real-comment nil) ;In case we've looped around and it is + ;set. + (setq state (parse-partial-sexp (point) end nil nil state t)) + (if (nth 4 state) + (progn + ;; If ALWAYS-STOP is set, stop even if we don't have a + ;; real comment, or if the comment isn't on the same line + ;; as the end. + (if always-stop (setq last-cstart (point))) + ;; If we have a real comment, then set the comment + ;; starting point if we are on the same line as the ending + ;; location. + (setq real-comment (tcl-real-comment-p)) + (if real-comment + (progn + (and (> (point) bol) (setq last-cstart (point))) + ;; NOTE Emacs 19 has a misfeature whereby calling + ;; parse-partial-sexp with COMMENTSTOP set and with + ;; an initial list that says point is in a comment + ;; will cause an immediate return. So we must skip + ;; over the comment ourselves. + (beginning-of-line 2))) + ;; Frob the state to make it look like we aren't in a + ;; comment. + (setcar (nthcdr 4 state) nil)))) + (and last-cstart + (goto-char last-cstart)) + (cons real-comment state))) + +(defun tcl-hairy-in-comment () + "Return t if point is in a comment, and leave point at beginning +of comment." + (let ((save (point))) + (tcl-beginning-of-defun) + (car (tcl-hairy-scan-for-comment nil save nil)))) + +(defun tcl-simple-in-comment () + "Return t if point is in comment, and leave point at beginning +of comment. This is faster that `tcl-hairy-in-comment', but is +correct less often." + (let ((save (point)) + comment) + (beginning-of-line) + (while (and (< (point) save) (not comment)) + (search-forward "#" save 'move) + (setq comment (tcl-real-comment-p))) + comment)) + +(defun tcl-in-comment () + "Return t if point is in comment, and leave point at beginning +of comment." + (if (and tcl-pps-has-arg-6 + tcl-use-hairy-comment-detector) + (tcl-hairy-in-comment) + (tcl-simple-in-comment))) + +(defun tcl-do-fill-paragraph (ignore) + "fill-paragraph function for Tcl mode. Only fills in a comment." + (let (in-comment col where) + (save-excursion + (end-of-line) + (setq in-comment (tcl-in-comment)) + (if in-comment + (progn + (setq where (1+ (point))) + (setq col (1- (current-column)))))) + (and in-comment + (save-excursion + (back-to-indentation) + (= col (current-column))) + ;; In a comment. Set the fill prefix, and find the paragraph + ;; boundaries by searching for lines that look like + ;; comment-only lines. + (let ((fill-prefix (buffer-substring (progn + (beginning-of-line) + (point)) + where)) + p-start p-end) + ;; Search backwards. + (save-excursion + (while (looking-at "^[ \t]*#") + (forward-line -1)) + (forward-line) + (setq p-start (point))) + + ;; Search forwards. + (save-excursion + (while (looking-at "^[ \t]*#") + (forward-line)) + (setq p-end (point))) + + ;; Narrow and do the fill. + (save-restriction + (narrow-to-region p-start p-end) + (fill-paragraph ignore))))) + t) + +(defun tcl-do-auto-fill () + "Auto-fill function for Tcl mode. Only auto-fills in a comment." + (if (> (current-column) fill-column) + (let ((fill-prefix "# ") + in-comment col) + (save-excursion + (setq in-comment (tcl-in-comment)) + (if in-comment + (setq col (1- (current-column))))) + (if in-comment + (progn + (do-auto-fill) + (save-excursion + (back-to-indentation) + (delete-region (point) (save-excursion + (beginning-of-line) + (point))) + (indent-to-column col))))))) + + + +;; +;; Help-related code. +;; + +(defvar tcl-help-saved-dirs nil + "Saved help directories. +If `tcl-help-directory-list' changes, this allows `tcl-help-on-word' +to update the alist.") + +(defvar tcl-help-alist nil + "Alist with command names as keys and filenames as values.") + +(defun tcl-help-snarf-commands (dirlist) + "Build alist of commands and filenames." + (while dirlist + (let ((files (directory-files (car dirlist) t))) + (while files + (if (and (file-directory-p (car files)) + (not + (let ((fpart (file-name-nondirectory (car files)))) + (or (equal fpart ".") + (equal fpart ".."))))) + (let ((matches (directory-files (car files) t))) + (while matches + (or (file-directory-p (car matches)) + (setq tcl-help-alist + (cons + (cons (file-name-nondirectory (car matches)) + (car matches)) + tcl-help-alist))) + (setq matches (cdr matches))))) + (setq files (cdr files)))) + (setq dirlist (cdr dirlist)))) + +(defun tcl-reread-help-files () + "Set up to re-read files, and then do it." + (interactive) + (message "Building Tcl help file index...") + (setq tcl-help-saved-dirs tcl-help-directory-list) + (setq tcl-help-alist nil) + (tcl-help-snarf-commands tcl-help-directory-list) + (message "Building Tcl help file index...done")) + +(defun tcl-word-no-props () + "Like current-word, but strips properties." + (let ((word (current-word))) + (and (fboundp 'set-text-properties) + (set-text-properties 0 (length word) nil word)) + word)) + +(defun tcl-current-word (flag) + "Return current command word, or nil. +If FLAG is nil, just uses `current-word'. +Otherwise scans backward for most likely Tcl command word." + (if (and flag + (memq major-mode '(tcl-mode inferior-tcl-mode))) + (condition-case nil + (save-excursion + ;; Look backward for first word actually in alist. + (if (bobp) + () + (while (and (not (bobp)) + (not (tcl-real-command-p))) + (backward-sexp))) + (if (assoc (tcl-word-no-props) tcl-help-alist) + (tcl-word-no-props))) + (error nil)) + (tcl-word-no-props))) + +;;;###autoload +(defun tcl-help-on-word (command &optional arg) + "Get help on Tcl command. Default is word at point. +Prefix argument means invert sense of `tcl-use-smart-word-finder'." + (interactive + (list + (progn + (if (not (equal tcl-help-directory-list tcl-help-saved-dirs)) + (tcl-reread-help-files)) + (let ((word (tcl-current-word + (if current-prefix-arg + (not tcl-use-smart-word-finder) + tcl-use-smart-word-finder)))) + (completing-read + (if (or (null word) (string= word "")) + "Help on Tcl command: " + (format "Help on Tcl command (default %s): " word)) + tcl-help-alist nil t))) + current-prefix-arg)) + (if (not (equal tcl-help-directory-list tcl-help-saved-dirs)) + (tcl-reread-help-files)) + (if (string= command "") + (setq command (tcl-current-word + (if arg + (not tcl-use-smart-word-finder) + tcl-use-smart-word-finder)))) + (let* ((help (get-buffer-create "*Tcl help*")) + (cell (assoc command tcl-help-alist)) + (file (and cell (cdr cell)))) + (set-buffer help) + (delete-region (point-min) (point-max)) + (if file + (progn + (insert "*** " command "\n\n") + (insert-file-contents file)) + (if (string= command "") + (insert "Magical Pig!") + (insert "Tcl command " command " not in help\n"))) + (set-buffer-modified-p nil) + (goto-char (point-min)) + (display-buffer help))) + + + +;; +;; Other interactive stuff. +;; + +(defvar tcl-previous-dir/file nil + "Record last directory and file used in loading. +This holds a cons cell of the form `(DIRECTORY . FILE)' +describing the last `tcl-load-file' command.") + +(defun tcl-load-file (file &optional and-go) + "Load a Tcl file into the inferior Tcl process. +Prefix argument means switch to the Tcl buffer afterwards." + (interactive + (list + ;; car because comint-get-source returns a list holding the + ;; filename. + (car (comint-get-source "Load Tcl file: " + (or (and + (eq major-mode 'tcl-mode) + (buffer-file-name)) + tcl-previous-dir/file) + '(tcl-mode) t)) + current-prefix-arg)) + (comint-check-source file) + (setq tcl-previous-dir/file (cons (file-name-directory file) + (file-name-nondirectory file))) + (tcl-send-string (inferior-tcl-proc) + (format inferior-tcl-source-command (tcl-quote file))) + (if and-go (switch-to-tcl t))) + +(defun tcl-restart-with-file (file &optional and-go) + "Restart inferior Tcl with file. +If an inferior Tcl process exists, it is killed first. +Prefix argument means switch to the Tcl buffer afterwards." + (interactive + (list + (car (comint-get-source "Restart with Tcl file: " + (or (and + (eq major-mode 'tcl-mode) + (buffer-file-name)) + tcl-previous-dir/file) + '(tcl-mode) t)) + current-prefix-arg)) + (let* ((buf (if (eq major-mode 'inferior-tcl-mode) + (current-buffer) + inferior-tcl-buffer)) + (proc (and buf (get-process buf)))) + (cond + ((not (and buf (get-buffer buf))) + ;; I think this will be ok. + (inferior-tcl tcl-application) + (tcl-load-file file and-go)) + ((or + (not (comint-check-proc buf)) + (yes-or-no-p + "A Tcl process is running, are you sure you want to reset it? ")) + (save-excursion + (comint-check-source file) + (setq tcl-previous-dir/file (cons (file-name-directory file) + (file-name-nondirectory file))) + (comint-exec (get-buffer-create buf) + (if proc + (process-name proc) + "inferior-tcl") + tcl-application file tcl-command-switches) + (if and-go (switch-to-tcl t))))))) + +;; FIXME I imagine you can do this under Emacs 18. I just don't know +;; how. +(defun tcl-auto-fill-mode (&optional arg) + "Like `auto-fill-mode', but controls filling of Tcl comments." + (interactive "P") + (and (not tcl-using-emacs-19) + (error "You must use Emacs 19 to get this feature.")) + ;; Following code taken from "auto-fill-mode" (simple.el). + (prog1 + (setq auto-fill-function + (if (if (null arg) + (not auto-fill-function) + (> (prefix-numeric-value arg) 0)) + 'tcl-do-auto-fill + nil)) + (force-mode-line-update))) + +;; hilit19 support from "Chris Alfeld" +(defun tcl-hilit () + (hilit-set-mode-patterns + '(tcl-mode) + '( + ("\\(^ *\\|\; *\\)#.*$" nil comment) + ("[^\\]\\(\\$[A-Za-z0-9\\-\\_./\\(\\)]+\\)" 1 label) + ("[^_]\\<\\(append\\|array\\|auto_execok\\|auto_load\\|auto_mkindex\\|auto_reset\\|break\\|case\\|catch\\|cd\\|close\\|concat\\|continue\\|eof\\|error\\|eval\\|exec\\|exit\\|expr\\|file\\|flush\\|for\\|foreach\\|format\\|gets\\|glob\\|global\\|history\\|if\\|incr\\|info\\|join\\|lappend\\|lindex\\|linsert\\|list\\|llength\\|lrange\\|lreplace\\|lsearch\\|lsort\\|open\\|pid\\|proc\\|puts\\|pwd\\|read\\|regexp\\|regsub\\|rename\\|return\\|scan\\|seek\\|set\\|source\\|split\\|string\\|switch\\|tell\\|time\\|trace\\|unknown\\|unset\\|uplevel\\|upvar\\|while\\)\\>[^_]" 1 keyword) ; tcl keywords + ("[^_]\\<\\(after\\|bell\\|bind\\|bindtags\\|clipboard\\|destroy\\|fileevent\\|focus\\|grab\\|image\\|lower\\|option\\|pack\\|place\\|raise\\|scale\\|selection\\|send\\|subst\\|tk\\|tk_popup\\|tkwait\\|update\\|winfo\\|wm\\)\\>[^_]" 1 define) ; tk keywords + ("[^_]\\<\\(button\\|canvas\\|checkbutton\\|entry\\|frame\\|label\\|listbox\\|menu\\|menubutton\\|message\\|radiobutton\\|scrollbar\\|text\\|toplevel\\)\\>[^_]" 1 decl) ; tk widgets + ("[^_]\\<\\(tix\\((ButtonBox\\|Baloon\\|Control\\|DirList\\|ExFileSelectBox\\|ExFileSelectDialog\\|FileEntry\\|HList\\|LabelEntry\\|LabelFrame\\|NoteBook\\|OptionMenu\\|PanedWindow\\|PopupMenu\\|ScrolledHList\\|ScrolledText\\|ScrolledWindow\\|Select\\|StdButtonBox\\)\\)\\>[^_]" 1 defun) ; tix widgets + ("[{}\\\"\\(\\)]" nil include) ; misc punctuation + ))) + +(defun tcl-electric-hash (&optional count) + "Insert a `#' and quote if it does not start a real comment. +Prefix arg is number of `#'s to insert. +See variable `tcl-electric-hash-style' for description of quoting +styles." + (interactive "p") + (or count (setq count 1)) + (if (> count 0) + (let ((type + (if (eq tcl-electric-hash-style 'smart) + (if (> count 3) ; FIXME what is "smart"? + 'quote + 'backslash) + tcl-electric-hash-style)) + comment) + (if type + (progn + (save-excursion + (insert "#") + (setq comment (tcl-in-comment))) + (delete-char 1) + (and tcl-explain-indentation (message "comment: %s" comment)) + (cond + ((eq type 'quote) + (if (not comment) + (insert "\""))) + ((eq type 'backslash) + ;; The following will set count to 0, so the + ;; insert-char can still be run. + (if (not comment) + (while (> count 0) + (insert "\\#") + (setq count (1- count))))) + (t nil)))) + (insert-char ?# count)))) + +(defun tcl-hashify-buffer () + "Quote all `#'s in current buffer that aren't Tcl comments." + (interactive) + (save-excursion + (goto-char (point-min)) + (if (and tcl-pps-has-arg-6 tcl-use-hairy-comment-detector) + (let (state + result) + (while (< (point) (point-max)) + (setq result (tcl-hairy-scan-for-comment state (point-max) t)) + (if (car result) + (beginning-of-line 2) + (backward-char) + (if (eq ?# (following-char)) + (insert "\\")) + (forward-char)) + (setq state (cdr result)))) + (while (and (< (point) (point-max)) + (search-forward "#" nil 'move)) + (if (tcl-real-comment-p) + (beginning-of-line 2) + ;; There's really no good way for the simple converter to + ;; work. So we just quote # if it isn't already quoted. + ;; Bogus, but it works. + (backward-char) + (if (not (eq ?\\ (preceding-char))) + (insert "\\")) + (forward-char)))))) + +(defun tcl-indent-for-comment () + "Indent this line's comment to comment column, or insert an empty comment. +Is smart about syntax of Tcl comments. +Parts of this were taken from indent-for-comment (simple.el)." + (interactive "*") + (end-of-line) + (or (tcl-in-comment) + (progn + ;; Not in a comment, so we have to insert one. Create an + ;; empty comment (since there isn't one on this line). If + ;; line is not blank, make sure we insert a ";" first. + (skip-chars-backward " \t") + (let ((eolpoint (point))) + (beginning-of-line) + (if (/= (point) eolpoint) + (progn + (goto-char eolpoint) + (insert + (if (tcl-real-command-p) "" ";") + "# ") + (backward-char)))))) + ;; Point is just after the "#" starting a comment. Move it as + ;; appropriate. + (let* ((indent (if comment-indent-hook + (funcall comment-indent-hook) + (funcall comment-indent-function))) + (begpos (progn + (backward-char) + (point)))) + (if (/= begpos indent) + (progn + (skip-chars-backward " \t" (save-excursion + (beginning-of-line) + (point))) + (delete-region (point) begpos) + (indent-to indent))) + (looking-at comment-start-skip) ; Always true. + (goto-char (match-end 0)) + ;; I don't like the effect of the next two. + ;;(skip-chars-backward " \t" (match-beginning 0)) + ;;(skip-chars-backward "^ \t" (match-beginning 0)) + )) + +;; The following was inspired by the Tcl editing mode written by +;; Gregor Schmid . His version also +;; attempts to snarf the command line options from the command line, +;; but I didn't think that would really be that helpful (doesn't seem +;; like it owould be right enough. His version also looks for the +;; "#!/bin/csh ... exec" hack, but that seemed even less useful. +;; FIXME should make sure that the application mentioned actually +;; exists. +(defun tcl-guess-application () + "Attempt to guess Tcl application by looking at first line. +The first line is assumed to look like \"#!.../program ...\"." + (save-excursion + (goto-char (point-min)) + (if (looking-at "#![^ \t]*/\\([^ \t\n/]+\\)\\([ \t]\\|$\\)") + (progn + (make-local-variable 'tcl-application) + (setq tcl-application (buffer-substring (match-beginning 1) + (match-end 1))))))) + +;; This only exists to put on the menubar. I couldn't figure out any +;; other way to do it. FIXME should take "number of #-marks" +;; argument. +(defun tcl-uncomment-region (beg end) + "Uncomment region." + (interactive "r") + (comment-region beg end -1)) + + + +;; +;; XEmacs menu support. +;; Taken from schmid@fb3-s7.math.TU-Berlin.DE (Gregor Schmid), +;; who wrote a different Tcl mode. +;; We also have support for menus in FSF. We do this by +;; loading the XEmacs menu emulation code. +;; + +(defun tcl-popup-menu (e) + (interactive "@e") + (and tcl-using-emacs-19 + (not tcl-using-xemacs-19) + (if tcl-using-emacs-19-23 + (require 'lmenu) + ;; CAVEATS: + ;; * lmenu.el provides 'menubar, which is bogus. + ;; * lmenu.el causes menubars to be turned on everywhere. + ;; Doubly bogus! + ;; Both of these problems are fixed in Emacs 19.23. People + ;; using an Emacs before that just suffer. + (require 'menubar "lmenu"))) ;; This is annoying + ;; IMHO popup-menu should be autoloaded in FSF Emacs. Oh well. + (popup-menu tcl-xemacs-menu)) + + + +;; +;; Quoting and unquoting functions. +;; + +;; This quoting is sufficient to protect eg a filename from any sort +;; of expansion or splitting. Tcl quoting sure sucks. +(defun tcl-quote (string) + "Quote STRING according to Tcl rules." + (mapconcat (function (lambda (char) + (if (memq char '(?[ ?] ?{ ?} ?\\ ?\" ?$ ? ?\;)) + (concat "\\" (char-to-string char)) + (char-to-string char)))) + string "")) + + + +;; +;; Bug reporting. +;; + +(and (fboundp 'eval-when-compile) + (eval-when-compile + (require 'reporter))) + +(defun tcl-submit-bug-report () + "Submit via mail a bug report on Tcl mode." + (interactive) + (require 'reporter) + (and + (y-or-n-p "Do you really want to submit a bug report on Tcl mode? ") + (reporter-submit-bug-report + tcl-maintainer + (concat "Tcl mode " tcl-version) + '(tcl-indent-level + tcl-continued-indent-level + tcl-auto-newline + tcl-tab-always-indent + tcl-use-hairy-comment-detector + tcl-electric-hash-style + tcl-help-directory-list + tcl-use-smart-word-finder + tcl-application + tcl-command-switches + tcl-prompt-regexp + inferior-tcl-source-command + tcl-using-emacs-19 + tcl-using-emacs-19-23 + tcl-using-xemacs-19 + tcl-proc-list + tcl-proc-regexp + tcl-typeword-list + tcl-keyword-list + tcl-font-lock-keywords + tcl-pps-has-arg-6)))) + + + +(provide 'tcl) + +;;; tcl.el ends here diff --git a/contrib/test-g++ b/contrib/test-g++ new file mode 100755 index 0000000..91f14c1 --- /dev/null +++ b/contrib/test-g++ @@ -0,0 +1,89 @@ +#!/bin/sh + +# Default DEVOSRCDIR +if [ "$DEVOSRCDIR" = "" ]; then + DEVOSRCDIR=$HOME/devo ; export DEVOSRCDIR +fi + +# Check DEVOSRCDIR +if [ ! -d "$DEVOSRCDIR" ]; then + echo "$0: no directory $DEVOSRCDIR" >&2 + exit 2 +fi + +# Default DEVOBINDIR +if [ "$DEVOBINDIR" = "" ]; then + CPU=`$DEVOSRCDIR/config.guess` + if [ $? != 0 ]; then + echo "$0: cannot run config.guess" >&2 + exit 2 + fi + DEVOBINDIR=$HOME/$CPU ; export DEVOBINDIR +fi + +# Check DEVOBINDIR +if [ ! -d "$DEVOBINDIR" ]; then + echo "$0: no directory $DEVOBINDIR" >&2 + exit 2 +fi + +# Default LOGDIR +if [ "$LOGDIR" = "" ]; then + LOGDIR=$HOME/logs ; export LOGDIR +fi + +# Check LOGDIR +if [ ! -d "$LOGDIR" ]; then + echo "$0: no directory $LOGDIR" >&2 + exit 2 +fi + +cd $LOGDIR || exit 2 + +sum=g++-`date '+%y%m%d'` + +$DEVOSRCDIR/dejagnu/contrib/test-tool g++ > $sum 2>&1 +status=$? + +if [ -d $DEVOBINDIR/libg++ ]; then + +cd $DEVOBINDIR/libg++ +make check >/tmp/clgpp$$ 2>&1 +if [ $? != 0 ]; then + cd $LOGDIR + echo "" >> $sum + echo "libg++ fails to make check:" >> $sum + tail -20 /tmp/clgpp$$ >> $sum + if [ $status = 0 ]; then + status=1 + fi +fi + +# libg++? +fi + +cd $DEVOBINDIR/libio +make check >/tmp/clgpp$$ 2>&1 +if [ $? != 0 ]; then + cd $LOGDIR + echo "" >> $sum + echo "libio fails to make check:" >> $sum + tail -20 /tmp/clgpp$$ >> $sum + if [ $status = 0 ]; then + status=1 + fi +fi + +cd $DEVOBINDIR/libstdc++ +make check >/tmp/clgpp$$ 2>&1 +if [ $? != 0 ]; then + cd $LOGDIR + echo "" >> $sum + echo "libstdc++ fails to make check:" >> $sum + tail -20 /tmp/clgpp$$ >> $sum + if [ $status = 0 ]; then + status=1 + fi +fi + +exit $status diff --git a/contrib/test-tool b/contrib/test-tool new file mode 100755 index 0000000..32ab887 --- /dev/null +++ b/contrib/test-tool @@ -0,0 +1,378 @@ +#!/bin/sh +# This script automatically test the given tool with the tool's test cases, +# reporting anything of interest. + +# exits with 1 if there is nothing of interest +# exits with 0 if there is something interesting +# exits with 2 if an error occurred + +# Syntax: test-tool [-expectedpass] [-keepoutput] [-noupdate] g++|gcc|gdb|... +# +# -expectedpass: Turn XFAIL into "pass", XPASS into "fail". +# The default is XFAIL->fail, XPASS->pass. +# -keepoutput: Save "make check" output in test-$tool.log. +# -noupdate: Don't update log files. + +# Limitations, don't run this multiple times in one day, unless the -noupdate +# flag is given. + +# Written by Mike Stump + +expectedpass=no +keepoutput=no +update=yes +tool="" + +# See if cp -p works. +pwd=`pwd` +cd /tmp +rm -f test-tool-$$-1 test-tool-$$-2 +touch test-tool-$$-1 +cp -p test-tool-$$-1 test-tool-$$-2 2>/dev/null +if [ $? = 0 -a -f test-tool-$$-2 ] ; then + CP="cp -p" +else + CP=cp +fi +rm -f test-tool-$$-1 test-tool-$$-2 +cd $pwd + +for arg in $* +do + case $arg in + -expectedpass) expectedpass=yes ;; + -keepoutput) keepoutput=yes ;; + -noupdate) update=no ;; + -*) + echo "Usage: [-expectedpass] [-keepoutput] [-noupdate] tool_name" >&2 + exit 2 + ;; + *) + if [ "$tool" != "" ]; then + echo "Usage: [-expectedpass] [-keepoutput] [-noupdate] tool_name" >&2 + exit 2 + fi + tool=$arg + ;; + esac +done + +# FIXME: It sure would be nice if `testdir' wasn't necessary. :-( + +case $tool in + g++) + devoname=gcc + checktarget=check-g++ + testdir=testsuite + ;; + gcc) + devoname=gcc + checktarget=check-gcc + testdir=testsuite + ;; + ld|gld) + devoname=ld + checktarget=check + testdir=. + ;; + binutils) + devoname=binutils + checktarget=check + testdir=. + ;; + *) + devoname=$tool + checktarget=check + testdir=testsuite + ;; +esac + +# Default DEVOSRCDIR +if [ "$DEVOSRCDIR" = "" ]; then + DEVOSRCDIR=$HOME/devo ; export DEVOSRCDIR +fi + +# Check DEVOSRCDIR +if [ ! -d "$DEVOSRCDIR" ]; then + echo "$0: no directory $DEVOSRCDIR" >&2 + exit 2 +fi + +# Default DEVOBINDIR +if [ "$DEVOBINDIR" = "" ]; then + CPU=`$DEVOSRCDIR/config.guess` + if [ $? != 0 ]; then + echo "$0: cannot run config.guess" >&2 + exit 2 + fi + DEVOBINDIR=$HOME/$CPU ; export DEVOBINDIR +fi + +# Check DEVOBINDIR +if [ ! -d "$DEVOBINDIR" ]; then + echo "$0: no directory $DEVOBINDIR" >&2 + exit 2 +fi + +# Specialize DEVOSRCDIR +if [ -d "$DEVOSRCDIR/$devoname" ]; then + DEVOSRCDIR=$DEVOSRCDIR/$devoname +else + echo "$0: Cannot find source directory." >&2 + exit 2 +fi + +# Default LOGDIR +if [ "$LOGDIR" = "" ]; then + LOGDIR=$HOME/logs ; export LOGDIR +fi + +# Check LOGDIR +if [ ! -d "$LOGDIR" ]; then + echo "$0: no directory $LOGDIR" >&2 + exit 2 +fi + +# Specialize DEVOBINDIR +if [ -d "$DEVOBINDIR/$devoname" ]; then + DEVOBINDIR=$DEVOBINDIR/$devoname +else + echo "$0: Cannot find binary directory." >&2 + exit 2 +fi + +# Binary directory +cd $DEVOBINDIR || exit 2 + +TMPDIR=${TMPDIR-/tmp} + +tmp=$TMPDIR/$tool-testing.$$a +tmp1=$TMPDIR/$tool-testing.$$b +tmp2=$TMPDIR/$tool-testing.$$c +now_s=$TMPDIR/$tool-testing.$$d +before_s=$TMPDIR/$tool-testing.$$e + +if [ "$keepoutput" = yes ]; then + rm -f test-$tool.log + make RUNTESTFLAGS="-v -v" $checktarget >test-$tool.log 2>&1 +else + make RUNTESTFLAGS="-v -v" $checktarget >/dev/null 2>&1 +fi + +# Check for DEJAGNU errors that prevented any output at all. +if [ ! -f $testdir/$tool.sum ]; then + echo "Tests didn't run, probably because of a framework error." + if [ "$keepoutput" = yes ]; then + echo + tail -20 test-$tool.log + else + echo "Unable to determine why. Rerun with -keepoutput." + fi + exit 2 +fi + +# Canonicalize XFAIL and XPASS so the rest of the script can ignore them. +if [ "$expectedpass" = yes ]; then + sed 's/^XFAIL/PASS(XFAIL)/; s/^XPASS/FAIL(XPASS)/' <$testdir/$tool.sum >$testdir/$tool.1.sum || exit 2 +else + sed 's/^XFAIL/FAIL(XFAIL)/; s/^XPASS/PASS(XPASS)/' <$testdir/$tool.sum >$testdir/$tool.1.sum || exit 2 +fi +mv $testdir/$tool.1.sum $testdir/$tool.sum + +patterns="$LOGDIR/$tool-??????.sum $LOGDIR/$tool-??????.sum.gz $LOGDIR/$tool-??????????.sum $LOGDIR/$tool-??????????.sum.gz" +before=`ls -1t $patterns 2>/dev/null | sed 1q` + +todayname=`date '+%y%m%d'` +if [ "$update" = no ]; then + now=$testdir/$tool.sum +else + mv -f $testdir/$tool.sum $LOGDIR/$tool-$todayname.sum || exit 2 + mv -f $testdir/$tool.log $LOGDIR/$tool-$todayname.log || exit 2 + + # Say where the logs are stored so they appear in email messages. + echo + echo "Log files: $LOGDIR/$tool-$todayname.*" + echo + + now="$LOGDIR/$tool-$todayname.sum"; +fi + +trap "rm -f $tmp $tmp1 $tmp2 $now_s $before_s" 0 1 2 3 5 9 13 15 + +case $before in + "") before="cat /dev/null" ;; + *.gz) before="gunzip -c $before" ;; + *) before="cat $before" ;; +esac + +# First, the test summary. +egrep '^# of |===.*Summary.*===' "$now" || echo "(No test summary?)" +echo + +# Pick out the PASS/FAIL/Ufoo messages. +# We grep for them again later but that's for robustness' sake. +grep '^[PFU][A-Z()]*:' "$now" | sort -t ':' +1 > "$now_s" +$before | grep '^[PFU][A-Z()]*:' | sort -t ':' +1 > "$before_s" + +grep '^FAIL:' "$now_s" | sed 's/^[^:]*:[ ]*//' >$tmp1 +grep '^PASS' "$before_s" | sed 's/^[^:]*:[ ]*//' | comm -12 $tmp1 - >$tmp2 + +grep -s . $tmp2 >/dev/null +if [ $? = 0 ]; then + echo "Tests that now unexpectedly fail, but worked before:" + echo + cat $tmp2 + showchangelog=1 + echo +fi + +grep '^FAIL:' "$now_s" | sed 's/^[^:]*:[ ]*//' >$tmp1 +grep '^[PFU][A-Z()]*:' "$before_s" | sed 's/^[^:]*:[ ]*//' | comm -23 $tmp1 - >$tmp2 + +grep -s . $tmp2 >/dev/null +if [ $? = 0 ]; then + echo "New tests that unexpectedly FAIL:" + echo + cat $tmp2 + echo +fi + +grep '^FAIL:' "$now_s" | sed 's/^[^:]*:[ ]*//' >$tmp1 +grep '^FAIL' "$before_s" | sed 's/^[^:]*:[ ]*//' | comm -12 $tmp1 - >$tmp2 + +grep -s . $tmp2 >/dev/null +if [ $? = 0 ]; then + echo "Tests that still don't work:" + echo + cat $tmp2 + echo +fi + +grep '^PASS' "$now_s" | sed 's/^[^:]*:[ ]*//' >$tmp1 +grep '^FAIL' "$before_s" | sed 's/^[^:]*:[ ]*//' | comm -12 $tmp1 - >$tmp2 + +grep -s . $tmp2 >/dev/null +if [ $? = 0 ]; then + echo "Tests that now work, but didn't before:" + echo + cat $tmp2 + echo +fi + +grep '^PASS' "$now_s" | sed 's/^[^:]*:[ ]*//' >$tmp1 +grep '^[PFU][A-Z()]*:' "$before_s" | sed 's/^[^:]*:[ ]*//' | comm -23 $tmp1 - >$tmp2 + +grep -s . $tmp2 >/dev/null +if [ $? = 0 ]; then + echo "New tests that PASS:" + echo + cat $tmp2 + echo +fi + +grep '^[PFU][A-Z()]*:' "$now_s" | sed 's/^[^:]*:[ ]*//' >$tmp1 +grep '^PASS' "$before_s" | sed 's/^[^:]*:[ ]*//' | comm -13 $tmp1 - >$tmp2 + +grep -s . $tmp2 >/dev/null +if [ $? = 0 ]; then + echo "Old tests that passed, that have disappeared: (Eeek!)" + echo + cat $tmp2 + echo +fi + +grep '^[PFU][A-Z()]*:' "$now_s" | sed 's/^[^:]*:[ ]*//' >$tmp1 +grep '^FAIL' "$before_s" | sed 's/^[^:]*:[ ]*//' | comm -13 $tmp1 - >$tmp2 + +grep -s . $tmp2 >/dev/null +if [ $? = 0 ]; then + echo "Old tests that failed, that have disappeared: (Eeek!)" + echo + cat $tmp2 + echo +fi + +egrep '^(ERROR|WARNING):' "$now" >$tmp1 + +if grep -s . $tmp1 > /dev/null; then + echo "Errors and warnings:" + echo + cat $tmp1 + echo +fi + +if [ "$tool" = g++ ]; then + if [ -f $DEVOBINDIR/libio/run-make-check ]; then + cd $DEVOBINDIR/libio + make check >$TMPDIR/clgpp$$ 2>&1 + if [ $? != 0 ]; then + echo + echo "libio fails to make check:" + tail -20 $TMPDIR/clgpp$$ + fi + fi + if [ -f $DEVOBINDIR/libstdc++/run-make-check ]; then + cd $DEVOBINDIR/libstdc++ + make check >$TMPDIR/clgpp$$ 2>&1 + if [ $? != 0 ]; then + echo + echo "libstdc++ fails to make check:" + tail -20 $TMPDIR/clgpp$$ + fi + fi + if [ -f $DEVOBINDIR/libg++/run-make-check ]; then + cd $DEVOBINDIR/libg++ + make check >$TMPDIR/clgpp$$ 2>&1 + if [ $? != 0 ]; then + echo + echo "libg++ fails to make check:" + tail -20 $TMPDIR/clgpp$$ + fi + fi + rm -f $TMPDIR/clgpp$$ + cd $DEVOBINDIR +fi + +if [ "$devoname" != "" ]; then + if [ "$showchangelog" = 1 ]; then + echo "Here is what's new in the ChangeLog:" + echo + diff -c $LOGDIR/$devoname.ChangeLog $DEVOSRCDIR/ChangeLog + echo + if [ "$tool" = g++ ]; then + echo + echo "Here is what's new in the ChangeLog.egcs:" + echo + diff -c $LOGDIR/gcc.ChangeLog.egcs $DEVOSRCDIR/ChangeLog.egcs + + echo + echo "Here is what's new in the cp/ChangeLog:" + echo + diff -c $LOGDIR/g++.ChangeLog $DEVOSRCDIR/cp/ChangeLog + fi + echo + fi + if [ "$update" != no ]; then + # save the old ChangeLog as a reference for next time + rm -f $LOGDIR/$devoname.ChangeLog.BAK + mv $LOGDIR/$devoname.ChangeLog $LOGDIR/$devoname.ChangeLog.BAK 2>/dev/null + $CP $DEVOSRCDIR/ChangeLog $LOGDIR/$devoname.ChangeLog + if [ "$tool" = g++ ]; then + rm -f $LOGDIR/gcc.ChangeLog.egcs.BAK + mv $LOGDIR/gcc.ChangeLog.egcs $LOGDIR/gcc.ChangeLog.egcs.BAK 2>/dev/null + $CP $DEVOSRCDIR/ChangeLog.egcs $LOGDIR/gcc.ChangeLog.egcs + + rm -f $LOGDIR/g++.ChangeLog.BAK + mv $LOGDIR/g++.ChangeLog $LOGDIR/g++.ChangeLog.BAK 2>/dev/null + $CP $DEVOSRCDIR/cp/ChangeLog $LOGDIR/g++.ChangeLog + fi + fi +fi + +$before | diff - $now | grep -s . >/dev/null +if [ $? = 0 ]; then + echo "Details:" + echo + $before | diff - $now + echo +fi diff --git a/contrib/testit b/contrib/testit new file mode 100755 index 0000000..e866aa6 --- /dev/null +++ b/contrib/testit @@ -0,0 +1,1149 @@ +#!/usr/latest/bin/wish -f +# Program: testit +# Tcl version: 7.2 (Tcl/Tk/XF) +# Tk version: 3.5 +# XF version: 2.2 +# + + +# procedure to show window . +proc ShowWindow. {args} {# xf ignore me 7 + + # Window manager configurations + global tkVersion + wm positionfrom . user + wm sizefrom . "" + wm maxsize . 1152 900 + wm title . {xf} + + # bindings + bind . {MenuPopupPost .frame0.menubutton3.m.menu4 %X %Y} + bind . {MenuPopupRelease .frame0.menubutton3.m.menu4 %W} + + # build widget .frame0 + frame .frame0 \ + -background {white} \ + -borderwidth {2} \ + -relief {raised} + + # build widget .frame0.menubutton0 + menubutton .frame0.menubutton0 \ + -background {white} \ + -foreground {black} \ + -menu {.frame0.menubutton0.m} \ + -text {Summaries} + + # build widget .frame0.menubutton0.m + menu .frame0.menubutton0.m \ + -background {white} \ + -foreground {black} + .frame0.menubutton0.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/gcc.sum + +} \ + -label {Gcc} + .frame0.menubutton0.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/g++.sum + +} \ + -label {G++} + .frame0.menubutton0.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/gdb.sum + +} \ + -label {Gdb} + .frame0.menubutton0.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/gas.sum + +} \ + -label {Gas} + .frame0.menubutton0.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/binutils.sum + +} \ + -label {Binutils} + .frame0.menubutton0.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/runtest.sum + +} \ + -label {Runtest} + .frame0.menubutton0.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/tcl.sum + +} \ + -label {Tcl} + .frame0.menubutton0.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/expect.sum + +} \ + -label {Expect} + .frame0.menubutton0.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/libg++.sum + +} \ + -label {Libg++} + .frame0.menubutton0.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/libio.sum + +} \ + -label {Libio} + .frame0.menubutton0.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/libm.sum + +} \ + -label {Libm} + + # build widget .frame0.menubutton1 + menubutton .frame0.menubutton1 \ + -background {white} \ + -foreground {black} \ + -menu {.frame0.menubutton1.m} \ + -text {Misc} + + # build widget .frame0.menubutton1.m + menu .frame0.menubutton1.m \ + -background {white} \ + -foreground {black} + .frame0.menubutton1.m add command \ + -command {EndSrc +destroy .} \ + -label {Exit} + .frame0.menubutton1.m add command \ + -command {.frame6.frame.text2 delete 0.0 end} \ + -label {Clear window} + .frame0.menubutton1.m add command \ + -command {dialogbox} \ + -label {Editor} + .frame0.menubutton1.m add command \ + -command {.frame6.frame.text2 insert 0.0 "Top of tree is $testbase\n"} \ + -label {Show filename} + + # build widget .frame0.menubutton3 + menubutton .frame0.menubutton3 \ + -background {white} \ + -foreground {black} \ + -menu {.frame0.menubutton3.m} \ + -text {Host} + + # build widget .frame0.menubutton3.m + menu .frame0.menubutton3.m \ + -background {white} \ + -foreground {black} + .frame0.menubutton3.m add command \ + -command {set host "alpha-dec-osf1.3"} \ + -label {alpha-dec-osf1.3} + .frame0.menubutton3.m add command \ + -command {set host "hppa1.1-hp-hpux"} \ + -label {hppa1.1-hp-hpux} + .frame0.menubutton3.m add command \ + -command {set host "i386-unknown-sysv4.2"} \ + -label {i386-unknown-sysv4.2} + .frame0.menubutton3.m add command \ + -command {set host "m68k-hp-hpux"} \ + -label {m68k-hp-hpux} + .frame0.menubutton3.m add command \ + -command {set host "m68k-sun-sunos4.1.1"} \ + -label {m68k-sun-sunos4.1.1} + .frame0.menubutton3.m add command \ + -command {set host "mips-dec-ultrix4.2"} \ + -label {mips-dec-ultrix4.2} + .frame0.menubutton3.m add command \ + -command {set host "mips-sgi-irix4.0.5H"} \ + -label {mips-sgi-irix4.0.5H} + .frame0.menubutton3.m add command \ + -command {set host "rs6000-ibm-aix3.2"} \ + -label {rs6000-ibm-aix3.2} + .frame0.menubutton3.m add command \ + -command {set host "sparc-sun-solaris2.3"} \ + -label {sparc-sun-solaris2.3} + .frame0.menubutton3.m add command \ + -command {set host "sparc-sun-sunos4.1.3"} \ + -label {sparc-sun-sunos4.1.3} + + # build widget .frame0.menubutton2 + menubutton .frame0.menubutton2 \ + -background {white} \ + -foreground {black} \ + -menu {.frame0.menubutton2.m} \ + -text {Target} + + # build widget .frame0.menubutton2.m + menu .frame0.menubutton2.m \ + -background {white} \ + -foreground {black} + .frame0.menubutton2.m add command \ + -command {set target "a29k-amd-udi"} \ + -label {a29k-amd-udi} + .frame0.menubutton2.m add command \ + -command {set target "h8300-hms"} \ + -label {h8300-hms} + .frame0.menubutton2.m add command \ + -command {set target "i386-aout"} \ + -label {i386-aout} + .frame0.menubutton2.m add command \ + -command {set target "i386-lynx"} \ + -label {i386-lynx} + .frame0.menubutton2.m add command \ + -command {set target "i960-intel-nindy"} \ + -label {i960-intel-nindy} + .frame0.menubutton2.m add command \ + -command {set target "i960-vxwork"} \ + -label {i960-vxworks} + .frame0.menubutton2.m add command \ + -command {set target "m68k-aout"} \ + -label {m68k-aout} + .frame0.menubutton2.m add command \ + -command {set target "m68k-coff"} \ + -label {m68k-coff} + .frame0.menubutton2.m add command \ + -command {set target "m68k-lynx"} \ + -label {m68k-lynx} + .frame0.menubutton2.m add command \ + -command {set target "m68k-vxworks"} \ + -label {m68k-vxworks} + .frame0.menubutton2.m add command \ + -command {set target "mips-idt-ecoff"} \ + -label {mips-idt-ecoff} + .frame0.menubutton2.m add command \ + -command {set target "sh-hms"} \ + -label {sh-hms} + .frame0.menubutton2.m add command \ + -command {set target "sparc-aout"} \ + -label {sparc-aout} + .frame0.menubutton2.m add command \ + -command {set target "sparc-sun-sunos4.1.3"} \ + -label {sparc-sun-sunos4.1.3} + .frame0.menubutton2.m add command \ + -command {set target "sparc-vxworks"} \ + -label {sparc-vxworks} + .frame0.menubutton2.m add command \ + -command {set target "sparclite-aout"} \ + -label {sparclite-aout} + .frame0.menubutton2.m add command \ + -command {set target "sparclite-coff"} \ + -label {sparclite-coff} + .frame0.menubutton2.m add command \ + -command {set target "hppa1.1-hp-hpux"} \ + -label {hppa1.1-hp-hpux} + .frame0.menubutton2.m add command \ + -command {set target "i386-unknown-sysv4.2"} \ + -label {i386-unknown-sysv4.2} + .frame0.menubutton2.m add command \ + -command {set target "m68k-hp-hpux"} \ + -label {m68k-hp-hpux} + .frame0.menubutton2.m add command \ + -command {set target "m68k-sun-sunos4.1.1"} \ + -label {m68k-sun-sunos4.1.1} + .frame0.menubutton2.m add command \ + -command {set target "mips-dec-ultrix4.2"} \ + -label {mips-dec-ultrix4.2} + .frame0.menubutton2.m add command \ + -command {set target "mips-sgi-irix4.0.5H"} \ + -label {mips-sgi-irix4.0.5H} + .frame0.menubutton2.m add command \ + -command {set target "rs6000-ibm-aix3.2"} \ + -label {rs6000-ibm-aix3.2} + .frame0.menubutton2.m add command \ + -command {set target "sparc-sun-solaris2.3"} \ + -label {sparc-sun-solaris2.3} + + # build widget .frame0.menubutton9 + menubutton .frame0.menubutton9 \ + -background {white} \ + -foreground {black} \ + -menu {.frame0.menubutton9.m} \ + -text {Results} + + # build widget .frame0.menubutton9.m + menu .frame0.menubutton9.m \ + -background {white} \ + -foreground {black} + .frame0.menubutton9.m add command \ + -command {getresult $testbase/objdir/$host/$target/logs/gcc + +} \ + -label {Gcc} + .frame0.menubutton9.m add command \ + -command {getresult $testbase/objdir/$host/$target/logs/g++ + +} \ + -label {G++} + .frame0.menubutton9.m add command \ + -command {getresult $testbase/objdir/$host/$target/logs/gdb + +} \ + -label {Gdb} + .frame0.menubutton9.m add command \ + -command {getresult $testbase/objdir/$host/$target/logs/gas + +} \ + -label {Gas} + .frame0.menubutton9.m add command \ + -command {getresult $testbase/objdir/$host/$target/logs/binutils + +} \ + -label {Binutils} + .frame0.menubutton9.m add command \ + -command {getresult $testbase/objdir/$host/$target/logs/runtest +} \ + -label {Runtest} + .frame0.menubutton9.m add command \ + -command {getresult $testbase/objdir/$host/$target/logs/tcl + +} \ + -label {Tcl} + .frame0.menubutton9.m add command \ + -command {getresult $testbase/objdir/$host/$target/logs/expect + +} \ + -label {Expect} + .frame0.menubutton9.m add command \ + -command {getresult $testbase/objdir/$host/$target/logs/libg++ + +} \ + -label {Libg++} + .frame0.menubutton9.m add command \ + -command {getresult $testbase/objdir/$host/$target/logs/libio +} \ + -label {Libio} + .frame0.menubutton9.m add command \ + -command {getresult $testbase/objdir/$host/$target/logs/libm + +} \ + -label {Libm} + + # build widget .frame0.menubutton10 + menubutton .frame0.menubutton10 \ + -background {white} \ + -foreground {black} \ + -menu {.frame0.menubutton10.m} \ + -text {Logs} + + # build widget .frame0.menubutton10.m + menu .frame0.menubutton10.m \ + -background {white} \ + -foreground {black} + .frame0.menubutton10.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/gcc.log + +} \ + -label {Gcc} + .frame0.menubutton10.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/g++.log + +} \ + -label {G++} + .frame0.menubutton10.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/gdb.log + +} \ + -label {Gdb} + .frame0.menubutton10.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/gas.log + +} \ + -label {Gas} + .frame0.menubutton10.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/binutils.log + +} \ + -label {Binutils} + .frame0.menubutton10.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/runtest.log + +} \ + -label {Runtest} + .frame0.menubutton10.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/tcl.log + +} \ + -label {Tcl} + .frame0.menubutton10.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/expect.log + +} \ + -label {Expect} + .frame0.menubutton10.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/libg++.log + +} \ + -label {Libg++} + .frame0.menubutton10.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/libio.log + +} \ + -label {Libio} + .frame0.menubutton10.m add command \ + -command {loadfile $testbase/objdir/$host/$target/logs/libm.log + +} \ + -label {Libm} + + # pack widget .frame0 + pack append .frame0 \ + .frame0.menubutton0 {left frame center} \ + .frame0.menubutton1 {right frame center} \ + .frame0.menubutton3 {left frame center} \ + .frame0.menubutton2 {left frame center} \ + .frame0.menubutton9 {left frame center} \ + .frame0.menubutton10 {left frame center} + + # build widget .frame1 + frame .frame1 \ + -background {white} \ + -borderwidth {2} \ + -relief {raised} + + # build widget .frame1.message3 + message .frame1.message3 \ + -aspect {1500} \ + -background {white} \ + -borderwidth {0} \ + -foreground {black} \ + -padx {5} \ + -pady {2} \ + -relief {raised} \ + -text {sparc-sun-sunos4.1.3} \ + -textvariable {host} + + # build widget .frame1.message4 + message .frame1.message4 \ + -aspect {1500} \ + -background {white} \ + -borderwidth {0} \ + -foreground {black} \ + -padx {5} \ + -pady {2} \ + -relief {raised} \ + -text {sparc-sun-sunos4.1.3} \ + -textvariable {target} + + # pack widget .frame1 + pack append .frame1 \ + .frame1.message3 {left frame center} \ + .frame1.message4 {right frame center} + + # build widget .frame6 + frame .frame6 \ + -background {white} \ + -borderwidth {2} \ + -relief {raised} + + # build widget .frame6.frame + frame .frame6.frame \ + -background {white} \ + -relief {raised} + + # build widget .frame6.frame.scrollbar1 + scrollbar .frame6.frame.scrollbar1 \ + -background {white} \ + -command {.frame6.frame.text2 yview} \ + -foreground {black} \ + -relief {raised} + + # build widget .frame6.frame.text2 + text .frame6.frame.text2 \ + -background {white} \ + -borderwidth {2} \ + -foreground {black} \ + -relief {raised} \ + -wrap {word} \ + -yscrollcommand {.frame6.frame.scrollbar1 set} + + # pack widget .frame6.frame + pack append .frame6.frame \ + .frame6.frame.scrollbar1 {left frame center filly} \ + .frame6.frame.text2 {top frame center expand fill} + + # pack widget .frame6 + pack append .frame6 \ + .frame6.frame {top frame center fill} + + # pack widget . + pack append . \ + .frame0 {top frame center fillx} \ + .frame1 {bottom frame center fillx} \ + .frame6 {top frame center expand fill} + + .frame6.frame.text2 insert end {} + + + + if {"[info procs XFEdit]" != ""} { + catch "XFMiscBindWidgetTree ." + after 2 "catch {XFEditSetShowWindows}" + } +} + + +# Procedure: Alias +if {"[info procs Alias]" == ""} { +proc Alias { args} { +# xf ignore me 7 +########## +# Procedure: Alias +# Description: establish an alias for a procedure +# Arguments: args - no argument means that a list of all aliases +# is returned. Otherwise the first parameter is +# the alias name, and the second parameter is +# the procedure that is aliased. +# Returns: nothing, the command that is bound to the alias or a +# list of all aliases - command pairs. +# Sideeffects: internalAliasList is updated, and the alias +# proc is inserted +########## + global internalAliasList + + if {[llength $args] == 0} { + return $internalAliasList + } { + if {[llength $args] == 1} { + set xfTmpIndex [lsearch $internalAliasList "[lindex $args 0] *"] + if {$xfTmpIndex != -1} { + return [lindex [lindex $internalAliasList $xfTmpIndex] 1] + } + } { + if {[llength $args] == 2} { + eval "proc [lindex $args 0] {args} {#xf ignore me 4 +return \[eval \"[lindex $args 1] \$args\"\]}" + set xfTmpIndex [lsearch $internalAliasList "[lindex $args 0] *"] + if {$xfTmpIndex != -1} { + set internalAliasList [lreplace $internalAliasList $xfTmpIndex $xfTmpIndex "[lindex $args 0] [lindex $args 1]"] + } { + lappend internalAliasList "[lindex $args 0] [lindex $args 1]" + } + } { + error "Alias: wrong number or args: $args" + } + } + } +} +} + + +# Procedure: GetSelection +if {"[info procs GetSelection]" == ""} { +proc GetSelection {} { +# xf ignore me 7 +########## +# Procedure: GetSelection +# Description: get current selection +# Arguments: none +# Returns: none +# Sideeffects: none +########## + + # the save way + set xfSelection "" + catch "selection get" xfSelection + if {"$xfSelection" == "selection doesn't exist or form \"STRING\" not defined"} { + return "" + } { + return $xfSelection + } +} +} + + +# Procedure: MenuPopupAdd +if {"[info procs MenuPopupAdd]" == ""} { +proc MenuPopupAdd { xfW xfButton xfMenu {xfModifier ""} {xfCanvasTag ""}} { +# xf ignore me 7 +# the popup menu handling is from (I already gave up with popup handling :-): +# +# Copyright 1991,1992 by James Noble. +# Everyone is granted permission to copy, modify and redistribute. +# This notice must be preserved on all copies or derivates. +# +########## +# Procedure: MenuPopupAdd +# Description: attach a popup menu to widget +# Arguments: xfW - the widget +# xfButton - the button we use +# xfMenu - the menu to attach +# {xfModifier} - a optional modifier +# {xfCanvasTag} - a canvas tagOrId +# Returns: none +# Sideeffects: none +########## + global tk_popupPriv + + set tk_popupPriv($xfMenu,focus) "" + set tk_popupPriv($xfMenu,grab) "" + if {"$xfModifier" != ""} { + set press "$xfModifier-" + set motion "$xfModifier-" + set release "Any-" + } { + set press "" + set motion "" + set release "" + } + + bind $xfMenu "<${motion}B${xfButton}-Motion>" "MenuPopupMotion $xfMenu %W %X %Y" + bind $xfMenu "<${release}ButtonRelease-${xfButton}>" "MenuPopupRelease $xfMenu %W" + if {"$xfCanvasTag" == ""} { + bind $xfW "<${press}ButtonPress-${xfButton}>" "MenuPopupPost $xfMenu %X %Y" + bind $xfW "<${release}ButtonRelease-${xfButton}>" "MenuPopupRelease $xfMenu %W" + } { + $xfW bind $xfCanvasTag "<${press}ButtonPress-${xfButton}>" "MenuPopupPost $xfMenu %X %Y" + $xfW bind $xfCanvasTag "<${release}ButtonRelease-${xfButton}>" "MenuPopupRelease $xfMenu %W" + } +} +} + + +# Procedure: MenuPopupMotion +if {"[info procs MenuPopupMotion]" == ""} { +proc MenuPopupMotion { xfMenu xfW xfX xfY} { +# xf ignore me 7 +########## +# Procedure: MenuPopupMotion +# Description: handle the popup menu motion +# Arguments: xfMenu - the topmost menu +# xfW - the menu +# xfX - the root x coordinate +# xfY - the root x coordinate +# Returns: none +# Sideeffects: none +########## + global tk_popupPriv + + if {"[info commands $xfW]" != "" && [winfo ismapped $xfW] && + "[winfo class $xfW]" == "Menu" && + [info exists tk_popupPriv($xfMenu,focus)] && + "$tk_popupPriv($xfMenu,focus)" != "" && + [info exists tk_popupPriv($xfMenu,grab)] && + "$tk_popupPriv($xfMenu,grab)" != ""} { + set xfPopMinX [winfo rootx $xfW] + set xfPopMaxX [expr $xfPopMinX+[winfo width $xfW]] + if {$xfX >= $xfPopMinX && $xfX <= $xfPopMaxX} { + $xfW activate @[expr $xfY-[winfo rooty $xfW]] + if {![catch "$xfW entryconfig @[expr $xfY-[winfo rooty $xfW]] -menu" result]} { + if {"[lindex $result 4]" != ""} { + foreach binding [bind $xfMenu] { + bind [lindex $result 4] $binding [bind $xfMenu $binding] + } + } + } + } { + $xfW activate none + } + } +} +} + + +# Procedure: MenuPopupPost +if {"[info procs MenuPopupPost]" == ""} { +proc MenuPopupPost { xfMenu xfX xfY} { +# xf ignore me 7 +########## +# Procedure: MenuPopupPost +# Description: post the popup menu +# Arguments: xfMenu - the menu +# xfX - the root x coordinate +# xfY - the root x coordinate +# Returns: none +# Sideeffects: none +########## + global tk_popupPriv + + if {"[info commands $xfMenu]" != ""} { + if {![info exists tk_popupPriv($xfMenu,focus)]} { + set tk_popupPriv($xfMenu,focus) [focus] + } { + if {"$tk_popupPriv($xfMenu,focus)" == ""} { + set tk_popupPriv($xfMenu,focus) [focus] + } + } + set tk_popupPriv($xfMenu,grab) $xfMenu + + catch "$xfMenu activate none" + catch "$xfMenu post $xfX $xfY" + catch "focus $xfMenu" + catch "grab -global $xfMenu" + } +} +} + + +# Procedure: MenuPopupRelease +if {"[info procs MenuPopupRelease]" == ""} { +proc MenuPopupRelease { xfMenu xfW} { +# xf ignore me 7 +########## +# Procedure: MenuPopupRelease +# Description: remove the popup menu +# Arguments: xfMenu - the topmost menu widget +# xfW - the menu widget +# Returns: none +# Sideeffects: none +########## + global tk_popupPriv + global tkVersion + + if {"[info commands $xfW]" != "" && [winfo ismapped $xfW] && + "[winfo class $xfW]" == "Menu" && + [info exists tk_popupPriv($xfMenu,focus)] && + "$tk_popupPriv($xfMenu,focus)" != "" && + [info exists tk_popupPriv($xfMenu,grab)] && + "$tk_popupPriv($xfMenu,grab)" != ""} { + if {$tkVersion >= 3.0} { + catch "grab release $tk_popupPriv($xfMenu,grab)" + } { + catch "grab none" + } + catch "focus $tk_popupPriv($xfMenu,focus)" + set tk_popupPriv($xfMenu,focus) "" + set tk_popupPriv($xfMenu,grab) "" + if {"[$xfW index active]" != "none"} { + $xfW invoke active; catch "$xfMenu unpost" + } + } + catch "$xfMenu unpost" +} +} + + +# Procedure: NoFunction +if {"[info procs NoFunction]" == ""} { +proc NoFunction { args} { +# xf ignore me 7 +########## +# Procedure: NoFunction +# Description: do nothing (especially with scales and scrollbars) +# Arguments: args - a number of ignored parameters +# Returns: none +# Sideeffects: none +########## +} +} + + +# Procedure: SN +if {"[info procs SN]" == ""} { +proc SN { {xfName ""}} { +# xf ignore me 7 +########## +# Procedure: SN +# Description: map a symbolic name to the widget path +# Arguments: xfName +# Returns: the symbolic name +# Sideeffects: none +########## + + SymbolicName $xfName +} +} + + +# Procedure: SymbolicName +if {"[info procs SymbolicName]" == ""} { +proc SymbolicName { {xfName ""}} { +# xf ignore me 7 +########## +# Procedure: SymbolicName +# Description: map a symbolic name to the widget path +# Arguments: xfName +# Returns: the symbolic name +# Sideeffects: none +########## + + global symbolicName + + if {"$xfName" != ""} { + set xfArrayName "" + append xfArrayName symbolicName ( $xfName ) + if {![catch "set \"$xfArrayName\"" xfValue]} { + return $xfValue + } { + if {"[info commands XFProcError]" != ""} { + XFProcError "Unknown symbolic name:\n$xfName" + } { + puts stderr "XF error: unknown symbolic name:\n$xfName" + } + } + } + return "" +} +} + + +# Procedure: Unalias +if {"[info procs Unalias]" == ""} { +proc Unalias { aliasName} { +# xf ignore me 7 +########## +# Procedure: Unalias +# Description: remove an alias for a procedure +# Arguments: aliasName - the alias name to remove +# Returns: none +# Sideeffects: internalAliasList is updated, and the alias +# proc is removed +########## + global internalAliasList + + set xfIndex [lsearch $internalAliasList "$aliasName *"] + if {$xfIndex != -1} { + rename $aliasName "" + set internalAliasList [lreplace $internalAliasList $xfIndex $xfIndex] + } +} +} + + +# Procedure: getbase +proc getbase {} { + global env + global testbase + if [info exists env(TESTBASE)] then { + set testbase $env(TESTBASE) + } else { + set testbase /lisa/test/rob + } + return $testbase +} + + +# Procedure: getresult +proc getresult { name} { +set tmp "[lsort [glob -nocomplain $name-results-??????-????]]" +set tmp [lindex $tmp [expr [llength $tmp] - 1]] +if [string match "" $tmp] then { + .frame6.frame.text2 delete 0.0 end + .frame6.frame.text2 insert 0.0 "Couldn't find results for: $name\n" + return +} else { + return [loadfile $tmp] +} +} + +# Procedure: dialogbox +proc dialogbox {} { + set w .frame6.top2 + catch {destroy $w} + catch {destroy $w.e1} + toplevel $w +# dpos $w + wm title $w "Change Editor" + wm iconname $w "Entries" + message $w.msg -font -Adobe-times-medium-r-normal--*-180* -aspect 200 \ + -text "Hey Now. Click the \"OK\" button when you've seen enough." + frame $w.frame -borderwidth 10 + button $w.ok -text OK -command "destroy $w" + pack $w.msg $w.frame $w.ok -side top -fill both + + entry $w.frame.e1 -relief sunken -textvariable editor + pack $w.frame.e1 -side top -pady 5 -fill x + bind $w.frame.e1 "destroy $w" +} + +# Procedure: loadfile +proc loadfile { name} { +if ![file exists $name] then { + .frame6.frame.text2 delete 0.0 end + .frame6.frame.text2 insert 0.0 "Couldn't find:\t$name\n" + return +} + +global editor +if [info exists editor] then { + if ![string match "" $editor] then { + catch "exec $editor $name&" tmp + if [info exists tmp] then { + .frame6.frame.text2 delete 0.0 end + .frame6.frame.text2 insert 0.0 "Editor returned $tmp\n" + } + } +} +.frame6.frame.text2 delete 0.0 end +set fd [open $name r] +while { [gets $fd line]>=0 } { +.frame6.frame.text2 insert end "$line\n" +.frame6.frame.text2 mark set insert 0.0 +} +close $fd +unset fd +} + + + +# application parsing procedure +proc XFLocalParseAppDefs {xfAppDefFile} { + global xfAppDefaults + + # basically from: Michael Moore + if {[file exists $xfAppDefFile] && + [file readable $xfAppDefFile] && + "[file type $xfAppDefFile]" == "link"} { + catch "file type $xfAppDefFile" xfType + while {"$xfType" == "link"} { + if {[catch "file readlink $xfAppDefFile" xfAppDefFile]} { + return + } + catch "file type $xfAppDefFile" xfType + } + } + if {!("$xfAppDefFile" != "" && + [file exists $xfAppDefFile] && + [file readable $xfAppDefFile] && + "[file type $xfAppDefFile]" == "file")} { + return + } + if {![catch "open $xfAppDefFile r" xfResult]} { + set xfAppFileContents [read $xfResult] + close $xfResult + foreach line [split $xfAppFileContents "\n"] { + # backup indicates how far to backup. It applies to the + # situation where a resource name ends in . and when it + # ends in *. In the second case you want to keep the * + # in the widget name for pattern matching, but you want + # to get rid of the . if it is the end of the name. + set backup -2 + set line [string trim $line] + if {[string index $line 0] == "#" || "$line" == ""} { + # skip comments and empty lines + continue + } + set list [split $line ":"] + set resource [string trim [lindex $list 0]] + set i [string last "." $resource] + set j [string last "*" $resource] + if {$j > $i} { + set i $j + set backup -1 + } + incr i + set name [string range $resource $i end] + incr i $backup + set widname [string range $resource 0 $i] + set value [string trim [lindex $list 1]] + if {"$widname" != "" && "$widname" != "*"} { + # insert the widget and resourcename to the application + # defaults list. + if {![info exists xfAppDefaults]} { + set xfAppDefaults "" + } + lappend xfAppDefaults [list $widname [string tolower $name] $value] + } + } + } +} + +# application loading procedure +proc XFLocalLoadAppDefs {{xfClasses ""} {xfPriority "startupFile"} {xfAppDefFile ""}} { + global env + + if {"$xfAppDefFile" == ""} { + set xfFileList "" + if {[info exists env(XUSERFILESEARCHPATH)]} { + append xfFileList [split $env(XUSERFILESEARCHPATH) :] + } + if {[info exists env(XAPPLRESDIR)]} { + append xfFileList [split $env(XAPPLRESDIR) :] + } + if {[info exists env(XFILESEARCHPATH)]} { + append xfFileList [split $env(XFILESEARCHPATH) :] + } + append xfFileList " /usr/lib/X11/app-defaults" + append xfFileList " /usr/X11/lib/X11/app-defaults" + + foreach xfCounter1 $xfClasses { + foreach xfCounter2 $xfFileList { + set xfPathName $xfCounter2 + if {[regsub -all "%N" "$xfPathName" "$xfCounter1" xfResult]} { + set xfPathName $xfResult + } + if {[regsub -all "%T" "$xfPathName" "app-defaults" xfResult]} { + set xfPathName $xfResult + } + if {[regsub -all "%S" "$xfPathName" "" xfResult]} { + set xfPathName $xfResult + } + if {[regsub -all "%C" "$xfPathName" "" xfResult]} { + set xfPathName $xfResult + } + if {[file exists $xfPathName] && + [file readable $xfPathName] && + ("[file type $xfPathName]" == "file" || + "[file type $xfPathName]" == "link")} { + catch "option readfile $xfPathName $xfPriority" + if {"[info commands XFParseAppDefs]" != ""} { + XFParseAppDefs $xfPathName + } { + if {"[info commands XFLocalParseAppDefs]" != ""} { + XFLocalParseAppDefs $xfPathName + } + } + } { + if {[file exists $xfCounter2/$xfCounter1] && + [file readable $xfCounter2/$xfCounter1] && + ("[file type $xfCounter2/$xfCounter1]" == "file" || + "[file type $xfCounter2/$xfCounter1]" == "link")} { + catch "option readfile $xfCounter2/$xfCounter1 $xfPriority" + if {"[info commands XFParseAppDefs]" != ""} { + XFParseAppDefs $xfCounter2/$xfCounter1 + } { + if {"[info commands XFLocalParseAppDefs]" != ""} { + XFLocalParseAppDefs $xfCounter2/$xfCounter1 + } + } + } + } + } + } + } { + # load a specific application defaults file + if {[file exists $xfAppDefFile] && + [file readable $xfAppDefFile] && + ("[file type $xfAppDefFile]" == "file" || + "[file type $xfAppDefFile]" == "link")} { + catch "option readfile $xfAppDefFile $xfPriority" + if {"[info commands XFParseAppDefs]" != ""} { + XFParseAppDefs $xfAppDefFile + } { + if {"[info commands XFLocalParseAppDefs]" != ""} { + XFLocalParseAppDefs $xfAppDefFile + } + } + } + } +} + +# application setting procedure +proc XFLocalSetAppDefs {{xfWidgetPath "."}} { + global xfAppDefaults + + if {![info exists xfAppDefaults]} { + return + } + foreach xfCounter $xfAppDefaults { + if {"$xfCounter" == ""} { + break + } + set widname [lindex $xfCounter 0] + if {[string match $widname ${xfWidgetPath}] || + [string match "${xfWidgetPath}*" $widname]} { + set name [string tolower [lindex $xfCounter 1]] + set value [lindex $xfCounter 2] + # Now lets see how many tcl commands match the name + # pattern specified. + set widlist [info command $widname] + if {"$widlist" != ""} { + foreach widget $widlist { + # make sure this command is a widget. + if {![catch "winfo id $widget"] && + [string match "${xfWidgetPath}*" $widget]} { + catch "$widget configure -$name $value" + } + } + } + } + } +} + + + +# startup source +proc StartupSrc {args} { +global testbase +global hostlist +global targlist +global host + +set host [exec config.guess] +set target $host +} + + +# end source +proc EndSrc {} { +.frame6.frame.text2 delete 0.0 end +} + +# startup source +StartupSrc + +# initialize global variables +global {editor} +set {editor} {} +global {fsBox} +set {fsBox(activeBackground)} {} +set {fsBox(activeForeground)} {} +set {fsBox(all)} {0} +set {fsBox(background)} {} +set {fsBox(button)} {0} +set {fsBox(extensions)} {0} +set {fsBox(font)} {} +set {fsBox(foreground)} {} +set {fsBox(internalPath)} {/offsite/rob/DejaGnu/devo/dejagnu} +set {fsBox(name)} {} +set {fsBox(path)} {/offsite/rob/DejaGnu/devo/dejagnu} +set {fsBox(pattern)} {*} +set {fsBox(scrollActiveForeground)} {} +set {fsBox(scrollBackground)} {} +set {fsBox(scrollForeground)} {} +set {fsBox(scrollSide)} {left} +set {fsBox(showPixmap)} {0} +global {host} +set {host} {sparc-sun-sunos4.1.3} +global {result} +set {result} {can't read "editor": no such variable} +global {target} +set {target} {sparc-sun-sunos4.1.3} +global {testbase} +set {testbase} {/lisa/test/rob} + +# please don't modify the following +# variables. They are needed by xf. +global {autoLoadList} +set {autoLoadList(testit)} {0} +global {internalAliasList} +set {internalAliasList} {} +global {moduleList} +set {moduleList(testit)} {} +global {preloadList} +set {preloadList(xfInternal)} {} +global {symbolicName} +set {symbolicName(binutils)} {.frame0.menubutton7} +set {symbolicName(dialogbox)} {.top2} +set {symbolicName(editor)} {.top2.entry4} +set {symbolicName(g++)} {.frame0.menubutton4} +set {symbolicName(gas)} {.frame0.menubutton6} +set {symbolicName(gdb)} {.frame0.menubutton5} +set {symbolicName(host)} {.frame0.menubutton3.m} +set {symbolicName(hostlist)} {.frame0.menubutton3} +set {symbolicName(logs)} {.frame0.menubutton10} +set {symbolicName(misc)} {.frame0.menubutton1} +set {symbolicName(ok)} {.top2.button7} +set {symbolicName(results)} {.frame0.menubutton9} +set {symbolicName(root)} {.} +set {symbolicName(sum)} {.frame0.menubutton0} +set {symbolicName(targlist)} {.frame0.menubutton2} +global {xfWmSetPosition} +set {xfWmSetPosition} {} +global {xfWmSetSize} +set {xfWmSetSize} {} +global {xfAppDefToplevels} +set {xfAppDefToplevels} {} + +# display/remove toplevel windows. +ShowWindow. + +# load default bindings. +if {[info exists env(XF_BIND_FILE)] && + "[info procs XFShowHelp]" == ""} { + source $env(XF_BIND_FILE) +} + +# parse and apply application defaults. +XFLocalLoadAppDefs Testit +XFLocalSetAppDefs + +# end source +EndSrc + +# eof +# + -- cgit v1.1