summaryrefslogtreecommitdiff
path: root/libgo/testsuite
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2011-01-12 21:56:10 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2011-01-12 21:56:10 +0000
commit86d013a7f03bc499116c7e1ab4e676aa2cbae669 (patch)
treeff54b74fedda94c9c95e54e96328b68548d9f190 /libgo/testsuite
parenta49b692a27b8e388bbbf7ea6e0f883505b9b65ff (diff)
Make using DejaGNU work for libgo testing on a native system.
From-SVN: r168729
Diffstat (limited to 'libgo/testsuite')
-rwxr-xr-xlibgo/testsuite/gotest22
-rw-r--r--libgo/testsuite/lib/libgo.exp2
-rw-r--r--libgo/testsuite/libgo.testmain/testmain.exp12
3 files changed, 24 insertions, 12 deletions
diff --git a/libgo/testsuite/gotest b/libgo/testsuite/gotest
index 13211d0e34c..e8c0847a801 100755
--- a/libgo/testsuite/gotest
+++ b/libgo/testsuite/gotest
@@ -314,16 +314,26 @@ xno)
./a.out "$@"
;;
xyes)
- # This is the only file which is optionally made.
- # All others are overwritten on copying/building,
- # but this may remain and cause conflicts if not
- # deleted.
- rm -rf ../testsuite/_xtest_.o
- cp *.o _testmain.go ../testsuite
+ rm -rf ../testsuite/*.o
+ files=`echo *`
+ for f in $files; do
+ if test "$f" = "_obj" || test "$f" = "_test"; then
+ continue
+ fi
+ rm -rf ../testsuite/$f
+ if test -f $f; then
+ cp $f ../testsuite/
+ else
+ ln -s ../$DIR/$f ../testsuite/
+ fi
+ done
cd ../testsuite
+ rm -rf _obj _test
+ mkdir _obj _test
$MAKE check RUNTESTFLAGS="$RUNTESTFLAGS GOTEST_TMPDIR=$DIR"
# Useful when using make check-target-libgo
cat libgo.log >> libgo-all.log
cat libgo.sum >> libgo-all.sum
+ rm -rf $files
;;
esac
diff --git a/libgo/testsuite/lib/libgo.exp b/libgo/testsuite/lib/libgo.exp
index e4be3422018..29764d92446 100644
--- a/libgo/testsuite/lib/libgo.exp
+++ b/libgo/testsuite/lib/libgo.exp
@@ -18,7 +18,7 @@ set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
if {$gccdir != ""} {
set gccdir [file dirname $gccdir]
}
-set GO_UNDER_TEST "$gccdir/gccgo -B$gccdir/"
+set GOC_UNDER_TEST "$gccdir/gccgo -B$gccdir/"
set TESTING_IN_BUILD_TREE 1
proc go_maybe_build_wrapper { args } {
diff --git a/libgo/testsuite/libgo.testmain/testmain.exp b/libgo/testsuite/libgo.testmain/testmain.exp
index 318ad499d72..efdd28d9162 100644
--- a/libgo/testsuite/libgo.testmain/testmain.exp
+++ b/libgo/testsuite/libgo.testmain/testmain.exp
@@ -17,7 +17,6 @@
load_lib libgo.exp
lappend options "additional_flags=-I. -w -g"
-lappend ld_options "ldflags=-lgotesting"
if [istarget "*-*-rtems*"] {
global options
@@ -44,9 +43,9 @@ if [istarget "*-*-rtems*"] {
}
set object_files [glob -nocomplain "*.o"]
-regsub $gluefile $object_files "" object_files
-
-lappend options $ld_options
+if [info exists gluefile] {
+ regsub $gluefile $object_files "" object_files
+}
set comp_output [go_target_compile "$object_files _testmain.go" \
"./a.exe" "executable" $options]
@@ -55,4 +54,7 @@ if ![ string match "" $comp_output ] {
exit 1
}
-libgo_load "./a.exe" "" ""
+set result [libgo_load "./a.exe" "" ""]
+
+set status [lindex $result 0]
+$status go