diff options
author | Rob Savoye <rob@welcomehome.org> | 2001-02-05 04:26:49 +0000 |
---|---|---|
committer | Rob Savoye <rob@welcomehome.org> | 2001-02-05 04:26:49 +0000 |
commit | 8813c6679e78c06d69259993baf8f44537abdc11 (patch) | |
tree | cd107e9fab160ca92d55e594e878d0d9bb776cce /contrib/bluegnu2.0.3/testsuite | |
parent | 65bfb0bc0716fbf4ae5f12992afa403287143039 (diff) | |
download | dejagnu-redhat.zip dejagnu-redhat.tar.gz dejagnu-redhat.tar.bz2 |
import from redhat cvsfrom-devoorigin/redhatredhat
Diffstat (limited to 'contrib/bluegnu2.0.3/testsuite')
29 files changed, 2762 insertions, 0 deletions
diff --git a/contrib/bluegnu2.0.3/testsuite/Makefile.in b/contrib/bluegnu2.0.3/testsuite/Makefile.in new file mode 100644 index 0000000..405ca3d --- /dev/null +++ b/contrib/bluegnu2.0.3/testsuite/Makefile.in @@ -0,0 +1,100 @@ +# Copyright (C) 1988, 1990, 1991, 1992, 1994, 1995 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 1, 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. +# + +# directory specifics +VPATH = @srcdir@ +srcdir = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ +host = @host@ + +.PHONY: info install-info check installcheck dvi install +info: +install: +dvi: +install-info: +check: +installcheck: +.NOEXPORT: +TCLHDIR = @TCLHDIR@ + +BLUEGNUFLAGS = +EXPECT = ` \ + if [ -f $${rootme}/../../expect/expect ] ; then \ + echo $${rootme}/../../expect/expect ; \ + else echo expect ; fi` + +BLUEGNU = ` \ + if [ -f ${srcdir}/../bluegnu ] ; then \ + echo ${srcdir}/../bluegnu ; \ + else echo bluegnu ; fi` + + +all: + +check: site.exp all + rootme=`pwd`; export rootme; \ + srcdir=${srcdir} ; export srcdir ; \ + EXPECT=${EXPECT} ; export EXPECT ; \ + if [ -f $${rootme}/../../expect/expect ] ; then \ + TCL_LIBRARY=`echo @TCLHDIR@ | sed -e 's/-I//' -e 's/generic/library/'` ; \ + export TCL_LIBRARY ; fi ; \ + ${BLUEGNU} ${BLUEGNUFLAGS} BLUEGNU=${BLUEGNU} --tool bluegnu --srcdir ${srcdir} + +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 tool bluegnu" >> ./tmp0 + @echo "set srcdir ${srcdir}" >> ./tmp0 + @echo "set objdir `pwd`" >> ./tmp0 + @echo "set host_triplet ${host}" >> ./tmp0 + @echo "set tmpdir `pwd`/tmpdir" >> ./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? + +clean mostlyclean: + -rm -f \#* *~ core *.o a.out xgdb *.x + -rm -f [Ee]rrs tags mklog ${OBJS} ${PROG} x.* xXx.* + +distclean maintainer-clean realclean: clean + -rm -f Makefile + -rm -f config.status config.log config.cache + -rm -f calc.h calc.log calc.plog calc.psum confdefs.h + -rm -f calc.sum site.exp + -rm -rf tmpdir + +Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) config.status + @echo "Rebuilding the Makefile..." + $(SHELL) ./config.status + +configure: $(srcdir)/configure.in $(srcdir)/Makefile.in $(srcdir)/../aclocal.m4 + @echo "Rebuilding configure..." + @cd ${srcdir} ;\ + autoconf --localdir=${srcdir}/.. + +config.status: + @echo "Rebuilding config.status..." + $(SHELL) ./config.status --recheck diff --git a/contrib/bluegnu2.0.3/testsuite/T/env.exp b/contrib/bluegnu2.0.3/testsuite/T/env.exp new file mode 100644 index 0000000..ce48f79 --- /dev/null +++ b/contrib/bluegnu2.0.3/testsuite/T/env.exp @@ -0,0 +1,12 @@ + +uplevel #0 { + foreach var [lsort [info globals]] { + if {[array exists $var]} { + foreach index [lsort [array names $var]] { + puts "${var}($index)=[set ${var}($index)]" + } + } else { + puts "$var=[set $var]" + } + } +} diff --git a/contrib/bluegnu2.0.3/testsuite/T/env.iexp b/contrib/bluegnu2.0.3/testsuite/T/env.iexp new file mode 100644 index 0000000..ca29e5f --- /dev/null +++ b/contrib/bluegnu2.0.3/testsuite/T/env.iexp @@ -0,0 +1,48 @@ + +puts "======= Environment (Start) =======" + +foreach item [lsort [array names env]] { + if [catch {puts " env($item)=$env($item)"} szErrMsg] { + puts "******* >> msg : $szErrMsg" + puts "******* >> errorInfo: [uplevel #0 set errorInfo]" + puts "******* >> errorCode: [uplevel #0 set errorCode]" + } +} + +foreach info [list {info locals} \ + {info globals} {uplevel #0 info globals} \ + {info vars}] { + puts "=== Command: $info" + foreach item [lsort [eval $info]] { + if [catch {puts " $item=>[eval set $item]<"} szErrMsg] { + if [regexp "variable is array" $szErrMsg] { + foreach elem [lsort [array names $item]] { + puts " ${item}($elem)=>[set ${item}($elem)]<" + } + } else { + puts "******* >> msg : $szErrMsg" + puts "******* >> errorInfo: [uplevel #0 set errorInfo]" + puts "******* >> errorCode: [uplevel #0 set errorCode]" + } + } + } +} + +foreach info [list {namespace all} \ + {namespace children} {namespace parent} \ + classes commands context level library locals \ + objects patchlevel procs script tclversion] { + puts "=== info $info" + foreach item [lsort [eval info $info]] { + puts " $item" + } +} + +puts "argv: [set argv]" +puts "szTestName: [set szTestName]" +catch {puts "lTestName : $lTestName"} +$szTestName pass +puts [$szTestName <<] + +#runtest ::E0 env.iexp +puts "======= Environment (End) =======" diff --git a/contrib/bluegnu2.0.3/testsuite/T/foo.exp b/contrib/bluegnu2.0.3/testsuite/T/foo.exp new file mode 100644 index 0000000..c5f9770 --- /dev/null +++ b/contrib/bluegnu2.0.3/testsuite/T/foo.exp @@ -0,0 +1,5 @@ +appendQueue env.iexp +appendQueue ../tools/env.exp +appendQueue env.iexp +appendQueue ../tools/env.exp +appendQueue ../tools/foo.exp diff --git a/contrib/bluegnu2.0.3/testsuite/T/subT/test_002.exp b/contrib/bluegnu2.0.3/testsuite/T/subT/test_002.exp new file mode 100644 index 0000000..a887fc9 --- /dev/null +++ b/contrib/bluegnu2.0.3/testsuite/T/subT/test_002.exp @@ -0,0 +1,20 @@ + +puts "Test test_002.exp: level [info level]" +puts "szTestName: [set szTestName]" +puts "lTestName : $lTestName" + +namespace ::Common { + if [info exists i] { + if {[expr $i % 2]} { + puts " Remainder is 1 >$i<" + incr i + return + } else { + puts " Zero remainder >$i<" + incr i + } + puts " === End: $env(SHELL)" + } else { + puts "#### i doesn't exists" + } +} diff --git a/contrib/bluegnu2.0.3/testsuite/T/test_000.exp b/contrib/bluegnu2.0.3/testsuite/T/test_000.exp new file mode 100644 index 0000000..9548c1c --- /dev/null +++ b/contrib/bluegnu2.0.3/testsuite/T/test_000.exp @@ -0,0 +1,8 @@ + +namespace Common { + private variable iCount 0 +} + +verbose "prepeding test_001.exp" +prependQueue test_001.exp +pass "test_000.exp" diff --git a/contrib/bluegnu2.0.3/testsuite/T/test_001.exp b/contrib/bluegnu2.0.3/testsuite/T/test_001.exp new file mode 100644 index 0000000..0ecd02b --- /dev/null +++ b/contrib/bluegnu2.0.3/testsuite/T/test_001.exp @@ -0,0 +1,19 @@ + +verbose "Test test_001.exp: level [info level]" +verbose "Global tools: [uplevel #0 set szCurrentTestDirectory]" + +appendQueue test_003.exp=1 +prependQueue test_003.exp=2 test_003.exp=3 +verbose "Context: [info context]" +runtest test_003.exp=R0 +appendQueue test_003.exp=A0 +prependQueue test_003.exp=A2 test_003.exp=A3 + +namespace Common { + incr iCount + verbose "Counter is $iCount" + if {$iCount < 5} { + prependQueue test_001.exp + } + pass "test_001.exp: iCount - $iCount" +} diff --git a/contrib/bluegnu2.0.3/testsuite/T/test_002.exp b/contrib/bluegnu2.0.3/testsuite/T/test_002.exp new file mode 100644 index 0000000..e1a185a --- /dev/null +++ b/contrib/bluegnu2.0.3/testsuite/T/test_002.exp @@ -0,0 +1,22 @@ + +verbose "Test test_002.exp: level [info level]" +verbose "szTestName: [set szTestName]" +verbose "lTestName : $lTestName" +pass +namespace ::Common { + if [info exists i] { + if {[expr $i % 2]} { + verbose " Remainder is 1 >$i<" + incr i + pass "karel" + return + } else { + verbose " Zero remainder >$i<" + fail "pieter" + incr i + } + verbose " === End: $env(SHELL)" + } else { + verbose "#### i doesn't exists" + } +} diff --git a/contrib/bluegnu2.0.3/testsuite/T/test_003.exp b/contrib/bluegnu2.0.3/testsuite/T/test_003.exp new file mode 100644 index 0000000..32c0481 --- /dev/null +++ b/contrib/bluegnu2.0.3/testsuite/T/test_003.exp @@ -0,0 +1,3 @@ + +verbose "t003.exp == $lArgs" +pass "t003.exp == $lArgs"
\ No newline at end of file diff --git a/contrib/bluegnu2.0.3/testsuite/T/test_004.exp b/contrib/bluegnu2.0.3/testsuite/T/test_004.exp new file mode 100644 index 0000000..6cda091 --- /dev/null +++ b/contrib/bluegnu2.0.3/testsuite/T/test_004.exp @@ -0,0 +1,3 @@ + +puts " in test 4" +pass "test 4"
\ No newline at end of file diff --git a/contrib/bluegnu2.0.3/testsuite/bluegnu.all/clone_output.test b/contrib/bluegnu2.0.3/testsuite/bluegnu.all/clone_output.test new file mode 100644 index 0000000..2b5178f --- /dev/null +++ b/contrib/bluegnu2.0.3/testsuite/bluegnu.all/clone_output.test @@ -0,0 +1,68 @@ +# test clone_output + +set srcdir [lindex $argv 0] +set subdir [lindex $argv 1] +set objdir [lindex $argv 2] + +if [ file exists $objdir/setval.tmp ] { + source $objdir/setval.tmp +} else { + puts "ERROR: $objdir/setval.tmp doesn't exist" +} +if [ file exists $srcdir$subdir/default_procs.tcl ] { + source "$srcdir$subdir/default_procs.tcl" +} else { + puts "ERROR: $srcdir$subdir/default_procs.tcl doesn't exist" +} +if [ file exists $srcdir/../lib/framework.exp] { + source $srcdir/../lib/framework.exp +} else { + puts "ERROR: $srcdir/../lib/framework.exp doesn't exist" +} + +set all_flag 0 +global all_flag +set errno "" + +# stuff that shouldn't print anything without all_flag set +set all_flag 0 +set tests { + { "lib_pat_test" "clone_output" "PASS: Foo" "" "clone_output(pass) without all_flag set" } + { "lib_pat_test" "clone_output" "UNRESOLVED: Foo" "" "clone_output(unresolved) without all_flag set" } + { "lib_pat_test" "clone_output" "UNSUPPORTED: Foo" "" "clone_output(unsupported) without all_flag set" } + { "lib_pat_test" "clone_output" "UNTESTED: Foo" "" "clone_output(untested) without all_flag set" } + { "lib_pat_test" "clone_output" "ERROR: Bar" "ERROR: Bar" "clone_output(error) without all_flag set" } + { "lib_pat_test" "clone_output" "WARNING: Bar" "WARNING: Bar" "clone_output(warning) without all_flag set" } + { "lib_pat_test" "clone_output" "NOTE: Bar" "NOTE: Bar" "clone_output(note) without all_flag set" } +} + +run_tests $tests + +# tests for all_flag set to 1 +set all_flag 1 +set tests { + { "lib_pat_test" "clone_output" "PASS: Foo" "PASS: Foo" "clone_output(pass) with all_flag set" } + { "lib_pat_test" "clone_output" "XFAIL: Foo" "XFAIL: Foo" "clone_output(xfail) with all_flag set" } + { "lib_pat_test" "clone_output" "UNRESOLVED: Foo" "UNRESOLVED: Foo" "clone_output(unresolved) with all_flag set" } + { "lib_pat_test" "clone_output" "UNSUPPORTED: Foo" "UNSUPPORTED: Foo" "clone_output(unsupported) with all_flag set" } + { "lib_pat_test" "clone_output" "UNTESTED: Foo" "UNTESTED: Foo" "clone_output(untested) with all_flag set" } + { "lib_pat_test" "clone_output" "ERROR: Foo" "ERROR: Foo" "clone_output(error) with all_flag set" } + { "lib_pat_test" "clone_output" "WARNING: Foo" "WARNING: Foo" "clone_output(warning) with all_flag set" } + { "lib_pat_test" "clone_output" "NOTE: Foo" "NOTE: Foo" "clone_output(note) with all_flag set" } +} + +run_tests $tests + + + + + + + + + + + + + + diff --git a/contrib/bluegnu2.0.3/testsuite/bluegnu.all/config.test b/contrib/bluegnu2.0.3/testsuite/bluegnu.all/config.test new file mode 100644 index 0000000..3d70572 --- /dev/null +++ b/contrib/bluegnu2.0.3/testsuite/bluegnu.all/config.test @@ -0,0 +1,138 @@ +# test clone_output + +set srcdir [lindex $argv 0] +set subdir [lindex $argv 1] +set objdir [lindex $argv 2] + +if [ file exists $objdir/setval.tmp ] { + source $objdir/setval.tmp +} else { + puts "ERROR: $objdir/setval.tmp doesn't exist" +} +if [ file exists $srcdir$subdir/default_procs.tcl ] { + source "$srcdir$subdir/default_procs.tcl" +} else { + puts "ERROR: $srcdir$subdir/default_procs.tcl doesn't exist" +} +if [ file exists $srcdir/../lib/framework.exp] { + source $srcdir/../lib/framework.exp +} else { + puts "ERROR: $srcdir/../lib/framework.exp doesn't exist" +} + +set all_flag 1 + +set host_triplet i586-unknown-linux +set target_triplet i586-unknown-linux +set target_cpu i586 +set target_os linux +set build_triplet i586-unknown-linux + +# FIXME: should use run_tests here, but due to Tcl's weird scoping rules, I get +# problems. + +# +# Tests for a native configuration +# +if [isbuild $build_triplet] { + puts "PASSED: isbuild, native" +} else { + puts "FAILED: isbuild, native" +} + +if [isbuild $target_cpu-*-$target_os ] { + puts "PASSED: isbuild, native regexp" +} else { + puts "FAILED: isbuild, native regexp" +} + +if [isbuild hppa-ibm-macos ] { + puts "FAILED: isbuild, native bogus config string" +} else { + puts "PASSED: isbuild, native bogus config string" +} + +# ishost tests +if [ishost $host_triplet] { + puts "PASSED: ishost, native" +} else { + puts "FAILED: ishost, native" +} + +if [ishost $target_cpu-*-$target_os] { + puts "PASSED: ishost, native regexp" +} else { + puts "FAILED: ishost, native regexp" +} + +if [ishost hppa-ibm-macos] { + puts "FAILED: ishost, native bogus config string" +} else { + puts "PASSED: ishost, native bogus config string" +} + +# istarget tests +if [istarget $target_triplet] { + puts "PASSED: istarget, native" +} else { + puts "FAILED: istarget, native" +} + +if [istarget $target_cpu-*-$target_os] { + puts "PASSED: istarget, native regexp" +} else { + puts "FAILED: istarget, native regexp" +} + +if [istarget hppa-ibm-macos] { + puts "FAILED: istarget, native bogus config string" +} else { + puts "PASSED: istarget, native bogus config string" +} + +# native tests +if [isnative] { + puts "PASSED: isnative, native" +} else { + puts "FAILED: isnative, native" +} + +if [is3way] { + puts "FAILED: is3way, native" +} else { + puts "PASSED: is3way, native" +} + +# +# Tests for a normal cross configuration +# +set target_triplet m68k-unknown-elf +if [isnative] { + puts "FAILED: isnative, cross" +} else { + puts "PASSED: isnative, cross" +} + +if [is3way] { + puts "FAILED: is3way, cross" +} else { + puts "PASSED: is3way, cross" +} + +# +# Tests for a canadian cross configuration +# +set host_triplet i386-unknown-winnt +if [isnative] { + puts "FAILED: isnative, canadian cross" +} else { + puts "PASSED: isnative, canadian cross" +} + +if [is3way] { + puts "PASSED: is3way, canadian cross" +} else { + puts "FAILED: is3way, canadian cross" +} + + diff --git a/contrib/bluegnu2.0.3/testsuite/bluegnu.all/default_procs.tcl b/contrib/bluegnu2.0.3/testsuite/bluegnu.all/default_procs.tcl new file mode 100644 index 0000000..a0e6f88 --- /dev/null +++ b/contrib/bluegnu2.0.3/testsuite/bluegnu.all/default_procs.tcl @@ -0,0 +1,94 @@ +set sum_file [open .tmp w] +set reboot 0 +set errno "" + +# this tests a proc for a returned pattern +proc lib_pat_test { cmd arg pattern } { + catch "$cmd \"$arg\"" result + puts "CMD(lib_pat_test) was: $cmd \"$arg\"" + puts "RESULT(lib_pat_test) was: \"${result}\" for pattern \"$pattern\"." + if [ regexp -- "with too many" $result ] { + return -1 + } + if [ string match "$pattern" $result ] { + return 1 + } else { + return 0 + } +} + +# this tests a proc for a returned value +proc lib_ret_test { cmd arg val } { + catch "$cmd \"$arg\"" result +# catch "set result [$cmd $arg]" output +# set result "$cmd [eval $arg] + puts "CMD(lib_ret_test) was: $cmd $arg" + puts "RESULT(lib_ret_test) was: $result" +# puts "OUTPUT(lib_ret_test) was: $output" + + if { $result == $val } { + return 1 + } else { + return 0 + } +} + +# +# This runs a standard test for a proc. The list is set up as: +# |test proc|proc being tested|args|pattern|message| +# test proc is something like lib_pat_test or lib_ret_test. +# +proc run_tests { tests } { + foreach i "$tests" { + set result [ [lindex $i 0] "[lindex $i 1]" "[lindex $i 2]" "[lindex $i 3]" ] + switch -- $result { + "-1" { + puts "ERRORED: [lindex $i 4]" + } + "1" { + puts "PASSED: [lindex $i 4]" + } + "0" { + puts "FAILED: [lindex $i 4]" + } + default { + puts "BAD VALUE: [lindex $i 4]" + } + } + } +} + +proc send_log { msg } { + # this is just a stub for testing +} + +proc pass { msg } { + puts "PASSED: $msg" +} + +proc fail { msg } { + puts "FAILED: $msg" +} + +proc perror { msg } { + global errno + puts "ERRORED: $msg" + set errno "$msg" +} + +proc warning { msg } { + global errno + puts "WARNED: $msg" + set errno "$msg" +} + +proc untested { msg } { + puts "NOTTESTED: $msg" +} + +proc unsupported { msg } { + puts "NOTSUPPORTED: $msg" +} +proc verbose { args } { + puts "[lindex $args 0]" +} diff --git a/contrib/bluegnu2.0.3/testsuite/bluegnu.all/libs.exp b/contrib/bluegnu2.0.3/testsuite/bluegnu.all/libs.exp new file mode 100644 index 0000000..77f96b5 --- /dev/null +++ b/contrib/bluegnu2.0.3/testsuite/bluegnu.all/libs.exp @@ -0,0 +1,73 @@ +load_lib libsup.exp + +proc process_test { test } { + global srcdir + global subdir + global objdir + global EXPECT + + verbose "Executing test case $test" + set text "\[- A-Za-z0-9\,\.\;\"\_\:\'\`\(\)\!\#\=\+\?\&\*]*" + + set timeout 150 + + if [file exists $test] { + verbose "Processing test $test" 2 + spawn -open [open "|$EXPECT $test $srcdir $subdir [pwd]" r] + expect { + "No such file or directory" { + perror "$test wouldn't run" 0 + } + -re "\[\r\n\]*NOTSUPPORTED: $text\[\r\n\]*" { + unsupported "[lrange $expect_out(0,string) 1 end]" + exp_continue + } + -re "\[\r\n\]*NOTTESTED: $text\[\r\n\]*" { + untested "[lrange $expect_out(0,string) 1 end]" + exp_continue + } + -re "\[\r\n\]*PASSED: $text\[\r\n\]*" { + pass "[lrange $expect_out(0,string) 1 end]" + exp_continue + } + -re "\[\r\n\]*FAILED: $text\[\r\n\]*" { + fail "[lrange $expect_out(0,string) 1 end]" + exp_continue + } + -re "\[\r\n\]*WARNED: $text\[\r\n\]*" { + verbose "$expect_out(0,string)" 2 + exp_continue + } + -re "\[\r\n\]*ERRORED: $text\[\r\n\]*" { + verbose "$expect_out(0,string)" 2 + exp_continue + } + timeout { + perror "$test timed out" 0 + exp_continue + } + eof { + verbose "All Done" 3 + } + } + } else { + perror "$test doesn't exist" 0 + } +} + +if ![info exists EXPECT] { + set EXPECT [findfile $base_dir/../../expect/expect "$base_dir/../../expect/expect" expect] + verbose "EXPECT defaulting to $EXPECT" 2 +} + +make_defaults_file [pwd]/setval.tmp + +foreach i [glob $srcdir/$subdir/*.test] { + process_test $i +} + + + + + + diff --git a/contrib/bluegnu2.0.3/testsuite/bluegnu.all/options.exp b/contrib/bluegnu2.0.3/testsuite/bluegnu.all/options.exp new file mode 100644 index 0000000..87777fa --- /dev/null +++ b/contrib/bluegnu2.0.3/testsuite/bluegnu.all/options.exp @@ -0,0 +1,91 @@ +# Copyright (C) 1988, 90-92, 1994, 1995 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: +# bug-dejagnu@prep.ai.mit.edu + +# This file was written by Rob Savoye. (rob@welcomehome.org) + +load_lib util-defs.exp + +# move the site.exp file so we have no default to confuse us. +#if [file exists $objdir/site.exp] { +# catch "exec mv -f $objdir/site.exp $objdir/site.ignore" +#} +set fd [open site.exp w] +puts ${fd} "set host_triplet $host_triplet" +puts ${fd} "set srcdir $srcdir/.." +puts ${fd} "set objdir $objdir/.." +puts ${fd} "set tmpdir $objdir/../tmpdir" +close $fd + +# +# Set up the list. +# 1st field is the command line option. +# 2nd field is the pattern to match. +# NOTE - No variable substitutions can be used. +# 3rd field is an optional message to print with PASS/FAIL. +# + + +set tests { + { "" "WARNING: No tool specified" "No arguments" } + { "-v --tool xXx" "Found.*site\..*Loading.*utils\.exp" "Loading library files" } + { "-v --tool xXx" "Expect binary is.*Using.*main test driver" "Loading basic packages" } + { "--F --tool x" "Illegal Argument \"--F\"" "Bad argument" } + { "--tool x" "Couldn't find tool init file" "Bad tool name" } + { "--help" "USAGE:*" "Display help" } + { "-v -v -v" "Verbose level is 3" "Verbose set correctly" } + { "-V" "Expect version is.*Tcl version is.*Framework version is*" "--version" } + { "-v --target m68k-vxworks" "Target is m68k-vxworks" "--target option" } + { "-v --host sparc-sun-sunos4.1.9" "Native configuration is sparc-sun-sunos4.1.9" "--host option" } + { "-v -a" "Print all test output to screen" "--all option" } + { "-v --objdir xXx" "Using test binaries in xXx" "--objdir option" } + { "-v --baud 666" "The baud rate is now 666" "--baud option" } + { "-v --tool xXx" "Testing xXx" "--tool option" } + { "-v --debug" "Expect Debugging is ON" "--debug option" } + { "-v --D0" "Tcl debugger is ON" "--D0 option" } + { "-v --strace 1" "Source Trace level is now 1.* 1 if" "--strace option" } +} + +# Old tests not used anymore +# { "-v --build sparc-sun-sunos4.1.9" "Native configuration is sparc-sun-sunos4.1.9" "--build option" } +# { "-v --srcdir xXx" "Using test sources in xXx" "--srcdir option" } + +foreach i $tests { + if [util_test "$RUNTEST" "[lindex $i 0]" "" "[lindex $i 1]"] { + fail "[lindex $i 2]" + } else { + pass "[lindex $i 2]" + } +} + + +set fd [open site.exp w] +puts ${fd} "set host_triplet $host_triplet" +puts ${fd} "set tool runtest" +puts ${fd} "set srcdir $srcdir" +puts ${fd} "set objdir $objdir" +puts ${fd} "set tmpdir $objdir/tmpdir" +close $fd + +# clean up log files left by the child runtest +if [file exists $objdir/x.sum] { + exec rm -f $objdir/x.* +} +if [file exists $objdir/xXx.sum] { + exec rm -f $objdir/xXx.* +} diff --git a/contrib/bluegnu2.0.3/testsuite/bluegnu.all/remote.test b/contrib/bluegnu2.0.3/testsuite/bluegnu.all/remote.test new file mode 100644 index 0000000..9df5e56 --- /dev/null +++ b/contrib/bluegnu2.0.3/testsuite/bluegnu.all/remote.test @@ -0,0 +1,217 @@ +set srcdir [lindex $argv 0] +set subdir [lindex $argv 1] +set objdir [lindex $argv 2] + +if [ file exists $objdir/setval.tmp ] { + source $objdir/setval.tmp +} else { + puts "ERROR: $objdir/setval.tmp doesn't exist" +} +if [ file exists $srcdir$subdir/default_procs.tcl ] { + source "$srcdir$subdir/default_procs.tcl" +} else { + puts "ERROR: $srcdir$subdir/default_procs.tcl doesn't exist" +} + +set file $srcdir/../lib/remote.exp +if [ file exists $file] { + source $file +} else { + puts "ERROR: $file doesn't exist" +} + +global errno "" + +# +# Create a false target config array +# +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) "s12" +set target_info(idp,serial) "tstty12" +set target_info(idp,netport) "localhost:23" +set target_info(idp,baud) "9600" +# MVME target +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) "s12" +set target_info(mvme,serial) "tstty8" +set target_info(mvme,netport) "localhost:23" +set target_info(mvme,baud) "9600" + +# Test remote open. We try not to use any of the support procs in +# target.exp to for isolation testing. "target" is the name of the +# default array setup by the procs in target.exp. + +set timeout 100 +set errno "" + +# +# Force connection errors +# + +# force an rlogin error +if { [rlogin foobar.barfoo.com] < 0 } { + puts "PASSED: rlogin bogus host" +} else { + puts "FAILED: rlogin bogus" +} + +# force an rsh error +if { [rsh foobar.barfoo.com] < 0 } { + puts "PASSED: rsh bogus host" +} else { + puts "FAILED: rsh bogus" +} + +# force a telnet error +if { [telnet foobar.barfoo.com] < 0 } { + puts "PASSED: telnet bogus host" +} else { + puts "FAILED: telnet bogus" +} + +# +# Connect to localhost +# + +# localhost rlogin test +if { [rlogin localhost] < 0 } { + if [string match "*unencrypted connection" $errno] { + NOTTESTED "rlogin localhost" + } else { + puts "FAILED: rlogin localhost" + } +} else { + puts "PASSED: rlogin localhost" +} +catch "exp_send exit\n" +catch "close -i $spawn_id" +catch "wait -i $spawn_id" + +# localhost rsh test +if { [rsh localhost] < 0 } { + if [string match "*kinit" $errno] { + puts "NOTTESTED: rsh localhost" + } else { + puts "FAILED: rsh localhost" + } +} else { + puts "PASSED: rsh localhost" +} +catch "exp_send exit\n" +catch "close -i $spawn_id" +catch "wait -i $spawn_id" + +# localhost telnet test. In this case it will return +# an error cause we get prompted for a password or login. For +# now this is considered an error, as we usually only +# telnet to a terminal server. +if { [telnet localhost] < 0 } { + if [string match "*password." $errno] { + puts "NOTTESTED: telnet localhost" + } else { + puts "FAILED: telnet localhost" + } +} else { + puts "PASSED: telnet localhost" +} +catch "exp_send exit\n" +catch "close -i $spawn_id" +catch "wait -i $spawn_id" + +# +# Connect to the configured target +# +set target_info(target,netport) $target_info(idp,netport) +set target_info(target,target) localhost +set target_info(target,connect) rlogin +if { [rlogin target] < 0 } { + if [ string match "*kinit" $errno] { + puts "NOTTESTED: rlogin target" + } else { + puts "FAILED: rlogin target" + } +} else { + puts "PASSED: rlogin target" +} +catch "exp_send exit\n" +catch "close -i $spawn_id" +catch "wait -i $spawn_id" + +# test remote_open +if { [rsh target] < 0 } { + if [ string match "*kinit" $errno] { + puts "NOTTESTED: rsh target" + } else { + puts "FAILED: rsh target" + } +} else { + puts "PASSED: rsh target" +} +catch "exp_send exit\n" +catch "close -i $spawn_id" +catch "wait -i $spawn_id" + +# telnet to host +# FIXME: This won't work till we figure out how to telnet and +# not get a password prompt. + +# +# Connect to the configured host +# +set target_info(host,connect) rlogin +set target_info(host,netport) $target_info(idp,netport) +set target_info(host,target) localhost + +# rlogin to host +if { [rlogin host] < 0 } { + if [ string match "*kinit*" $errno] { + puts "NOTTESTED: rlogin host" + } else { + puts "FAILED: rlogin host" + } +} else { + puts "PASSED: rlogin host" +} +catch "exp_send exit\n" +catch "close -i $spawn_id" +catch "wait -i $spawn_id" + +# rsh to host +if { [rsh host] < 0 } { + if [ string match "*kinit*" $errno] { + puts "NOTTESTED: rsh host" + } else { + puts "FAILED: rsh host" + } +} else { + puts "PASSED: rsh host" +} +catch "exp_send exit\n" +catch "close -i $spawn_id" +catch "wait -i $spawn_id" + +# telnet to host +# FIXME: This won't work till we figure out how to telnet and +# not get a password prompt. + +# tip port +# remote_close args +# rcp_download src dest +# tip_download shell_id file +# kermit args +# download args + + + + + + + diff --git a/contrib/bluegnu2.0.3/testsuite/bluegnu.all/stats-sub.exp b/contrib/bluegnu2.0.3/testsuite/bluegnu.all/stats-sub.exp new file mode 100644 index 0000000..966bb75 --- /dev/null +++ b/contrib/bluegnu2.0.3/testsuite/bluegnu.all/stats-sub.exp @@ -0,0 +1,16 @@ +# Subordinate to stats.exp. + +# If not called by stats.exp, quit now. +if { ![info exists STATS_TEST] } { + return +} + +switch $STATS_TEST { + pass { pass "pass test" } + fail { fail "fail test" } + xpass { xpass "xpass test" } + xfail { xfail "xfail test" } + untested { untested "untested test" } + unresolved { unresolved "unresolved test" } + unsupported { unsupported "unsupported test" } +}
\ No newline at end of file diff --git a/contrib/bluegnu2.0.3/testsuite/bluegnu.all/stats.exp b/contrib/bluegnu2.0.3/testsuite/bluegnu.all/stats.exp new file mode 100644 index 0000000..3b30f9d --- /dev/null +++ b/contrib/bluegnu2.0.3/testsuite/bluegnu.all/stats.exp @@ -0,0 +1,49 @@ +# Copyright (C) 1995 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: +# bug-dejagnu@prep.ai.mit.edu + +# This file tests pass/fail/etc. +# The way we do this is to recursively invoke ourselves on a small testsuite +# and analyze the results. + +load_lib util-defs.exp + +if ![file isdirectory $tmpdir] { + catch "exec mkdir $tmpdir" +} + +set tests { + { pass "expected passes\[ \t\]+1\n" } + { fail "unexpected failures\[ \t\]+1\n" } + { xpass "unexpected successes\[ \t\]+1\n" } + { xfail "expected failures\[ \t\]+1\n" } + { untested "untested testcases\[ \t\]+1\n" } + { unresolved "unresolved testcases\[ \t\]+1\n" } + { unsupported "unsupported tests\[ \t\]+1\n" } +} + +foreach t $tests { + if [util_test "$RUNTEST" \ + "--outdir $tmpdir STATS_TEST=[lindex $t 0] stats-sub.exp" \ + "" \ + [lindex $t 1]] { + fail [lindex $t 0] + } else { + pass [lindex $t 0] + } +} diff --git a/contrib/bluegnu2.0.3/testsuite/bluegnu.all/target.test b/contrib/bluegnu2.0.3/testsuite/bluegnu.all/target.test new file mode 100644 index 0000000..8c18980 --- /dev/null +++ b/contrib/bluegnu2.0.3/testsuite/bluegnu.all/target.test @@ -0,0 +1,247 @@ +set srcdir [lindex $argv 0] +set subdir [lindex $argv 1] +set objdir [lindex $argv 2] + +if [ file exists $objdir/setval.tmp ] { + source $objdir/setval.tmp +} else { + puts "ERROR: $objdir/setval.tmp doesn't exist" +} +if [ file exists $srcdir$subdir/default_procs.tcl ] { + source "$srcdir$subdir/default_procs.tcl" +} else { + puts "ERROR: $srcdir$subdir/default_procs.tcl doesn't exist" +} + +set file $srcdir/../lib/target.exp +if [ file exists $file] { + source $file +} else { + puts "ERROR: $file doesn't exist" +} +# we load framework so we can use stuff like is3way +set file $srcdir/../lib/framework.exp +if [ file exists $file] { + source $file +} else { + puts "ERROR: $file doesn't exist" +} +# we load the remote stuff so we can test execute_anywhere +set file $srcdir/../lib/remote.exp +if [ file exists $file] { + source $file +} else { + puts "ERROR: $file doesn't exist" +} + +# +# Create a false target config array +# +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) "s12" +set target_info(idp,serial) "tstty12" +set target_info(idp,netport) "localhost:23" +set target_info(idp,baud) "9600" +# MVME target +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) "s12" +set target_info(mvme,serial) "tstty8" +set target_info(mvme,netport) "localhost:23" +set target_info(mvme,baud) "9600" + +# Test remote open. We try not to use any of the support procs in +# target.exp to for isolation testing. "target" is the name of the +# default array setup by the procs in target.exp. + +set timeout 100 + +# test list_target + +if { [list_targets] == "idp mvme" } { + puts "PASSED: list_targets" +} else { + puts "FAILED: list_targets" +} +push_config target idp +set matches 0 +if { $target_info(target,name) == "idp" } { + incr matches +} +if { $target_info(target,ldflags) == "-Tidp.ld" } { + incr matches +} +if { $target_info(target,config) == "m68k-unknown-aout" } { + incr matches +} +if { $target_info(target,cflags) == "" } { + incr matches +} +if { $target_info(target,connect) == "telnet" } { + incr matches +} +if { $target_info(target,target) == "s12" } { + incr matches +} +if { $target_info(target,serial) == "tstty12" } { + incr matches +} +if { $target_info(target,netport) == "localhost:23" } { + incr matches +} +if { $target_info(target,baud) == "9600" } { + incr matches +} +if { $matches == 9 } { + puts "PASSED: push_config target" +} else { + puts "FAILED: push_config target" +} + +# test pop_config target +pop_config target +set matches 0 +if { $target_info(target,name) == "" } { + incr matches +} +if { $target_info(target,ldflags) == "" } { + incr matches +} +if { $target_info(target,config) == "" } { + incr matches +} +if { $target_info(target,cflags) == "" } { + incr matches +} +if { $target_info(target,connect) == "" } { + incr matches +} +if { $target_info(target,target) == "" } { + incr matches +} +if { $target_info(target,serial) == "" } { + incr matches +} +if { $target_info(target,netport) == "" } { + incr matches +} +if { $target_info(target,baud) == "" } { + incr matches +} +if { $matches == 9 } { + puts "PASSED: pop_config target" +} else { + puts "FAILED: pop_config target" +} + +push_config host idp +set matches 0 +if { $target_info(host,name) == "idp" } { + incr matches +} +if { $target_info(host,ldflags) == "-Tidp.ld" } { + incr matches +} +if { $target_info(host,config) == "m68k-unknown-aout" } { + incr matches +} +if { $target_info(host,cflags) == "" } { + incr matches +} +if { $target_info(host,connect) == "telnet" } { + incr matches +} +if { $target_info(host,target) == "s12" } { + incr matches +} +if { $target_info(host,serial) == "tstty12" } { + incr matches +} +if { $target_info(host,netport) == "localhost:23" } { + incr matches +} +if { $target_info(host,baud) == "9600" } { + incr matches +} +if { $matches == 9 } { + puts "PASSED: push_config target" +} else { + puts "FAILED: push_config target" +} + +# test pop_config host +pop_config host +set matches 0 +if { $target_info(host,name) == "" } { + incr matches +} +if { $target_info(host,ldflags) == "" } { + incr matches +} +if { $target_info(host,config) == "" } { + incr matches +} +if { $target_info(host,cflags) == "" } { + incr matches +} +if { $target_info(host,connect) == "" } { + incr matches +} +if { $target_info(host,target) == "" } { + incr matches +} +if { $target_info(host,serial) == "" } { + incr matches +} +if { $target_info(host,netport) == "" } { + incr matches +} +if { $target_info(host,baud) == "" } { + incr matches +} +if { $matches == 9 } { + puts "PASSED: pop_config host" +} else { + puts "FAILED: pop_config host" +} + +# test execute_anywhere for a native environment +set host_triplet i586-unknown-linux +set target_triplet i586-unknown-linux +set build_triplet i586-unknown-linux +if { [string match "*setval.tmp*" [execute_anywhere "ls"]] } { + puts "PASSED: execute_anywhere, native" +} else { + puts "FAILED: execute_anywhere, native" +} + +# test execute_anywhere for a normal cross +set target_triplet m68k-unknown-coff +if { [string match "*testsuite" [execute_anywhere "pwd"]] } { + puts "PASSED: execute_anywhere, normal cross" +} else { + puts "FAILED: execute_anywhere, normal cross" +} + +# test execute_anywhere for a canadian cross +set build_triplet m68k-test-test +set target_info(host,connect) rlogin +set target_info(host,netport) $target_info(idp,netport) +set target_info(host,target) localhost +if { [string match "*FooBar*" [execute_anywhere "echo FooBar"]] } { + puts "PASSED: execute_anywhere, canadian cross" +} else { + puts "FAILED: execute_anywhere, canadian cross" +} + +# compile arg +# archive arg +# ranlib arg +# link_objects arg diff --git a/contrib/bluegnu2.0.3/testsuite/bluegnu.all/topdir/subdir1/subfile1 b/contrib/bluegnu2.0.3/testsuite/bluegnu.all/topdir/subdir1/subfile1 new file mode 100644 index 0000000..8397fe3 --- /dev/null +++ b/contrib/bluegnu2.0.3/testsuite/bluegnu.all/topdir/subdir1/subfile1 @@ -0,0 +1 @@ +# just so we don't look empty. diff --git a/contrib/bluegnu2.0.3/testsuite/bluegnu.all/topdir/subdir1/subfile2 b/contrib/bluegnu2.0.3/testsuite/bluegnu.all/topdir/subdir1/subfile2 new file mode 100644 index 0000000..7d1d836 --- /dev/null +++ b/contrib/bluegnu2.0.3/testsuite/bluegnu.all/topdir/subdir1/subfile2 @@ -0,0 +1,2 @@ +# just so we don't look empty. + diff --git a/contrib/bluegnu2.0.3/testsuite/bluegnu.all/topdir/subdir1/subsubdir1/subsubfile1 b/contrib/bluegnu2.0.3/testsuite/bluegnu.all/topdir/subdir1/subsubdir1/subsubfile1 new file mode 100644 index 0000000..7d1d836 --- /dev/null +++ b/contrib/bluegnu2.0.3/testsuite/bluegnu.all/topdir/subdir1/subsubdir1/subsubfile1 @@ -0,0 +1,2 @@ +# just so we don't look empty. + diff --git a/contrib/bluegnu2.0.3/testsuite/bluegnu.all/topdir/subdir2/subfile2 b/contrib/bluegnu2.0.3/testsuite/bluegnu.all/topdir/subdir2/subfile2 new file mode 100644 index 0000000..7d1d836 --- /dev/null +++ b/contrib/bluegnu2.0.3/testsuite/bluegnu.all/topdir/subdir2/subfile2 @@ -0,0 +1,2 @@ +# just so we don't look empty. + diff --git a/contrib/bluegnu2.0.3/testsuite/bluegnu.all/utils.test b/contrib/bluegnu2.0.3/testsuite/bluegnu.all/utils.test new file mode 100644 index 0000000..864c797 --- /dev/null +++ b/contrib/bluegnu2.0.3/testsuite/bluegnu.all/utils.test @@ -0,0 +1,118 @@ +set srcdir [lindex $argv 0] +set subdir [lindex $argv 1] +set objdir [lindex $argv 2] + +if [ file exists $objdir/setval.tmp ] { + source $objdir/setval.tmp +} else { + puts "ERROR: $objdir/setval.tmp doesn't exist" +} +if [ file exists $srcdir$subdir/default_procs.tcl ] { + source "$srcdir$subdir/default_procs.tcl" +} else { + puts "ERROR: $srcdir$subdir/default_procs.tcl doesn't exist" +} + +set file $srcdir/../lib/utils.exp +if [ file exists $file] { + source $file +} else { + puts "ERROR: $file doesn't exist" +} + +# +# getdirs tests +# +if [lib_pat_test "getdirs" "${srcdir}/runtest.all" "runtest.all/topdir" ] { + puts "FAILED: getdirs toplevel, no arguments" +} else { + puts "PASSED: getdirs toplevel, no arguments" +} + +if [lib_pat_test "getdirs" "${srcdir}/runtest.all top*" "runtest.all/topdir" ] { + puts "FAILED: getdirs toplevel, one subdir" +} else { + puts "PASSED: getdirs toplevel, one subdir" +} + +if [lib_pat_test "getdirs" "${srcdir}/runtest.all/topdir" "subdir1*subdir2" ] { + puts "FAILED: getdirs toplevel, two subdirs" +} else { + puts "PASSED: getdirs toplevel, two subdirs" +} + +# +# find tests +# +if [string match "*/subdir2/subfile2" "[find ${srcdir}/runtest.all/topdir/subdir2 sub*]"] { + puts "PASSED: find, only one level deep" +} else { + puts "FAILED: find, only one level deep" +} + +#set path ${srcdir}/runtest.all/topdir/subdir1 +#exp_test "find ${path} sub*" "Adding */subdir1/subsubdir1/subsubfile1" "find, two levels deep" + +if [string match "*/subdir1/subsubdir1/subsubfile1" "[find ${srcdir}/runtest.all/topdir/subdir1 sub*]"] { + puts "PASSED: find, two levels deep" +} else { + puts "FAILED: find, two levels deep" +} + +# +# environment varible utility tests +# + +if [info exists env(TESTRUN)] { + unset env(TESTRUN) +} + +# test setenv +setenv TESTRUN FooBar +if [info exists env(TESTRUN)] { + if { $env(TESTRUN) == "FooBar" } { + pass "setenv, set an environment variable" + } else { + fail "setenv, set an environment variable + } +} else { + fail "setenv, set an environment variable" +} +# test getenv +if [info exists env(TESTRUN)] { + if { [getenv TESTRUN] == "FooBar" } { + pass "getenv, get an environment variable" + } else { + fail "getenv, get an environment variable" + } +} else { + untested "getenv, get an environment variable" +} + +# test unsetenv +if [info exists env(TESTRUN)] { + unsetenv TESTRUN + if [info exists env(TESTRUN)] { + fail "unsetenv, unset an environment variable" + } else { + pass "unsetenv, unset an environment variable" + } +} else { + untested "unsetenv, unset an environment variable" +} + +# which file +# grep args +# prune list pattern +# slay name +# absolute path +# psource file +# diff file_1 file_2 + + + + + + + + diff --git a/contrib/bluegnu2.0.3/testsuite/config/default.exp b/contrib/bluegnu2.0.3/testsuite/config/default.exp new file mode 100644 index 0000000..719c21b --- /dev/null +++ b/contrib/bluegnu2.0.3/testsuite/config/default.exp @@ -0,0 +1,79 @@ + Copyright (C) 1988, 90-93, 1995 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: +# bug-dejagnu@prep.ai.mit.edu + +# This file was written by Rob Savoye. (rob@welcomehome.org) + +global RUNTEST +if ![info exists RUNTEST] then { + set RUNTEST [transform runtest] +} + +if ![info exists EXPECT] { + set EXPECT [findfile $base_dir/../../expect/expect "$base_dir/../../expect/expect" expect] + verbose "EXPECT defaulting to $EXPECT" 2 +} + +global RUNTESTFLAGS +if ![info exists RUNTESTFLAGS] then { + set RUNTESTFLAGS "-v -v -a" +} + +# +# runtest_version -- extract and print the version number +# +proc runtest_version { } { + global RUNTEST + + catch {exec $RUNTEST -V} tmp + if [info exists tmp] then { + clone_output "$tmp\n" + } +} + +# +# runtest_load -- loads the program. For runtest, this is just a stub +# +proc runtest_load { arg } { +} + +# +# runtest_exit -- exit the test driver for expect +# +proc runtest_exit { } { + close +} + +# +# runtest_start -- start everything +# +proc runtest_start { } { + global verbose + global spawn_id + global subdir + global srcdir + global objdir + global RUNTEST + global RUNTESTFLAGS + + if {[which $RUNTEST] != 0} then { + perror "Can't find $RUNTEST" + } + +# return [open [concat "$RUNTEST $RUNTESTFLAGS"] r] +} diff --git a/contrib/bluegnu2.0.3/testsuite/configure b/contrib/bluegnu2.0.3/testsuite/configure new file mode 100755 index 0000000..560258e --- /dev/null +++ b/contrib/bluegnu2.0.3/testsuite/configure @@ -0,0 +1,1076 @@ +#! /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. +# +# 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: +ac_help="$ac_help + --with-tclinclude directory where tcl private headers are" + +# 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=Makefile.in + +# 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 + + + +echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then +if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # This must be in double quotes, not single quotes, because CPP may get + # substituted into the Makefile and "${CC-cc}" will confuse make. + CPP="${CC-cc} -E" + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext <<EOF +#line 537 "configure" +#include "confdefs.h" +#include <assert.h> +Syntax Error +EOF +eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext <<EOF +#line 551 "configure" +#include "confdefs.h" +#include <assert.h> +Syntax Error +EOF +eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + rm -rf conftest* + CPP=/lib/cpp +fi +rm -f conftest* +fi +rm -f conftest* + ac_cv_prog_CPP="$CPP" +fi + CPP="$ac_cv_prog_CPP" +else + ac_cv_prog_CPP="$CPP" +fi +echo "$ac_t""$CPP" 1>&6 + +# If we cannot run a trivial program, we must be cross compiling. +echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_c_cross'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + ac_cv_c_cross=yes +else +cat > conftest.$ac_ext <<EOF +#line 585 "configure" +#include "confdefs.h" +main(){return(0);} +EOF +eval $ac_link +if test -s conftest && (./conftest; exit) 2>/dev/null; then + ac_cv_c_cross=no +else + ac_cv_c_cross=yes +fi +fi +rm -fr conftest* +fi + +echo "$ac_t""$ac_cv_c_cross" 1>&6 +cross_compiling=$ac_cv_c_cross + + +# +# 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 +echo $ac_n "checking for Tcl private headers""... $ac_c" 1>&6 +# Check whether --with-tclinclude or --without-tclinclude was given. +if test "${with_tclinclude+set}" = set; then + withval="$with_tclinclude" + with_tclinclude=${withval} +fi + +if eval "test \"`echo '$''{'ac_cv_c_tclh'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +# 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 + { echo "configure: error: ${with_tclinclude} directory doesn't contain private headers" 1>&2; exit 1; } + 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_safe=`echo "tclInt.h" | tr './\055' '___'` +echo $ac_n "checking for tclInt.h""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 675 "configure" +#include "confdefs.h" +#include <tclInt.h> +EOF +eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_cv_c_tclh=installed +else + echo "$ac_t""no" 1>&6 +ac_cv_c_tclh="" +fi + +fi + +fi + +if test x"${ac_cv_c_tclh}" = x ; then + TCLHDIR="# no Tcl private headers found" + { echo "configure: error: Can't find Tcl private headers" 1>&2; exit 1; } +fi +if test x"${ac_cv_c_tclh}" != x ; then + no_tcl="" + if test x"${ac_cv_c_tkh}" = x"installed" ; then + echo "$ac_t""is installed" 1>&6 + TCLHDIR="" + else + echo "$ac_t""found in ${ac_cv_c_tclh}" 1>&6 + # this hack is cause the TCLHDIR won't print if there is a "-I" in it. + TCLHDIR="-I${ac_cv_c_tclh}" + fi +fi + +echo $ac_n "checking Tcl version""... $ac_c" 1>&6 +rm -rf tclmajor tclminor +orig_includes="$CPPFLAGS" + +if test x"${TCLHDIR}" != x ; then + CPPFLAGS="$CPPFLAGS $TCLHDIR" +fi + +if test "$cross_compiling" = yes; then + { echo "configure: error: can't be cross compiled" 1>&2; exit 1; } + +else +cat > conftest.$ac_ext <<EOF +#line 732 "configure" +#include "confdefs.h" + +#include <stdio.h> +#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; +} +EOF +eval $ac_link +if test -s conftest && (./conftest; exit) 2>/dev/null; then + tclmajor=`cat tclmajor` + tclminor=`cat tclminor` + tclversion=$tclmajor.$tclminor + echo "$ac_t""$tclversion" 1>&6 + rm -f tclmajor tclminor + +else + echo "$ac_t""can't happen" 1>&6 + +fi +fi +rm -fr conftest* +CPPFLAGS="${orig_includes}" + + + + + +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. + +subdirs="calc" + + + +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 <<EOF +#! /bin/sh +# Generated automatically by configure. +# Run this file to recreate the current configuration. +# This directory was configured as follows, +# on host `(hostname || uname -n) 2>/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 + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS <<EOF + +# 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%@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%@CPP@%$CPP%g +s%@TCLHDIR@%$TCLHDIR%g +s%@subdirs@%$subdirs%g +s%@host@%$host%g + +CEOF +EOF +cat >> $CONFIG_STATUS <<EOF + +CONFIG_FILES=\${CONFIG_FILES-"Makefile"} +EOF +cat >> $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 + + 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 +" -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 calc; 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 + + 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/testsuite/configure.in b/contrib/bluegnu2.0.3/testsuite/configure.in new file mode 100644 index 0000000..80b25da --- /dev/null +++ b/contrib/bluegnu2.0.3/testsuite/configure.in @@ -0,0 +1,9 @@ +dnl Process this file with autoconf to produce a configure script. +AC_INIT(Makefile.in) + +CY_AC_PATH_TCLH + +AC_CONFIG_SUBDIRS(calc) + +AC_SUBST(host) +AC_OUTPUT(Makefile) diff --git a/contrib/bluegnu2.0.3/testsuite/lib/libsup.exp b/contrib/bluegnu2.0.3/testsuite/lib/libsup.exp new file mode 100644 index 0000000..64ef858 --- /dev/null +++ b/contrib/bluegnu2.0.3/testsuite/lib/libsup.exp @@ -0,0 +1,220 @@ + Copyright (C) 92, 93, 94, 95, 1996 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: +# bug-dejagnu@prep.ai.mit.edu + +# This file was written by Rob Savoye. (rob@welcomehome.org) + +# +# Setup an environment so we can execute library procs without DejaGnu +# + +# +# Create a default environment and start expect. +# +proc make_defaults_file { defs } { + global srcdir + global objdir + global subdir + global build_triplet + global host_triplet + global target_triplet + global target_os + global target_cpu + + # We need to setup default values and a few default procs so we + # can execute library code without DejaGnu + set fd [open $defs w] + puts ${fd} "set tool foobar" + puts ${fd} "set srcdir ${srcdir}" + puts ${fd} "set objdir ${objdir}" + puts ${fd} "set subdir ${subdir}" + puts ${fd} "set build_triplet ${build_triplet}" + puts ${fd} "set host_triplet ${host_triplet}" + puts ${fd} "set target_triplet ${target_triplet}" + puts ${fd} "set target_os ${target_os}" + puts ${fd} "set target_cpu ${target_cpu}" + puts ${fd} "set tool foobar" + puts ${fd} "set testcnt 0" + puts ${fd} "set warncnt 0" + puts ${fd} "set errcnt 0" + puts ${fd} "set passcnt 0" + puts ${fd} "set xpasscnt 0" + puts ${fd} "set failcnt 0" + puts ${fd} "set xfailcnt 0" + puts ${fd} "set prms_id 0" + puts ${fd} "set bug_id 0" + puts ${fd} "set exit_status 0" + puts ${fd} "set untestedcnt 0" + puts ${fd} "set unresolvedcnt 0" + puts ${fd} "set unsupportedcnt 0" + puts ${fd} "set xfail_flag 0" + puts ${fd} "set xfail_prms 0" + puts ${fd} "set mail_logs 0" + puts ${fd} "set multipass_name 0" + catch "close $fd" +} + +proc start_expect { } { + global spawn_id + global base_dir + + # We need to setup default values and a few default procs so we + # can execute library code without DejaGnu + set defaults_file setval.tmp + make_defaults_file $defaults_file + set fd [open ${defaults_file} w] + + # look for expect + if ![info exists EXPECT] { + set EXPECT [findfile $base_dir/../../expect/expect "$base_dir/../../expect/expect" expect] + verbose "EXPECT defaulting to $EXPECT" 2 + } + +# catch close +# catch wait + + # Start expect runing + spawn "$EXPECT" + expect { + -re "expect.*> " { + verbose "Started the child expect shell" 2 + } + timeout { + perror "Timed out starting the child expect shell." + return -1 + } + } + + # Load the defaults file + exp_send "source ${defaults_file}\n" + expect { + "expect*> " { + verbose "Loaded testing defaults file." 2 + return 1 + } + timeout { + perror "Couldn't load the testing defaults file." + return -1 + } + } +} + +# +# Stop the runing expect process +# +proc stop_expect { } { + global spawn_id + + # make expect exit + exp_send "exit\n" + catch "close -i $spawn_id" + catch "wait -i $spawn_id" +} + +# +# Load the library to test +# +proc load_test_lib { lib } { + global spawn_id + exp_send "source ${lib}\n" + expect { + "expect*> " { + verbose "Testing ${lib}" 2 + } + timeout { + perror "Couldn't load the libraries to test" + return -1 + } + } +} + +# +# test a library proc that emits patterns +# +proc exp_test { cmd pattern msg } { + global spawn_id + + exp_send "puts ACK ; $cmd ; puts NAK\r\n" + expect { + "puts ACK*puts NAK" { + verbose "Got command echo" 3 + } + timeout { + warning "Never got command echo" + } + } + + expect { + "ACK" { + exp_continue + } + -re "\r\n1\r\n" { + warning "$msg, 1 was returned" + exp_continue + } + -re "\r\n0\r\n" { + warning "$msg, 0 was returned" + exp_continue + } + "$pattern" { + pass "$msg" + } + timeout { + fail "$msg" + } + } +} + +# test a config proc that only returns a code +# ex... config_test "isbuild $build_triplet" "pass" "fail" "isbuild, native" +# args are: command, true condition, false condition, message to print +proc config_test { cmd true false msg } { + global spawn_id + + set timeout 20 + exp_send "puts ACK ; puts \[$cmd\] ; puts NAK\r\n" + expect { + "puts ACK*$cmd*puts NAK" { + verbose "Got command echo" 3 + } + timeout { + warning "Never got command echo" + } + } + + expect { + -re "Checking pattern*with*\[\r\n\]" { + exp_continue + } + -re "\r\n1\r\n" { + $true "$msg" + } + -re "\r\n0\r\n" { + $false "$msg" + } + timeout { + perror "$msg (timed out)" + } + } +} + + + + + + diff --git a/contrib/bluegnu2.0.3/testsuite/tools/env.exp b/contrib/bluegnu2.0.3/testsuite/tools/env.exp new file mode 100644 index 0000000..ebbe79f --- /dev/null +++ b/contrib/bluegnu2.0.3/testsuite/tools/env.exp @@ -0,0 +1,20 @@ + +puts "======= Environment (Start) =======" + +foreach __item [lsort [list env]] { + if {[string compare $__item "__info"] == 0} continue + if [catch {puts " $__item=>[eval set $__item]<"} szErrMsg] { + if [regexp "variable is array" $szErrMsg] { + foreach __elem [lsort [array names $__item]] { + puts " ${__item}($__elem)=>[set ${__item}($__elem)]<" + } + } else { + puts "******* >> msg : $szErrMsg" + puts "******* >> errorInfo: [uplevel #0 set errorInfo]" + puts "******* >> errorCode: [uplevel #0 set errorCode]" + } + } +} + +pass env.exp +puts "======= Environment (End) =======" |