From patchwork Fri Jun 17 00:26:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janis Johnson X-Patchwork-Id: 100745 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 D58F0B6F7D for ; Fri, 17 Jun 2011 10:24:59 +1000 (EST) Received: (qmail 13175 invoked by alias); 17 Jun 2011 00:24:57 -0000 Received: (qmail 13151 invoked by uid 22791); 17 Jun 2011 00:24:56 -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 mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 17 Jun 2011 00:24:42 +0000 Received: (qmail 29294 invoked from network); 17 Jun 2011 00:24:41 -0000 Received: from unknown (HELO ?192.168.1.5?) (janisjo@127.0.0.2) by mail.codesourcery.com with ESMTPA; 17 Jun 2011 00:24:41 -0000 Message-ID: <4DFA9F25.2030701@codesourcery.com> Date: Thu, 16 Jun 2011 17:26:13 -0700 From: Janis Johnson User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10 MIME-Version: 1.0 To: "Joseph S. Myers" CC: "gcc-patches@gcc.gnu.org" , Mike Stump Subject: Re: [testsuite] dg-final object-size: fail if file does not exist References: <4DFA2FD7.2070706@codesourcery.com> <4DFA7FF9.9060007@codesourcery.com> In-Reply-To: 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 On 06/16/2011 04:18 PM, Joseph S. Myers wrote: > On Thu, 16 Jun 2011, Janis Johnson wrote: > >> Currently there are several possible causes for failure in object-size. >> Some are errors in the test itself, like the wrong number of arguments, >> but some others could be UNRESOLVED instead of ERROR, such as the "size" >> command failing or producing unexpected output. Can the UNRESOLVED line >> include additional information about the reason for the failure, or >> should the reason just be in a message in the log file? > > My view is that reasons should be separately in the log file; there should > be a fixed set of test names, each of which may be PASS, FAIL, UNRESOLVED > etc. in a particular test run. (I know the code reporting ICEs in test > names doesn't conform to this; properly that should have separate "test > for internal compiler error" test names rather than modifying the name of > a failing test if it has an ICE.) This new fix to object-size, used within dg-final, continues to report static test errors as ERROR, but reports problems detected at runtime as UNRESOLVED, writing the reason to the log file. I'm confident that a missing object file should make the test UNRESOLVED, not as sure about problems with the size command on a particular target. With this change the message from object-size is the same for pass/fail/ unresolved. OK for trunk? Janis 2011-06-16 Janis Johnson * lib/scanasm.exp (object-size): Move argument processing earlier to report errors before verifying that the file exists. Report problems detected at runtime as unresolved instead of error and report their reasons to the log file. Index: lib/scanasm.exp =================================================================== --- lib/scanasm.exp (revision 175083) +++ lib/scanasm.exp (working copy) @@ -350,11 +350,35 @@ upvar 2 name testcase set testcase [lindex $testcase 0] + + set what [lindex $args 0] + set where [lsearch { text data bss total } $what] + if { $where == -1 } { + error "object-size: illegal argument: $what" + return + } + set cmp [lindex $args 1] + if { [lsearch { < > <= >= == != } $cmp] == -1 } { + error "object-size: illegal argument: $cmp" + return + } + set with [lindex $args 2] + if ![string is integer $with ] { + error "object-size: illegal argument: $with" + return + } + set output_file "[file rootname [file tail $testcase]].o" + if ![file_on_host exists $output_file] { + verbose -log "$testcase: $output_file does not exist" + unresolved "$testcase object-size $what $cmp $with" + return + } set output [remote_exec host "$size" "$output_file"] set status [lindex $output 0] if { $status != 0 } { - error "object-size: $size failed" + verbose -log "$testcase object-size: $size failed" + unresolved "$testcase object-size $what $cmp $with" return } @@ -363,37 +387,21 @@ set line0 [lindex $lines 0] if ![regexp {^\s*text\s+data\s+bss\s+dec\s+hex\s+filename\s*$} $line0] { - error "object-size: $size did not produce expected first line: $line0" + verbose -log "$testcase object-size: $size did not produce expected first line: $line0" + unresolved "$testcase object-size $what $cmp $with" return } set line1 [lindex $lines 1] if ![regexp {^\s*\d+\s+\d+\s+\d+\s+\d+\s+[\da-fA-F]+\s+} $line1] { - error "object-size: $size did not produce expected second line: $line1" + verbose -log "$testcase object-size: $size did not produce expected second line: $line1" + unresolved "$testcase object-size $what $cmp $with" return } - set what [lindex $args 0] - set where [lsearch { text data bss total } $what] - if { $where == -1 } { - error "object-size: illegal argument: $what" - return - } set actual [lindex $line1 $where] verbose -log "$what size is $actual" - set cmp [lindex $args 1] - if { [lsearch { < > <= >= == != } $cmp] == -1 } { - error "object-size: illegal argument: $cmp" - return - } - - set with [lindex $args 2] - if ![string is integer $with ] { - error "object-size: illegal argument: $with" - return - } - if [expr $actual $cmp $with] { pass "$testcase object-size $what $cmp $with" } else {