diff options
author | John Gilmore <gnu@cygnus> | 1993-02-21 19:55:15 +0000 |
---|---|---|
committer | John Gilmore <gnu@cygnus> | 1993-02-21 19:55:15 +0000 |
commit | 699bfeaeb9be30635909eca693e3688c27bdc0ab (patch) | |
tree | 9baecdb6ad6da422e292620061c2756e7d3cb665 /binutils/testsuite | |
parent | 2614a439a8e54c092ebaae78b5a454573e502885 (diff) | |
download | gdb-699bfeaeb9be30635909eca693e3688c27bdc0ab.zip gdb-699bfeaeb9be30635909eca693e3688c27bdc0ab.tar.gz gdb-699bfeaeb9be30635909eca693e3688c27bdc0ab.tar.bz2 |
For MTW
Diffstat (limited to 'binutils/testsuite')
-rw-r--r-- | binutils/testsuite/ChangeLog | 10 | ||||
-rw-r--r-- | binutils/testsuite/config/abug-nm.exp | 61 | ||||
-rw-r--r-- | binutils/testsuite/config/aout-nm.exp | 60 | ||||
-rw-r--r-- | binutils/testsuite/config/coff-nm.exp | 60 | ||||
-rw-r--r-- | binutils/testsuite/config/nind-nm.exp | 60 | ||||
-rw-r--r-- | binutils/testsuite/config/udi-nm.exp | 60 | ||||
-rw-r--r-- | binutils/testsuite/config/unix-nm.exp | 60 | ||||
-rw-r--r-- | binutils/testsuite/config/vx-nm.exp | 60 | ||||
-rw-r--r-- | binutils/testsuite/lib/nm-defs.exp | 156 |
9 files changed, 587 insertions, 0 deletions
diff --git a/binutils/testsuite/ChangeLog b/binutils/testsuite/ChangeLog new file mode 100644 index 0000000..8425709 --- /dev/null +++ b/binutils/testsuite/ChangeLog @@ -0,0 +1,10 @@ +Sun Feb 21 10:55:55 1993 Mike Werner (mtw@poseidon.cygnus.com) + + * binutils/testsuite: Initial creation of binutils/testsuite. + Migrated dejagnu testcases and support files for testing nm to + binutils/testsuite from deja-gnu. These files were moved "as is" + with no modifications. This migration is part of a major overhaul + of dejagnu. The modifications to these testcases, etc., which + will allow them to work with the new version of dejagnu will be + made in a future update. + diff --git a/binutils/testsuite/config/abug-nm.exp b/binutils/testsuite/config/abug-nm.exp new file mode 100644 index 0000000..f38f5e1 --- /dev/null +++ b/binutils/testsuite/config/abug-nm.exp @@ -0,0 +1,61 @@ +# Copyright (C) 1988, 1990, 1991, 1992 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 Rob Savoye. (rob@cygnus.com) + +load_lib nm-defs.exp + +# +# nm_version -- extract and print the version number of nm +# +proc nm_version {} { + default_nm_version +} + +# +# nm_load -- loads the program. For nm, we just execute it +# +proc nm_load { arg } { + default_nm_load $arg +} + +# +# nm_exit -- just a stub for nm +# +proc nm_exit {} { + default_nm_exit +} + +# +# nm_start -- start NM running +# +proc nm_start { arg } { + default_nm_start $arg +} + +# +# add some basic error trapping. These mostly catch programming error's +# within the tests themselves +# +expect_before { + buffer_full { error "Internal buffer is full." } + "can't open 'nmtest'" { error "Can't open test file." } +} + + diff --git a/binutils/testsuite/config/aout-nm.exp b/binutils/testsuite/config/aout-nm.exp new file mode 100644 index 0000000..00107ed --- /dev/null +++ b/binutils/testsuite/config/aout-nm.exp @@ -0,0 +1,60 @@ +# Copyright (C) 1988, 1990, 1991, 1992 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 Rob Savoye. (rob@cygnus.com) + +load_lib nm-defs.exp +# +# nm_version -- extract and print the version number of nm +# +proc nm_version {} { + default_nm_version +} + +# +# nm_load -- loads the program. For nm, we just execute it +# +proc nm_load { arg } { + default_nm_load $arg + } + +# +# nm_exit -- just a stub for nm +# +proc nm_exit {} { + default_nm_exit +} + +# +# nm_start -- start NM running +# +proc nm_start { arg } { + default_nm_start $arg +} + +# +# add some basic error trapping. These mostly catch programming error's +# within the tests themselves +# +expect_before { + buffer_full { error "internal buffer is full." } + "can't open 'nmtest'" { error "Can't open test file." } +} + + diff --git a/binutils/testsuite/config/coff-nm.exp b/binutils/testsuite/config/coff-nm.exp new file mode 100644 index 0000000..e2436a4 --- /dev/null +++ b/binutils/testsuite/config/coff-nm.exp @@ -0,0 +1,60 @@ +# Copyright (C) 1988, 1990, 1991, 1992 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 Rob Savoye. (rob@cygnus.com) + +load_lib nm-defs.exp +# +# nm_version -- extract and print the version number of nm +# +proc nm_version {} { + default_nm_version +} + +# +# nm_load -- loads the program. For nm, we just execute it +# +proc nm_load { arg } { + default_nm_load $arg + } + +# +# nm_exit -- just a stub for nm +# +proc nm_exit {} { + default_nm_exit +} + +# +# nm_start -- start NM running +# +proc nm_start { arg } { + default_nm_start $arg +} + +# +# add some basic error trapping. These mostly catch programming error's +# within the tests themselves +# +expect_before { + buffer_full { error "Internal buffer is full." } + "can't open 'nmtest'" { error "Can't open test file." } +} + + diff --git a/binutils/testsuite/config/nind-nm.exp b/binutils/testsuite/config/nind-nm.exp new file mode 100644 index 0000000..855bdfd --- /dev/null +++ b/binutils/testsuite/config/nind-nm.exp @@ -0,0 +1,60 @@ +# Copyright (C) 1988, 1990, 1991, 1992 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 Rob Savoye. (rob@cygnus.com) + +load_lib nm-defs.exp +# +# nm_version -- extract and print the version number of nm +# +proc nm_version {} { + default_nm_version +} + +# +# nm_load -- loads the program. For nm, we just execute it +# +proc nm_load { arg } { + default_nm_load $arg + } + +# +# nm_exit -- just a stub for nm +# +proc nm_exit {} { + default_nm_exit +} + +# +# nm_start -- start NM running +# +proc nm_start { arg } { + default_nm_start $arg +} + +# +# add some basic error trapping. These mostly catch programming error's +# within the tests themselves +# +expect_before { + buffer_full { clone_output "ERROR: internal buffer is full" } + "can't open 'nmtest'" { clone_output "ERROR: Can't open test file" } +} + + diff --git a/binutils/testsuite/config/udi-nm.exp b/binutils/testsuite/config/udi-nm.exp new file mode 100644 index 0000000..00107ed --- /dev/null +++ b/binutils/testsuite/config/udi-nm.exp @@ -0,0 +1,60 @@ +# Copyright (C) 1988, 1990, 1991, 1992 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 Rob Savoye. (rob@cygnus.com) + +load_lib nm-defs.exp +# +# nm_version -- extract and print the version number of nm +# +proc nm_version {} { + default_nm_version +} + +# +# nm_load -- loads the program. For nm, we just execute it +# +proc nm_load { arg } { + default_nm_load $arg + } + +# +# nm_exit -- just a stub for nm +# +proc nm_exit {} { + default_nm_exit +} + +# +# nm_start -- start NM running +# +proc nm_start { arg } { + default_nm_start $arg +} + +# +# add some basic error trapping. These mostly catch programming error's +# within the tests themselves +# +expect_before { + buffer_full { error "internal buffer is full." } + "can't open 'nmtest'" { error "Can't open test file." } +} + + diff --git a/binutils/testsuite/config/unix-nm.exp b/binutils/testsuite/config/unix-nm.exp new file mode 100644 index 0000000..00107ed --- /dev/null +++ b/binutils/testsuite/config/unix-nm.exp @@ -0,0 +1,60 @@ +# Copyright (C) 1988, 1990, 1991, 1992 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 Rob Savoye. (rob@cygnus.com) + +load_lib nm-defs.exp +# +# nm_version -- extract and print the version number of nm +# +proc nm_version {} { + default_nm_version +} + +# +# nm_load -- loads the program. For nm, we just execute it +# +proc nm_load { arg } { + default_nm_load $arg + } + +# +# nm_exit -- just a stub for nm +# +proc nm_exit {} { + default_nm_exit +} + +# +# nm_start -- start NM running +# +proc nm_start { arg } { + default_nm_start $arg +} + +# +# add some basic error trapping. These mostly catch programming error's +# within the tests themselves +# +expect_before { + buffer_full { error "internal buffer is full." } + "can't open 'nmtest'" { error "Can't open test file." } +} + + diff --git a/binutils/testsuite/config/vx-nm.exp b/binutils/testsuite/config/vx-nm.exp new file mode 100644 index 0000000..00107ed --- /dev/null +++ b/binutils/testsuite/config/vx-nm.exp @@ -0,0 +1,60 @@ +# Copyright (C) 1988, 1990, 1991, 1992 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 Rob Savoye. (rob@cygnus.com) + +load_lib nm-defs.exp +# +# nm_version -- extract and print the version number of nm +# +proc nm_version {} { + default_nm_version +} + +# +# nm_load -- loads the program. For nm, we just execute it +# +proc nm_load { arg } { + default_nm_load $arg + } + +# +# nm_exit -- just a stub for nm +# +proc nm_exit {} { + default_nm_exit +} + +# +# nm_start -- start NM running +# +proc nm_start { arg } { + default_nm_start $arg +} + +# +# add some basic error trapping. These mostly catch programming error's +# within the tests themselves +# +expect_before { + buffer_full { error "internal buffer is full." } + "can't open 'nmtest'" { error "Can't open test file." } +} + + diff --git a/binutils/testsuite/lib/nm-defs.exp b/binutils/testsuite/lib/nm-defs.exp new file mode 100644 index 0000000..733612c --- /dev/null +++ b/binutils/testsuite/lib/nm-defs.exp @@ -0,0 +1,156 @@ +# Copyright (C) 1988, 1990, 1991, 1992 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 Rob Savoye. (rob@cygnus.com) + +# +# nm_test -- run nm and test the result. +# Takes four parameters. +# Parameters: +# First one is the command line arguments +# Second one is the file name +# Third one is the regexp style pattern to match for a PASS, +# Fourth one is an optional message to be printed. If this +# a null string "", then the pass/fail messages are not printed. +# Returns: +# 1 if the test failed, +# 0 if the test passes, +# -1 if there was an internal error. +# +proc nm_test { args } { + global verbose + global comp_output + global NM + global NMFLAGS + + # get the parameters + set cmd_arg [lindex $args 0] + set file [lindex $args 1] + set pattern [lindex $args 2] + + if [llength $args]==4 then { + set message [lindex $args 3] + } else { + set message "$arg option" + } + + if $verbose>2 then { + send_user "Looking to match \"$pattern\"\n" + send_user "Message is \"$message\"\n" + } + + if ![file exists $file] then { + error "$file doesn't exist" + return -1 + } + +# +# run nm and analyze the results +# + set nm_flags_orig $NMFLAGS + append NMFLAGS " $cmd_arg" + nm_start $file + + if [string match "" $comp_output] then { + fail "$message" + warning "Got no output." + set NMFLAGS $nm_flags_orig + return 1 + } + + if [regexp "$pattern" $comp_output] then { + pass "$message" + set NMFLAGS $nm_flags_orig + return 0 + } + + fail "$message" + set NMFLAGS $nm_flags_orig + return 1 +} + +# since nm is purely host based, all the init module use these +# same procedures + +# +# default_nm_version -- extract and print the version number of nm +# +proc default_nm_version {} { + global NM + set tmp [exec $NM +version] + regexp " \[0-9\.\]+" $tmp version + clone_output "[which $NM] version $version\n" + unset tmp + unset version +} + +# +# default_nm_load -- loads the program. For nm, we just execute it +# +proc default_nm_load { arg } { + global verbose + global exec_output + if ![file exists $args] then { + error $args does not exist" + return -1 + } + set status [catch "exec $arg" exec_output] + if $verbose>1 then { + send_user "Executed $arg\n" + } + return $status +} + +# +# default_nm_exit -- just a stub for nm +# +proc default_nm_exit {} { +} + +# +# nm_start -- start GDB running +# +proc default_nm_start { arg } { + global verbose + global NM + global NMFLAGS + global comp_output + + if $verbose>1 then { + send_user "Spawning \"$NM $NMFLAGS $arg\"\n" + } + catch "exec $NM $NMFLAGS $arg" comp_output + if ![string match "" $comp_output] then { + send_log "$comp_output\n" + if $verbose>3 then { + send_user "$comp_output\n" + } + } +} + +# +# add some basic error trapping. These mostly catch programming error's +# within the tests themselves +# +expect_before { + buffer_full { error "Internal buffer is full" } + "can't open 'nmtest'" { error "Can't open test file" } +} + + |