diff options
author | Marc Espie <espie@cvs.openbsd.org> | 1999-05-26 13:38:57 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 1999-05-26 13:38:57 +0000 |
commit | 0126e157b87f137fc08dc7f46f6c291b9d06ac5d (patch) | |
tree | f8555e3e504eb82b4cd3cba5cec20ae4ce8124ff /gnu/egcs/libstdc++/testsuite | |
parent | ff8e9a4356e55ed142306c3a375fa280800abc86 (diff) |
egcs projects compiler system
Exact copy of the snapshot, except for the removal of
texinfo/
gcc/ch/
libchill/
Diffstat (limited to 'gnu/egcs/libstdc++/testsuite')
-rw-r--r-- | gnu/egcs/libstdc++/testsuite/ChangeLog | 74 | ||||
-rw-r--r-- | gnu/egcs/libstdc++/testsuite/Makefile.in | 67 | ||||
-rw-r--r-- | gnu/egcs/libstdc++/testsuite/config/default.exp | 1 | ||||
-rw-r--r-- | gnu/egcs/libstdc++/testsuite/configure.in | 24 | ||||
-rw-r--r-- | gnu/egcs/libstdc++/testsuite/lib/libstdc++.exp | 179 | ||||
-rw-r--r-- | gnu/egcs/libstdc++/testsuite/libstdc++.tests/test.exp | 34 |
6 files changed, 379 insertions, 0 deletions
diff --git a/gnu/egcs/libstdc++/testsuite/ChangeLog b/gnu/egcs/libstdc++/testsuite/ChangeLog new file mode 100644 index 00000000000..7b1a9f0c3c5 --- /dev/null +++ b/gnu/egcs/libstdc++/testsuite/ChangeLog @@ -0,0 +1,74 @@ +Wed Nov 25 01:00:07 1998 Marc Espie <espie@quatramaran.ens.fr> + + * Makefile.in (just-check): Ignore errors. + +Sun Jun 28 00:00:10 1998 Carlo Wood <carlo@runaway.xs4all.nl> + + * lib/libstdc++.exp: Use global variable ld_library_path (not local) + that is a lot more persistent; dejagnu-980528 needs this. + * lib/libstdc++.exp (test_stdc++): Use regular expression " -lstdc.." + to remove -lstdc++ arguments (not " -lstdc.*"). + +Thu Dec 25 00:34:03 1997 Jeffrey A Law (law@cygnus.com) + + * lib/libstdc++.exp (test_libstdc++): Set LD_LIBRARY_PATH + and SHLIB_PATH appropriately. + +Wed Sep 3 09:39:36 1997 Jeffrey A Law (law@cygnus.com) + + * lib/libstdc++.exp: Remove libg++_link_flags. + +Wed Aug 6 18:43:23 1997 Jason Merrill <jason@yorick.cygnus.com> + + * lib/libstdc++.exp: Remove libio_link_flags. + +Thu Jul 17 14:54:58 1997 Brendan Kehoe <brendan@lisa.cygnus.com> + + * lib/libstdc++.exp (base_dir): Move from here... + (test_libstdc++): To here. + (LIBSTDCPP): Delete unused global decl. + +Tue Jun 17 01:46:49 1997 Bob Manson <manson@farmer> + + * lib/libstdc++.exp: Strip off leading LFs from both the pattern + being matched against and the output from the board. Find the + correct multilib libstdc++ to link with. Use g++_link_flags + and libio_link_flags. Link in the status wrapper if needed. + (libstdc++_init): New procedure. + +Tue Jun 3 17:16:39 1997 Bob Manson <manson@charmed.cygnus.com> + + * lib/libstdc++.exp: Don't use global exec_output variable; the + output is returned from remote_load instead. + +Tue Apr 29 17:20:05 1997 Mike Stump <mrs@cygnus.com> + + * lib/libstdc++.exp: Fixup so that $compile_args works better. + * libstdc++.tests/test.exp: Also run with -O. + +Tue Apr 29 16:34:37 1997 Mike Stump <mrs@cygnus.com> + + * testsuite/lib/libstdc++.exp: Fixup so that we always have the + same number of testcases, and so that we have meaningful testcase + names. + +Tue Apr 29 13:05:14 1997 Bob Manson <manson@charmed.cygnus.com> + + * lib/libstdc++.exp: Add support for --tool_opts. + +Mon Apr 28 11:10:25 1997 Bob Manson <manson@charmed.cygnus.com> + + * Makefile.in: Add comment so target Makefile fragments get added. + Removed clean rule, because it is added by configure. + + * configure.in (TESTS): Add. + +Sun Apr 27 15:03:10 1997 Brendan Kehoe <brendan@lisa.cygnus.com> + + * Makefile.in (clean): Add empty rule for now. + +Fri Apr 25 18:59:14 1997 Bob Manson <manson@charmed.cygnus.com> + + * lib/libstdc++.exp(test_libstdc++): Return on error. Generate a + FAIL if the compile fails. Remove CRs from the output from the + testcase. diff --git a/gnu/egcs/libstdc++/testsuite/Makefile.in b/gnu/egcs/libstdc++/testsuite/Makefile.in new file mode 100644 index 00000000000..7c85678e1fe --- /dev/null +++ b/gnu/egcs/libstdc++/testsuite/Makefile.in @@ -0,0 +1,67 @@ +# 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, 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. */ + +srcdir = libstdc++.tests + +EXPECT = `if [ -f $${rootme}/../../expect/expect ] ; then \ + echo $${rootme}/../../expect/expect ; \ + else echo expect ; fi` + +RUNTEST = `if [ -f $${srcdir}/../../dejagnu/runtest ] ; then \ + echo $${srcdir}/../../dejagnu/runtest ; \ + else echo runtest; fi` +RUNTESTFLAGS = + +#### package, host, target, and site dependent Makefile fragments come in here. +## + +.PHONY: all +all: + +.PHONY: check +check: 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 libstdc++" >> ./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: site.exp + -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/gnu/egcs/libstdc++/testsuite/config/default.exp b/gnu/egcs/libstdc++/testsuite/config/default.exp new file mode 100644 index 00000000000..90967cccc18 --- /dev/null +++ b/gnu/egcs/libstdc++/testsuite/config/default.exp @@ -0,0 +1 @@ +load_lib "standard.exp" diff --git a/gnu/egcs/libstdc++/testsuite/configure.in b/gnu/egcs/libstdc++/testsuite/configure.in new file mode 100644 index 00000000000..ad5f232b085 --- /dev/null +++ b/gnu/egcs/libstdc++/testsuite/configure.in @@ -0,0 +1,24 @@ +# 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=configure.in +srcname="tests for ANSI C++ library, dejagnu style" +package_makefile_frag=Make.pack +package_makefile_rules_frag=Make.pack.r + +# per-host: + +# per-target: + +target_makefile_frag=../target-mkfrag + +TO_TOPDIR=../../ +ALL=' ' +XCXXINCLUDES="-I${srcdir}/.. -I${srcdir}/../stl -I${TO_TOPDIR}libio -I${srcdir}/${TO_TOPDIR}libio" +TESTS="tcomplex tstring tlist tmap tvector" +MOSTLYCLEAN="*.o core ${TESTS} *.out" +(. ${srcdir}/${TO_TOPDIR}libio/config.shared) >${package_makefile_frag} 2>${package_makefile_rules_frag} + +# post-target: diff --git a/gnu/egcs/libstdc++/testsuite/lib/libstdc++.exp b/gnu/egcs/libstdc++/testsuite/lib/libstdc++.exp new file mode 100644 index 00000000000..3333ddad6c7 --- /dev/null +++ b/gnu/egcs/libstdc++/testsuite/lib/libstdc++.exp @@ -0,0 +1,179 @@ +# 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 tmpdir + +if ![info exists tmpdir] { + set tmpdir "/tmp" +} + +# +# Build the status wrapper library as needed. +# +proc libstdc++_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_libstdc++ { options srcfile compile_args inpfile resultfile exec_args } { + global base_dir + global LIBSTDCPP + global srcdir subdir objdir + global TOOL_OPTIONS + global ld_library_path + + if [info exists LIBSTDCPP] { + set libstdcpp $LIBSTDCPP; + } else { + set gp [get_multilibs]; + if { $gp != "" } { + if [file exists "$gp/libstdc++/libstdc++.a"] { + set libstdcpp "-L$gp/libstdc++ -lstdc++"; + } + } + if ![info exists libstdcpp] { + set libstdcpp [findfile $base_dir/../../libstdc++/libstdc++.a "-L$base_dir/../../libstdc++ -lstdc++" -lstdc++] + } + } + + verbose "using LIBSTDCPP = $libstdcpp" 2 + set args "" + + # Basically we want to build up a colon separated path list from + # the value of $libstdcpp. + + # First strip away any -L arguments. + regsub -all -- "-L" $libstdcpp "" ld_library_path + + # Then remove any -lstdc++ argument. + regsub -all -- " -lstdc.." $ld_library_path "" ld_library_path + + # That's enough to make things work for the normal case. + # If we wanted to handle an arbitrary value of libstdcpp, + # then we'd have to do a lot more work. + + if { $compile_args != "" } { + lappend args "additional_flags=$compile_args" + } + lappend args "incdir=.." + lappend args "incdir=$srcdir/.." + lappend args "incdir=$srcdir/../stl" + lappend args "incdir=." + if [info exists TOOL_OPTIONS] { + lappend args "additional_flags=$TOOL_OPTIONS" + } + + global wrapper_file wrap_compile_flags; + # We have to include libio, for _G_config.h. + lappend args "additional_flags=$wrap_compile_flags"; + lappend args "libs=$wrapper_file"; + lappend args "libs=$libstdcpp"; + lappend args "additional_flags=[libio_include_flags]" + lappend args debug + + regsub "^.*/(\[^/.\]+)\[.\]\[^/]*$" "$srcfile" "\\1" out + set executable "${objdir}/$out" + set errname "[file tail $srcfile]" + if { $compile_args != "" } { + set errname "$errname $compile_args" + } + + if { [target_compile $srcfile "$executable" executable $args] != "" } { + fail "$errname compilation" + setup_xfail "*-*-*" + fail "$errname execution" + setup_xfail "*-*-*" + fail "$errname output" + return; + } + pass "$errname compilation" + + set result [libstdc++_load $executable "$exec_args" "$inpfile"]; + set status [lindex $result 0]; + set output [lindex $result 1]; + $status "$errname execution" + if { $status != "pass" } { + setup_xfail "*-*-*" + fail "$errname output" + return; + } + + verbose "resultfile is $resultfile" + set id [open $resultfile r]; + set expected "" + append expected [read $id]; + regsub -all "\r" "$output" "" output; + regsub "\n*$" $expected "" expected + regsub "\n*$" $output "" output + regsub "^\n*" $expected "" expected + regsub "^\n*" $output "" output + regsub -all "\[ \t\]\[ \t\]*" $expected " " expected + regsub -all "\[ \t\]*\n\n*" $expected "\n" expected + regsub -all "\[ \t\]\[ \t\]*" $output " " output + regsub -all "\[ \t\]*\n\n*" $output "\n" output + verbose "expected is $expected" + verbose "actual is $output" + set passed 0; + if {$options == "regexp_match"} { + if [regexp $expected $output] { + set passed 1; + } + } else { + if { $expected == $output } { + set passed 1; + } + } + if { $passed == 1 } { + pass "$errname output" + } else { + clone_output "expected was $expected" + clone_output "output was $output" + fail "$errname output" + } + close $id; +} + +# +# libstdc++_version -- extract and print the version number of libstdc++p +# +proc default_libstdc++_version {} { +} + +proc default_libstdc++_start { } { +} diff --git a/gnu/egcs/libstdc++/testsuite/libstdc++.tests/test.exp b/gnu/egcs/libstdc++/testsuite/libstdc++.tests/test.exp new file mode 100644 index 00000000000..7368cfb282e --- /dev/null +++ b/gnu/egcs/libstdc++/testsuite/libstdc++.tests/test.exp @@ -0,0 +1,34 @@ +global srcdir subdir + +catch "glob -nocomplain $srcdir/$subdir/../../tests/*.exp" srcfiles +verbose "srcfiles are $srcfiles" + +set prefix "" +foreach x $srcfiles { + regsub "\\.exp$" $x "" prefix + set bname [file tail $prefix] + set args "" + if [file exists $srcdir/$subdir/${bname}.arg] { + set id [open "$srcdir/$subdir/${bname}.arg" r]; + set args [read -nonewline $id]; + close $id; + } + if [file exists $srcdir/$subdir/${bname}.xpo] { + set resfile "$srcdir/$subdir/${bname}.xpo" + set options "regexp_match" + } else { + set resfile "${prefix}.exp" + set options "" + } + + if [file exists ${prefix}.inp] { + set inpfile ${prefix}.inp + } else { + set inpfile "" + } + + verbose "inpfile is $inpfile" + + test_libstdc++ $options "${prefix}.cc" "" $inpfile $resfile $args + test_libstdc++ $options "${prefix}.cc" "-O" $inpfile $resfile $args +} |