From patchwork Wed Jan 12 21:56:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 78617 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 802CCB6F10 for ; Thu, 13 Jan 2011 08:56:27 +1100 (EST) Received: (qmail 15365 invoked by alias); 12 Jan 2011 21:56:25 -0000 Received: (qmail 15356 invoked by uid 22791); 12 Jan 2011 21:56:24 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_LOW, SPF_HELO_PASS, TW_CB, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 12 Jan 2011 21:56:19 +0000 Received: from kpbe14.cbf.corp.google.com (kpbe14.cbf.corp.google.com [172.25.105.78]) by smtp-out.google.com with ESMTP id p0CLuHAD006987 for ; Wed, 12 Jan 2011 13:56:17 -0800 Received: from pxi11 (pxi11.prod.google.com [10.243.27.11]) by kpbe14.cbf.corp.google.com with ESMTP id p0CLuGbs032316 for ; Wed, 12 Jan 2011 13:56:16 -0800 Received: by pxi11 with SMTP id 11so199360pxi.35 for ; Wed, 12 Jan 2011 13:56:16 -0800 (PST) Received: by 10.142.52.6 with SMTP id z6mr245210wfz.355.1294869376012; Wed, 12 Jan 2011 13:56:16 -0800 (PST) Received: from coign.google.com (dhcp-172-22-121-189.mtv.corp.google.com [172.22.121.189]) by mx.google.com with ESMTPS id o1sm1377209wfl.2.2011.01.12.13.56.14 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 12 Jan 2011 13:56:15 -0800 (PST) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: Go patch committed: Make DejaGNU work for libgo Date: Wed, 12 Jan 2011 13:56:14 -0800 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org This patch, partially due to Rainer Orth, makes DejaGNU work for libgo. It's still not run by default, though. Bootstrapped and ran Go testsuite, both with and without DejaGNU, on x86_64-unknown-linux-gnu. Committed to mainline. Ian diff -r 308cbbace152 libgo/Makefile.am --- a/libgo/Makefile.am Tue Jan 11 22:32:00 2011 -0800 +++ b/libgo/Makefile.am Wed Jan 12 13:52:27 2011 -0800 @@ -1237,12 +1237,16 @@ rm -f $@-log; \ prefix=`if test "$(@D)" = "regexp"; then echo regexp-test; else dirname $(@D); fi`; \ 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 \ - echo "PASS: $(@D)"; \ + if test "$(use_dejagnu)" = "yes"; then \ + $(srcdir)/testsuite/gotest --dejagnu=yes --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --prefix="libgo_$${prefix}" --pkgfiles="$(go_$(subst /,_,$(@D))_files)"; \ else \ - echo "FAIL: $(@D)"; \ - cat $@-log; \ - exit 1; \ + if $(srcdir)/testsuite/gotest --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --prefix="libgo_$${prefix}" --pkgfiles="$(go_$(subst /,_,$(@D))_files)" >>$@-log 2>&1; then \ + echo "PASS: $(@D)"; \ + else \ + echo "FAIL: $(@D)"; \ + cat $@-log; \ + exit 1; \ + fi; \ fi # Build all packages before checking any. diff -r 308cbbace152 libgo/testsuite/gotest --- a/libgo/testsuite/gotest Tue Jan 11 22:32:00 2011 -0800 +++ b/libgo/testsuite/gotest Wed Jan 12 13:52:27 2011 -0800 @@ -314,16 +314,26 @@ ./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 -r 308cbbace152 libgo/testsuite/lib/libgo.exp --- a/libgo/testsuite/lib/libgo.exp Tue Jan 11 22:32:00 2011 -0800 +++ b/libgo/testsuite/lib/libgo.exp Wed Jan 12 13:52:27 2011 -0800 @@ -18,7 +18,7 @@ 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 -r 308cbbace152 libgo/testsuite/libgo.testmain/testmain.exp --- a/libgo/testsuite/libgo.testmain/testmain.exp Tue Jan 11 22:32:00 2011 -0800 +++ b/libgo/testsuite/libgo.testmain/testmain.exp Wed Jan 12 13:52:27 2011 -0800 @@ -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 @@ } 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 @@ exit 1 } -libgo_load "./a.exe" "" "" +set result [libgo_load "./a.exe" "" ""] + +set status [lindex $result 0] +$status go