Commit 86d013a7 by Ian Lance Taylor

Make using DejaGNU work for libgo testing on a native system.

From-SVN: r168729
parent a49b692a
...@@ -1237,12 +1237,16 @@ CHECK = \ ...@@ -1237,12 +1237,16 @@ CHECK = \
rm -f $@-log; \ rm -f $@-log; \
prefix=`if test "$(@D)" = "regexp"; then echo regexp-test; else dirname $(@D); fi`; \ prefix=`if test "$(@D)" = "regexp"; then echo regexp-test; else dirname $(@D); fi`; \
test "$${prefix}" != "." || prefix="$(@D)"; \ test "$${prefix}" != "." || prefix="$(@D)"; \
if $(srcdir)/testsuite/gotest --dejagnu=$(use_dejagnu) --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --prefix="libgo_$${prefix}" --pkgfiles="$(go_$(subst /,_,$(@D))_files)" >>$@-log 2>&1; then \ if test "$(use_dejagnu)" = "yes"; then \
echo "PASS: $(@D)"; \ $(srcdir)/testsuite/gotest --dejagnu=yes --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --prefix="libgo_$${prefix}" --pkgfiles="$(go_$(subst /,_,$(@D))_files)"; \
else \ else \
echo "FAIL: $(@D)"; \ if $(srcdir)/testsuite/gotest --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --prefix="libgo_$${prefix}" --pkgfiles="$(go_$(subst /,_,$(@D))_files)" >>$@-log 2>&1; then \
cat $@-log; \ echo "PASS: $(@D)"; \
exit 1; \ else \
echo "FAIL: $(@D)"; \
cat $@-log; \
exit 1; \
fi; \
fi fi
# Build all packages before checking any. # Build all packages before checking any.
......
...@@ -1583,12 +1583,16 @@ CHECK = \ ...@@ -1583,12 +1583,16 @@ CHECK = \
rm -f $@-log; \ rm -f $@-log; \
prefix=`if test "$(@D)" = "regexp"; then echo regexp-test; else dirname $(@D); fi`; \ prefix=`if test "$(@D)" = "regexp"; then echo regexp-test; else dirname $(@D); fi`; \
test "$${prefix}" != "." || prefix="$(@D)"; \ test "$${prefix}" != "." || prefix="$(@D)"; \
if $(srcdir)/testsuite/gotest --dejagnu=$(use_dejagnu) --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --prefix="libgo_$${prefix}" --pkgfiles="$(go_$(subst /,_,$(@D))_files)" >>$@-log 2>&1; then \ if test "$(use_dejagnu)" = "yes"; then \
echo "PASS: $(@D)"; \ $(srcdir)/testsuite/gotest --dejagnu=yes --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --prefix="libgo_$${prefix}" --pkgfiles="$(go_$(subst /,_,$(@D))_files)"; \
else \ else \
echo "FAIL: $(@D)"; \ if $(srcdir)/testsuite/gotest --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --prefix="libgo_$${prefix}" --pkgfiles="$(go_$(subst /,_,$(@D))_files)" >>$@-log 2>&1; then \
cat $@-log; \ echo "PASS: $(@D)"; \
exit 1; \ else \
echo "FAIL: $(@D)"; \
cat $@-log; \
exit 1; \
fi; \
fi fi
......
...@@ -314,16 +314,26 @@ xno) ...@@ -314,16 +314,26 @@ xno)
./a.out "$@" ./a.out "$@"
;; ;;
xyes) xyes)
# This is the only file which is optionally made. rm -rf ../testsuite/*.o
# All others are overwritten on copying/building, files=`echo *`
# but this may remain and cause conflicts if not for f in $files; do
# deleted. if test "$f" = "_obj" || test "$f" = "_test"; then
rm -rf ../testsuite/_xtest_.o continue
cp *.o _testmain.go ../testsuite fi
rm -rf ../testsuite/$f
if test -f $f; then
cp $f ../testsuite/
else
ln -s ../$DIR/$f ../testsuite/
fi
done
cd ../testsuite cd ../testsuite
rm -rf _obj _test
mkdir _obj _test
$MAKE check RUNTESTFLAGS="$RUNTESTFLAGS GOTEST_TMPDIR=$DIR" $MAKE check RUNTESTFLAGS="$RUNTESTFLAGS GOTEST_TMPDIR=$DIR"
# Useful when using make check-target-libgo # Useful when using make check-target-libgo
cat libgo.log >> libgo-all.log cat libgo.log >> libgo-all.log
cat libgo.sum >> libgo-all.sum cat libgo.sum >> libgo-all.sum
rm -rf $files
;; ;;
esac esac
...@@ -18,7 +18,7 @@ set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a] ...@@ -18,7 +18,7 @@ set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
if {$gccdir != ""} { if {$gccdir != ""} {
set gccdir [file dirname $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 set TESTING_IN_BUILD_TREE 1
proc go_maybe_build_wrapper { args } { proc go_maybe_build_wrapper { args } {
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
load_lib libgo.exp load_lib libgo.exp
lappend options "additional_flags=-I. -w -g" lappend options "additional_flags=-I. -w -g"
lappend ld_options "ldflags=-lgotesting"
if [istarget "*-*-rtems*"] { if [istarget "*-*-rtems*"] {
global options global options
...@@ -44,9 +43,9 @@ if [istarget "*-*-rtems*"] { ...@@ -44,9 +43,9 @@ if [istarget "*-*-rtems*"] {
} }
set object_files [glob -nocomplain "*.o"] set object_files [glob -nocomplain "*.o"]
regsub $gluefile $object_files "" object_files if [info exists gluefile] {
regsub $gluefile $object_files "" object_files
lappend options $ld_options }
set comp_output [go_target_compile "$object_files _testmain.go" \ set comp_output [go_target_compile "$object_files _testmain.go" \
"./a.exe" "executable" $options] "./a.exe" "executable" $options]
...@@ -55,4 +54,7 @@ if ![ string match "" $comp_output ] { ...@@ -55,4 +54,7 @@ if ![ string match "" $comp_output ] {
exit 1 exit 1
} }
libgo_load "./a.exe" "" "" set result [libgo_load "./a.exe" "" ""]
set status [lindex $result 0]
$status go
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment