diff options
author | Ken Raeburn <raeburn@cygnus> | 1993-03-29 13:27:13 +0000 |
---|---|---|
committer | Ken Raeburn <raeburn@cygnus> | 1993-03-29 13:27:13 +0000 |
commit | f70a4714c9e5eb00563878d1f764570828700e87 (patch) | |
tree | 191652dfd4fd26df145a727246df9d3a9938c3c9 /gas/testsuite/lib | |
parent | de001789f9b35b8a55793804e0560d3b45cc30b2 (diff) | |
download | gdb-f70a4714c9e5eb00563878d1f764570828700e87.zip gdb-f70a4714c9e5eb00563878d1f764570828700e87.tar.gz gdb-f70a4714c9e5eb00563878d1f764570828700e87.tar.bz2 |
First crack at a test suite.
Diffstat (limited to 'gas/testsuite/lib')
-rw-r--r-- | gas/testsuite/lib/.Sanitize | 33 | ||||
-rw-r--r-- | gas/testsuite/lib/gas-defs.exp | 69 |
2 files changed, 102 insertions, 0 deletions
diff --git a/gas/testsuite/lib/.Sanitize b/gas/testsuite/lib/.Sanitize new file mode 100644 index 0000000..7ee4960 --- /dev/null +++ b/gas/testsuite/lib/.Sanitize @@ -0,0 +1,33 @@ +# Sanitize.in for devo. +# $Id$ +# + +# Each directory to survive it's way into a release will need a file +# like this one called "./.Sanitize". All keyword lines must exist, +# and must exist in the order specified by this file. Each directory +# in the tree will be processed, top down, in the following order. + +# Hash started lines like this one are comments and will be deleted +# before anything else is done. Blank lines will also be squashed +# out. + +# The lines between the "Do-first:" line and the "Things-to-keep:" +# line are executed as a /bin/sh shell script before anything else is +# done in this + +Do-first: + + +# All files listed between the "Things-to-keep:" line and the +# "Files-to-sed:" line will be kept. All other files will be removed. +# Directories listed in this section will have their own Sanitize +# called. Directories not listed will be removed in their entirety +# with rm -rf. + +Things-to-keep: + +gas-defs.exp + +Do-last: + +# End of file. diff --git a/gas/testsuite/lib/gas-defs.exp b/gas/testsuite/lib/gas-defs.exp new file mode 100644 index 0000000..9669ee1 --- /dev/null +++ b/gas/testsuite/lib/gas-defs.exp @@ -0,0 +1,69 @@ +# Copyright (C) 1993 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 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: +# DejaGnu@cygnus.com + +# This file was written by Ken Raeburn (raeburn@cygnus.com). + +proc gas_version {} { + global AS + set tmp [exec $AS -version < /dev/null] + # Should find a way to discard constant parts, keep whatever's + # left, so the version string could be almost anything at all... + regexp " \[0-9\]\[0-9\.a-zA-Z-\]+" $tmp version + set tmp $version + regexp "\[0-9\.a-zA-Z-\]+" $tmp version + clone_output "[which $AS] version $version\n" + unset tmp + unset version +} + +proc gas_start { prog } { + global verbose + global AS + global ASFLAGS + global comp_output + + if $verbose>1 then { + send_user "Executing $AS $ASFLAGS $prog\n" + } + catch "exec $AS $ASFLAGS $prog" comp_output + if ![string match "" $comp_output] then { + send_log "$comp_output\n" + if $verbose>1 then { + send_user "$comp_output\n" + } + } +} + +proc gas_test { arg testname } { + global verbose + global comp_output + + gas_start $arg + if ![string match "" $comp_output] then { + send_log "$comp_output\n" + if $verbose>3 then { + send_user "|$comp_output|\n" + } + } + if [string match "" $comp_output] then { + pass "$testname" + } else { + fail "$testname" + } +} |