From patchwork Mon Apr 11 12:14:55 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 90590 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 5AC17B6F1E for ; Mon, 11 Apr 2011 22:15:47 +1000 (EST) Received: (qmail 5006 invoked by alias); 11 Apr 2011 12:15:23 -0000 Received: (qmail 4962 invoked by uid 22791); 11 Apr 2011 12:15:16 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, TW_IB, 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; Mon, 11 Apr 2011 12:15:10 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id B40517AC; Mon, 11 Apr 2011 14:15:06 +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 yPPiNafd25FK; Mon, 11 Apr 2011 14:15:02 +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 362877AA; Mon, 11 Apr 2011 14:15:02 +0200 (CEST) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.4+Sun/8.14.4/Submit) id p3BCEtXv025997; Mon, 11 Apr 2011 14:14:55 +0200 (MEST) From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: java-patches@gcc.gnu.org, Mike Stump Subject: [testsuite] Avoid absolute paths in .sum files (PR testsuite/21164) Date: Mon, 11 Apr 2011 14:14:55 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (usg-unix-v) MIME-Version: 1.0 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 When comparing gcc testsuite results from two (slightly) different source tree with dg-cmp-results.sh, I ran into an old issue: some testsuites log absolute paths for either sources or executables, rendering comparison difficult. The libjava side of this problem was logged as PR libgcj/21164, but the issue also occurs in lto.exp and compat.exp. This patch fixes this. Bootstrapped without regressions on i386-pc-solaris2.11 and comparing gcc.sum, g++.sum and libjava.sum. Will install shortly unless someone objects. Rainer 2011-04-09 Rainer Orth libjava: PR testsuite/21164 * testsuite/lib/libjava.exp: Load dg.exp. * testsuite/libjava.jar/jar.exp (gcj_jar_interpret): Strip srcdir from jarfile. Use result for messages. * testsuite/libjava.loader/loader.exp (gcj_loader_test_one): Pass errname to libjava_invoke, fix testname. gcc: PR testsuite/21164 * lib/compat.exp (compat-execute): Declare unsupported after stripping path from src1. * lib/lto.exp (lto-execute): Likewise. diff --git a/gcc/testsuite/lib/compat.exp b/gcc/testsuite/lib/compat.exp --- a/gcc/testsuite/lib/compat.exp +++ b/gcc/testsuite/lib/compat.exp @@ -1,4 +1,4 @@ -# Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008 +# Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2011 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -260,13 +260,6 @@ proc compat-execute { src1 sid use_alt } set dg-do-what [list ${dg-do-what-default} "" P] set extra_flags_1 [compat-get-options-main $src1] - # Check whether this test is supported for this target. - if { [lindex ${dg-do-what} 1 ] == "N" } { - unsupported "$src1" - verbose "$src1 not supported on this target, skipping it" 3 - return - } - # Set up the names of the other source files. set dir [file dirname $src1] set ext [file extension $src1] @@ -314,10 +307,6 @@ proc compat-execute { src1 sid use_alt } set testcase [string range "$testcase" [string length "$tmpdir/"] end] set testcase "tmpdir-$testcase" } - regsub "_main.*" $testcase "" testcase - # Set up the base name of executable files so they'll be unique. - regsub -all "\[./\]" $testcase "-" execbase - # If we couldn't rip $srcdir out of `src1' then just do the best we can. # The point is to reduce the unnecessary noise in the logs. Don't strip # out too much because different testcases with the same name can confuse @@ -326,6 +315,17 @@ proc compat-execute { src1 sid use_alt } set testcase "[file tail [file dirname $src1]]/[file tail $src1]" } + # Check whether this test is supported for this target. + if { [lindex ${dg-do-what} 1 ] == "N" } { + unsupported "$testcase" + verbose "$testcase not supported on this target, skipping it" 3 + return + } + + regsub "_main.*" $testcase "" testcase + # Set up the base name of executable files so they'll be unique. + regsub -all "\[./\]" $testcase "-" execbase + # Loop through all of the option lists used for this test. set count 0 diff --git a/gcc/testsuite/lib/lto.exp b/gcc/testsuite/lib/lto.exp --- a/gcc/testsuite/lib/lto.exp +++ b/gcc/testsuite/lib/lto.exp @@ -410,13 +410,6 @@ proc lto-execute { src1 sid } { set lto_option_list $LTO_OPTIONS } - # Check whether this test is supported for this target. - if { [lindex ${dg-do-what} 1 ] == "N" } { - unsupported "$src1" - verbose "$src1 not supported on this target, skipping it" 3 - return - } - # Set up the names of the other source files. set dir [file dirname $src1] set base [file rootname $src1] @@ -470,11 +463,6 @@ proc lto-execute { src1 sid } { set testcase [string range "$testcase" [string length "$tmpdir/"] end] set testcase "tmpdir-$testcase" } - regsub "_0.*" $testcase "" testcase - - # Set up the base name of executable files so they'll be unique. - regsub -all "\[./\]" $testcase "-" execbase - # If we couldn't rip $srcdir out of `src1' then just do the best we can. # The point is to reduce the unnecessary noise in the logs. Don't strip # out too much because different testcases with the same name can confuse @@ -483,6 +471,18 @@ proc lto-execute { src1 sid } { set testcase "[file tail [file dirname $src1]]/[file tail $src1]" } + # Check whether this test is supported for this target. + if { [lindex ${dg-do-what} 1 ] == "N" } { + unsupported "$testcase" + verbose "$testcase not supported on this target, skipping it" 3 + return + } + + regsub "_0.*" $testcase "" testcase + + # Set up the base name of executable files so they'll be unique. + regsub -all "\[./\]" $testcase "-" execbase + # Loop through all of the option lists used for this test. set count 0 foreach option $lto_option_list { diff --git a/libjava/testsuite/lib/libjava.exp b/libjava/testsuite/lib/libjava.exp --- a/libjava/testsuite/lib/libjava.exp +++ b/libjava/testsuite/lib/libjava.exp @@ -1,4 +1,5 @@ -# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006, 2007 Free Software Foundation +# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2011 +# Free Software Foundation proc load_gcc_lib { filename } { global srcdir @@ -6,6 +7,7 @@ proc load_gcc_lib { filename } { } load_lib libgloss.exp +load_lib dg.exp load_gcc_lib target-libpath.exp # GCJ_UNDER_TEST is the compiler under test. diff --git a/libjava/testsuite/libjava.jar/jar.exp b/libjava/testsuite/libjava.jar/jar.exp --- a/libjava/testsuite/libjava.jar/jar.exp +++ b/libjava/testsuite/libjava.jar/jar.exp @@ -20,17 +20,18 @@ proc gcj_jar_interpret {jarfile} { global INTERPRETER srcdir set gij [libjava_find_gij] + set errname [dg-trim-dirname $srcdir $jarfile] # libjava_find_gij will return "" if it couldn't find the # program; in this case we want to skip the test. if {$INTERPRETER != "yes" || $gij == ""} { - untested "$jarfile execution - gij test" - untested "$jarfile output - gij test" + untested "$errname execution - gij test" + untested "$errname output - gij test" return } set opts(_) {} set out [file rootname $jarfile].out - libjava_invoke $jarfile "gij test" opts $gij {} $out \ + libjava_invoke $errname "gij test" opts $gij {} $out \ "" -jar $jarfile } diff --git a/libjava/testsuite/libjava.loader/loader.exp b/libjava/testsuite/libjava.loader/loader.exp --- a/libjava/testsuite/libjava.loader/loader.exp +++ b/libjava/testsuite/libjava.loader/loader.exp @@ -34,7 +34,7 @@ proc gcj_loader_test_one {srcfile} { } pass "$errname compilation from source" - libjava_invoke $executable $executable "" $executable "" $resfile "" + libjava_invoke $errname "source compiled test" "" $executable "" $resfile "" return 1 }