From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4950 invoked by alias); 19 Apr 2011 18:03:50 -0000 Received: (qmail 4932 invoked by uid 22791); 19 Apr 2011 18:03:47 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 19 Apr 2011 18:03:33 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 16415392; Tue, 19 Apr 2011 20:03:32 +0200 (CEST) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id cTa90f5SbSDB; Tue, 19 Apr 2011 20:03:27 +0200 (CEST) Received: from manam.CeBiTec.Uni-Bielefeld.DE (manam.CeBiTec.Uni-Bielefeld.DE [129.70.161.120]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id DCC3B390; Tue, 19 Apr 2011 20:03:26 +0200 (CEST) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.4+Sun/8.14.4/Submit) id p3JI3Qqg003921; Tue, 19 Apr 2011 20:03:26 +0200 (MEST) From: Rainer Orth To: Ralf Wildenhues Cc: gcc-patches@gcc.gnu.org, Ian Lance Taylor Subject: Re: [build] Support multilib testing in libgo References: <20110410074602.GD28526@gmx.de> Date: Tue, 19 Apr 2011 18:19:00 -0000 In-Reply-To: <20110410074602.GD28526@gmx.de> (Ralf Wildenhues's message of "Sun, 10 Apr 2011 09:46:02 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (usg-unix-v) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-04/txt/msg01563.txt.bz2 Hi Ralf, > * Rainer Orth wrote on Mon, Apr 04, 2011 at 08:19:19PM CEST: >> To avoid this mess, I'm instead setting LD_LIBRARY_PATH in CHECK. While >> this isn't exactly portable (some platforms, especially Darwin and >> HP-UX, use different variables), it's at least more widespread than -R. > > Toplevel configure computes RPATH_ENVVAR for the host, and toplevel > Makefile passes that. If you need it for the target, it should be > easy to repeat those five lines of code somewhere. probably, though this is going to be a mess since you have to do it for all possible multilib variants, cf. gcc/testsuite/lib/target-libpath.exp and PR other/43445. >> + p=`grep -c PASS $${multidir}/libgo.sum.sep`; \ >> + if test "$$p" != "0"; then \ > > I'd use -ne instead of != here and below. Ok. The != test was there before, but I've updated my patch. >> + echo `echo $(GOC) | sed -e 's/ .*//'` `$(GOC) -v 2>&1 | grep " version" | sed -n -e 's/.* \(version.*$$\)/\1/p'` >> libgo.sum; \ > > This line: > echo `echo $(GOC) | sed -e 's/ .*//'` ... > > is equivalent to: > echo $(GOC) ... > > as the shell squashes unquoted multiple adjacent white space. Unfortunately, it's not: GOC contains not only the compiler command, but a whole bunch of -B etc. options that need to be stripped. OTOH, one might argue that the version info only belongs with the compiler tests in gcc/testsuite. So for, none of the runtime libraries emit version info in they .sum files, and many won't even have a separate version. That said, I noticed another problem with the patch: for non-multilibbed targets, it produced two separate summary lines, which is wrong and doesn't match what DejaGnu does. Here's the updated patch. It also omits $GOCFLAGS because I noticed that it is both unnecessary (the multilib flags that prompted me to include it are already included in $GOC) and harmful: a couple of testcases start failing when they are compiled with -g -O2 instead of without optimization, cf. e.g. PR go/48122. Rainer 2011-02-13 Rainer Orth * Makefile.am (CHECK): Remove -Wl,-R from $GC. Add LD_LIBRARY_PATH. (check): Depend on check-multi, check-tail. (check-recursive): Depend on check-head. (check-am): Move header, footer generation ... (check-head, check-tail): ... here. New targets. (check-multi): New target. (MOSTLYCLEAN_FILES): Replace libgo.tail by libgo.head, add libgo.sum.sep, libgo.log.sep. * Makefile.in: Regenerate. diff --git a/libgo/Makefile.am b/libgo/Makefile.am --- a/libgo/Makefile.am +++ b/libgo/Makefile.am @@ -1544,12 +1544,15 @@ GOTESTFLAGS = # Check a package. CHECK = \ - GC="$(GOC) -L `${PWD_COMMAND}` -L `${PWD_COMMAND}`/.libs -Wl,-R,`${PWD_COMMAND}`/.libs"; \ + GC="$(GOC) -L `${PWD_COMMAND}` -L `${PWD_COMMAND}`/.libs"; \ export GC; \ RUNTESTFLAGS="$(RUNTESTFLAGS)"; \ export RUNTESTFLAGS; \ MAKE="$(MAKE)"; \ export MAKE; \ + libgcc=`${GOC} -print-libgcc-file-name`; \ + LD_LIBRARY_PATH="`${PWD_COMMAND}`/.libs:`dirname $${libgcc}`:${LD_LIBRARY_PATH}"; \ + export LD_LIBRARY_PATH; \ rm -f $@-testsum $@-testlog; \ prefix=`if test "$(@D)" = "regexp"; then echo regexp-test; else dirname $(@D); fi`; \ test "$${prefix}" != "." || prefix="$(@D)"; \ @@ -3065,27 +3068,84 @@ TEST_PACKAGES = \ testing/quick/check \ testing/script/check +check: check-tail +check-recursive: check-head + +check-head: + @echo "Test Run By $${USER} on `date`" > libgo.head + @echo "Native configuration is $(host_triplet)" >> libgo.head + @echo >> libgo.head + @echo " === libgo tests ===" >> libgo.head + @echo >> libgo.head + +check-tail: check-recursive check-multi + @lib=`${PWD_COMMAND} | sed -e 's,^.*/\([^/][^/]*\)$$,\1,'`; \ + for dir in . $(MULTIDIRS); do \ + mv ../$${dir}/$${lib}/libgo.sum ../$${dir}/$${lib}/libgo.sum.sep; \ + mv ../$${dir}/$${lib}/libgo.log ../$${dir}/$${lib}/libgo.log.sep; \ + done; \ + mv libgo.head libgo.sum; \ + cp libgo.sum libgo.log; \ + echo "Schedule of variations:" >> libgo.sum; \ + for dir in . $(MULTIDIRS); do \ + multidir=../$${dir}/$${lib}; \ + multivar=`cat $${multidir}/libgo.var`; \ + echo " $${multivar}" >> libgo.sum; \ + done; \ + echo >> libgo.sum; \ + pass=0; fail=0; untested=0; \ + for dir in . $(MULTIDIRS); do \ + multidir=../$${dir}/$${lib}; \ + multivar=`cat $${multidir}/libgo.var`; \ + echo "Running target $${multivar}" >> libgo.sum; \ + echo "Running $(srcdir)/libgo.exp ..." >> libgo.sum; \ + cat $${multidir}/libgo.sum.sep >> libgo.sum; \ + cat $${multidir}/libgo.log.sep >> libgo.log; \ + if test -n "${MULTIDIRS}"; then \ + echo " === libgo Summary for $${multivar} ===" >> libgo.sum; \ + echo >> libgo.sum; \ + fi; \ + p=`grep -c PASS $${multidir}/libgo.sum.sep`; \ + pass=`expr $$pass + $$p`; \ + if test "$$p" -ne "0" && test -n "${MULTIDIRS}"; then \ + echo "# of expected passes $$p" >> libgo.sum; \ + fi; \ + p=`grep -c FAIL $${multidir}/libgo.sum.sep`; \ + fail=`expr $$fail + $$p`; \ + if test "$$p" -ne "0" && test -n "${MULTIDIRS}"; then \ + echo "# of unexpected failures $$p" >> libgo.sum; \ + fi; \ + p=`grep -c UNTESTED $${multidir}/libgo.sum.sep`; \ + untested=`expr $$untested + $$p`; \ + if test "$$p" -ne "0" && test -n "${MULTIDIRS}"; then \ + echo "# of untested testcases $$p" >> libgo.sum; \ + fi; \ + done; \ + echo >> libgo.sum; \ + echo " === libgo Summary ===" >> libgo.sum; \ + echo >> libgo.sum; \ + if test "$$pass" -ne "0"; then \ + echo "# of expected passes $$pass" >> libgo.sum; \ + fi; \ + if test "$$fail" -ne "0"; then \ + echo "# of unexpected failures $$fail" >> libgo.sum; \ + fi; \ + if test "$$untested" -ne "0"; then \ + echo "# of untested testcases $$untested" >> libgo.sum; \ + fi; \ + echo `echo $(GOC) | sed -e 's/ .*//'` `$(GOC) -v 2>&1 | grep " version" | sed -n -e 's/.* \(version.*$$\)/\1/p'` >> libgo.sum; \ + echo >> libgo.log; \ + echo "runtest completed at `date`" >> libgo.log + check-am: @rm -f libgo.sum libgo.log libgo.tail - @echo "Test Run By $${USER} on `date`" > libgo.sum - @echo "Native configuration is $(host_triplet)" >> libgo.sum - @echo >> libgo.sum - @echo " === libgo tests ===" >> libgo.sum - @echo >> libgo.sum - @echo "Schedule of variations:" >> libgo.sum - @echo " unix" >> libgo.sum - @echo >> libgo.sum - @echo "Running target unix" >> libgo.sum - @echo "Running $(srcdir)/libgo.exp ..." >> libgo.sum - @cp libgo.sum libgo.log - @echo > libgo.tail - @echo " === libgo summary ===" >> libgo.tail - @echo >> libgo.tail + @multivar="unix"; \ + [ -z "$(MULTIFLAGS)" ] || multivar="$${multivar}/$(MULTIFLAGS)"; \ + echo "$${multivar}" > libgo.var @for f in $(TEST_PACKAGES); do \ rm -f $$f-testsum $$f-testlog; \ done - @$(MAKE) -k $(TEST_PACKAGES); \ - status=$$?; \ + -@$(MAKE) -k $(TEST_PACKAGES) for f in $(TEST_PACKAGES); do \ if test -f $$f-testsum; then \ cat $$f-testsum >> libgo.sum; \ @@ -3093,27 +3153,12 @@ check-am: if test -f $$f-testlog; then \ cat $$f-testlog >> libgo.log; \ fi; \ - done; \ - p=`grep -c PASS libgo.sum`; \ - if test "$$p" != "0"; then \ - echo "# of expected passes $$p" >> libgo.tail; \ - fi; \ - p=`grep -c FAIL libgo.sum`; \ - if test "$$p" != "0"; then \ - echo "# of unexpected failures $$p" >> libgo.tail; \ - fi; \ - p=`grep -c UNTESTED libgo.sum`; \ - if test "$$p" != "0"; then \ - echo "# of untested testcases $$p" >> libgo.tail; \ - fi; \ - cat libgo.tail >> libgo.sum; \ - cat libgo.tail >> libgo.log; \ - echo `echo $(GOC) | sed -e 's/ .*//'` `$(GOC) -v 2>&1 | grep " version" | sed -n -e 's/.* \(version.*$$\)/\1/p'` >> libgo.sum; \ - echo >> libgo.log; \ - echo "runtest completed at `date`" >> libgo.log; \ - exit $$status - -MOSTLYCLEAN_FILES = libgo.tail + done + +check-multi: + $(MULTIDO) $(AM_MAKEFLAGS) DO=check-am multi-do # $(MAKE) + +MOSTLYCLEAN_FILES = libgo.head libgo.sum.sep libgo.log.sep mostlyclean-local: find . -name '*.lo' -print | xargs $(LIBTOOL) --mode=clean rm -f -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University