aboutsummaryrefslogtreecommitdiff
path: root/libio/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'libio/testsuite')
-rw-r--r--libio/testsuite/ChangeLog49
-rw-r--r--libio/testsuite/Makefile.in89
-rw-r--r--libio/testsuite/config/default.exp1
-rw-r--r--libio/testsuite/configure.in21
-rw-r--r--libio/testsuite/lib/libio.exp164
-rw-r--r--libio/testsuite/libio.tests/hounddog.exp3
-rw-r--r--libio/testsuite/libio.tests/putbackdog.exp3
-rw-r--r--libio/testsuite/libio.tests/tFile.exp3
-rw-r--r--libio/testsuite/libio.tests/tfformat.exp1
-rw-r--r--libio/testsuite/libio.tests/tiformat.exp1
-rw-r--r--libio/testsuite/libio.tests/tiomanip.exp1
-rw-r--r--libio/testsuite/libio.tests/tiomisc.exp1
-rw-r--r--libio/testsuite/libio.tests/tstdiomisc.exp1
13 files changed, 338 insertions, 0 deletions
diff --git a/libio/testsuite/ChangeLog b/libio/testsuite/ChangeLog
new file mode 100644
index 0000000..351cbb9
--- /dev/null
+++ b/libio/testsuite/ChangeLog
@@ -0,0 +1,49 @@
+Fri Jun 27 18:19:21 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * lib/libio.exp(libio_init): New procedure.
+ (test_libio): Link with a status wrapper if necessary. Strip
+ leading newlines before comparing output. Look for a multilib
+ libiberty directory.
+
+Tue Jun 3 15:17:31 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * lib/libio.exp: Don't use global exec_output variable; the output
+ is returned from remote_load instead.
+
+Tue May 20 17:59:31 1997 Jeffrey A Law (law@cygnus.com)
+
+ * lib/libio.exp: If "slow_simulator" is set, then add
+ -DSLOW_SIMULATOR to the compiler's arguments.
+
+Fri May 16 19:33:39 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * lib/libio.exp: Name the executables after the testcases.
+
+ * libio.tests/tiomisc.exp: Turn off warnings when conpiling.
+
+Thu May 1 17:01:47 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * lib/libio.exp: Link in libiberty.a.
+
+Tue Apr 29 16:34:37 1997 Mike Stump <mrs@cygnus.com>
+
+ * testsuite/lib/libio.exp: Fixup so that we always have the same
+ number of testcases, and so that we have meaningful testcase
+ names.
+
+Tue Apr 29 13:08:41 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * lib/libio.exp: Add support for --tool_opts.
+
+Mon Apr 28 11:26:06 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * Makefile.in: Removed clean rule, as it is added by configure.
+ Remove a lot of unused rules.
+
+Sun Apr 27 15:02:48 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
+
+ * Makefile.in (clean): Add empty rule for now.
+
+Sat Apr 26 13:41:44 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * New DejaGnu-style testsuite.
diff --git a/libio/testsuite/Makefile.in b/libio/testsuite/Makefile.in
new file mode 100644
index 0000000..3b88456
--- /dev/null
+++ b/libio/testsuite/Makefile.in
@@ -0,0 +1,89 @@
+# Copyright (C) 1997 Free Software Foundation
+#
+# This file is part of the GNU IO Library. This library is free
+# software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This library 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 CC; see the file COPYING. If not, write to
+# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+
+srcdir = libio.tests
+
+CFLAGS = -g
+C_FLAGS = $(CFLAGS) -I. -I.. -I$(srcdir) -I$(srcdir)/..
+CXXFLAGS = -g
+CC = gcc
+CXX = gcc
+
+EXPECT = `if [ -f $${rootme}/../../expect/expect ] ; then \
+ echo $${rootme}/../../expect/expect ; \
+ else echo expect ; fi`
+
+RUNTEST = $(RUNTEST_FOR_TARGET)
+
+RUNTESTFLAGS =
+
+RUNTEST_FOR_TARGET = `\
+ if [ -f $${srcdir}/../../dejagnu/runtest ]; then \
+ echo $${srcdir}/../../dejagnu/runtest; \
+ else \
+ if [ "$(host_canonical)" = "$(target_canonical)" ]; then \
+ echo runtest; \
+ else \
+ t='$(program_transform_name)'; echo runtest | sed -e '' $$t; \
+ fi; \
+ fi`
+
+#### package, host, target, and site dependent Makefile fragments come in here.
+##
+
+# See ${MOSTLYCLEAN} in configure.in
+JUNK_TO_CLEAN = tFile tiomisc hounddog putbackdog tiomanip \
+ t?format *.out streamfile ftmp* tstdiomisc foo.dat
+
+.PHONY: info
+info:
+.PHONY: clean-info
+clean-info:
+.PHONY: install-info
+install-info:
+
+check: site.exp all just-check
+
+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_alias $(host_alias)" >> ./tmp0
+ @echo "set host_triplet ${host_canonical}" >> ./tmp0
+ @echo "set target_alias $(target_alias)" >> ./tmp0
+ @echo "set target_triplet ${target_canonical}" >> ./tmp0
+ @echo "set build_triplet ${build_canonical}" >> ./tmp0
+ @echo "set srcdir ${srcdir}" >> ./tmp0
+ @echo "set tool libio" >> ./tmp0
+ @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0
+ @cat ./tmp0 > site.exp
+ @cat site.bak | sed \
+ -e '1,/^## All variables above are.*##/ d' >> site.exp
+ -@rm -f ./tmp?
+
+just-check:
+ rootme=`pwd`; export rootme; \
+ srcdir=${srcdir} ; export srcdir ; \
+ EXPECT=${EXPECT} ; export EXPECT ; \
+ if [ -f $${rootme}/../../expect/expect ] ; then \
+ TCL_LIBRARY=$${srcdir}/../../tcl/library ; \
+ export TCL_LIBRARY ; fi ; \
+ $(RUNTEST) $(RUNTESTFLAGS)
diff --git a/libio/testsuite/config/default.exp b/libio/testsuite/config/default.exp
new file mode 100644
index 0000000..90967cc
--- /dev/null
+++ b/libio/testsuite/config/default.exp
@@ -0,0 +1 @@
+load_lib "standard.exp"
diff --git a/libio/testsuite/configure.in b/libio/testsuite/configure.in
new file mode 100644
index 0000000..f1bea6a
--- /dev/null
+++ b/libio/testsuite/configure.in
@@ -0,0 +1,21 @@
+# This file is a shell script fragment that supplies the information
+# necessary for a configure script to process the program in
+# this directory. For more information, look at ../../configure.
+
+configdirs=
+srctrigger=libio.tests/hounddog.exp
+srcname="test C++ input/output library, dejagnu style"
+package_makefile_frag=Make.pack
+
+# per-host:
+
+# per-target:
+
+TO_TOPDIR=../../
+ALL=' '
+XCINCLUDES='-I. -I.. -I$(srcdir) -I$(srcdir)/..'
+XCXXINCLUDES='-I. -I.. -I$(srcdir) -I$(srcdir)/..'
+MOSTLYCLEAN='*.o core $(JUNK_TO_CLEAN)'
+(. ${srcdir}/../config.shared) >${package_makefile_frag}
+
+# post-target:
diff --git a/libio/testsuite/lib/libio.exp b/libio/testsuite/lib/libio.exp
new file mode 100644
index 0000000..22bd3b9
--- /dev/null
+++ b/libio/testsuite/lib/libio.exp
@@ -0,0 +1,164 @@
+# Copyright (C) 1997 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-lib-g++@prep.ai.mit.edu
+
+# This file was written by Bob Manson. (manson@cygnus.com)
+
+load_lib "libgloss.exp"
+
+global base_dir
+
+proc libio_init { args } {
+ global wrapper_file;
+ global wrap_compile_flags;
+ set wrapper_file "";
+ set wrap_compile_flags "";
+ if [target_info exists needs_status_wrapper] {
+ set result [build_wrapper "testglue.o"];
+ if { $result != "" } {
+ set wrapper_file [lindex $result 0];
+ set wrap_compile_flags [lindex $result 1];
+ } else {
+ warning "Status wrapper failed to build."
+ }
+ }
+}
+#
+# Run the test specified by srcfile and resultfile. compile_args and
+# exec_args are additional arguments to be passed in when compiling and
+# running the testcase, respectively.
+#
+
+proc test_libio { srcfile compile_args inpfile resultfile exec_args } {
+ global LIBIO
+ global srcdir subdir objdir
+ global TOOL_OPTIONS
+ global wrapper_file wrap_compile_flags;
+
+ if { $inpfile != "" } {
+ set inpfile "$srcdir/../tests/$inpfile"
+ }
+
+ set args ""
+ lappend args "additional_flags=-O3";
+ lappend args "additional_flags=-I.. -I$srcdir/.."
+ lappend args "additional_flags=$wrap_compile_flags";
+ lappend args "libs=$wrapper_file";
+ if { $compile_args != "" } {
+ lappend args "additional_flags=$compile_args"
+ }
+
+ if [regexp "\.cc$" $srcfile] {
+ lappend args "additional_flags=-nostdinc++"
+ lappend args "additional_flags=[g++_include_flags]";
+ lappend args "additional_flags=[g++_link_flags]";
+ lappend args "libs=-lstdc++"
+ } else {
+ if [info exists LIBIO] {
+ lappend args "libdir=$LIBIO"
+ } else {
+ lappend args "additional_flags=[libio_link_flags]";
+ }
+ lappend args "libs=-lio"
+ }
+
+ if [target_info exists slow_simulator] then {
+ lappend args "additional_flags=-DSLOW_SIMULATOR"
+ }
+
+ if [info exists TOOL_OPTIONS] {
+ lappend args "additional_options=$TOOL_OPTIONS"
+ }
+
+ set gp [get_multilibs];
+ if { $gp != "" } {
+ if [file exists $gp/libiberty/libiberty.a] {
+ lappend args "libdir=$gp/libiberty";
+ set found_libiberty 1;
+ }
+ }
+ if ![info exists found_libiberty] {
+ set lib [lookfor_file "$objdir" "libiberty/libiberty.a"];
+ if { $lib != "" } {
+ lappend args "libdir=[file dirname $lib]";
+ }
+ }
+ lappend args "libs=-liberty"
+ lappend args "debug";
+
+ set errname "$srcfile"
+ set srcfile "$srcdir/../tests/$srcfile"
+ regsub "\\..*$" "[file tail $srcfile]" "" executable
+ set executable "$objdir/$executable"
+
+ if { [target_compile $srcfile $executable executable $args] != "" } {
+ fail "$errname compilation $exec_args";
+ setup_xfail "*-*-*"
+ fail "$errname execution $exec_args"
+ if { $resultfile != "" } {
+ setup_xfail "*-*-*"
+ fail "$errname output $exec_args"
+ }
+ return;
+ }
+ pass "$errname compilation $exec_args"
+
+ set result [libio_load $executable $exec_args $inpfile];
+ set status [lindex $result 0];
+ set output [lindex $result 1];
+ if { $status == "unsupported" } {
+ unsupported "target does not support loading $srcfile"
+ return;
+ }
+ if { $status != "pass" } {
+ $status "$errname execution $exec_args"
+ setup_xfail "*-*-*"
+ fail "$errname output $exec_args"
+ return;
+ }
+ pass "$errname execution $exec_args"
+
+ if { $resultfile != "" } {
+ set id [open $srcdir/../tests/$resultfile r];
+ set expected ""
+ append expected [read $id];
+ verbose "expected is $expected"
+ verbose "actual is $output"
+ regsub -all "\r" $output "" output
+ regsub "\n+$" $expected "" expected
+ regsub "\n+$" $output "" output
+ regsub "^\n+" $expected "" expected
+ regsub "^\n+" $output "" output
+ if { $expected == $output } {
+ pass "$errname output $exec_args"
+ } else {
+ fail "$errname output $exec_args"
+ }
+ close $id;
+ }
+}
+
+#
+# libio_version -- extract and print the version number of libio
+#
+proc default_libio_version {} {
+ global LIBIO
+}
+
+proc default_libio_start { } {
+}
diff --git a/libio/testsuite/libio.tests/hounddog.exp b/libio/testsuite/libio.tests/hounddog.exp
new file mode 100644
index 0000000..b51f9f0
--- /dev/null
+++ b/libio/testsuite/libio.tests/hounddog.exp
@@ -0,0 +1,3 @@
+test_libio hounddog.cc "" hounddog.inp hounddog.exp ""
+test_libio hounddog.cc "" hounddog.inp hounddog.exp "-b0"
+test_libio hounddog.cc "" hounddog.inp hounddog.exp "-b2"
diff --git a/libio/testsuite/libio.tests/putbackdog.exp b/libio/testsuite/libio.tests/putbackdog.exp
new file mode 100644
index 0000000..30d91a8
--- /dev/null
+++ b/libio/testsuite/libio.tests/putbackdog.exp
@@ -0,0 +1,3 @@
+test_libio putbackdog.cc "" hounddog.inp hounddog.exp ""
+test_libio putbackdog.cc "" hounddog.inp hounddog.exp "-b0"
+test_libio putbackdog.cc "" hounddog.inp hounddog.exp "-b2"
diff --git a/libio/testsuite/libio.tests/tFile.exp b/libio/testsuite/libio.tests/tFile.exp
new file mode 100644
index 0000000..f190916
--- /dev/null
+++ b/libio/testsuite/libio.tests/tFile.exp
@@ -0,0 +1,3 @@
+test_libio tFile.cc "" tFile.inp tFile.exp ""
+test_libio tFile.cc "" tFile.inp tFile.exp "-b0"
+test_libio tFile.cc "" tFile.inp tFile.exp "-b3"
diff --git a/libio/testsuite/libio.tests/tfformat.exp b/libio/testsuite/libio.tests/tfformat.exp
new file mode 100644
index 0000000..f0f7113
--- /dev/null
+++ b/libio/testsuite/libio.tests/tfformat.exp
@@ -0,0 +1 @@
+test_libio tfformat.c "-DTEST_LIBIO -DTEST_EXACTNESS" "" "" ""
diff --git a/libio/testsuite/libio.tests/tiformat.exp b/libio/testsuite/libio.tests/tiformat.exp
new file mode 100644
index 0000000..f2d14db
--- /dev/null
+++ b/libio/testsuite/libio.tests/tiformat.exp
@@ -0,0 +1 @@
+test_libio tiformat.c "-DTEST_LIBIO" "" "" ""
diff --git a/libio/testsuite/libio.tests/tiomanip.exp b/libio/testsuite/libio.tests/tiomanip.exp
new file mode 100644
index 0000000..856cefc
--- /dev/null
+++ b/libio/testsuite/libio.tests/tiomanip.exp
@@ -0,0 +1 @@
+test_libio tiomanip.cc "" "" tiomanip.exp ""
diff --git a/libio/testsuite/libio.tests/tiomisc.exp b/libio/testsuite/libio.tests/tiomisc.exp
new file mode 100644
index 0000000..7130995
--- /dev/null
+++ b/libio/testsuite/libio.tests/tiomisc.exp
@@ -0,0 +1 @@
+test_libio tiomisc.cc "-w" "" tiomisc.exp ""
diff --git a/libio/testsuite/libio.tests/tstdiomisc.exp b/libio/testsuite/libio.tests/tstdiomisc.exp
new file mode 100644
index 0000000..01dae9f
--- /dev/null
+++ b/libio/testsuite/libio.tests/tstdiomisc.exp
@@ -0,0 +1 @@
+test_libio tstdiomisc.c "" "" tstdiomisc.exp ""