From patchwork Fri Mar 2 20:41:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diego Novillo X-Patchwork-Id: 144341 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 DC312B6ED0 for ; Sat, 3 Mar 2012 07:42:02 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1331325724; h=Comment: DomainKey-Signature:Received:Received:Received:Received: Received-SPF:Received:Received:MIME-Version:Received:Received: Received:Received:To:Subject:Message-Id:Date:From:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=C8VG6IMmQfVqslIlu3LY0BNMi+s=; b=c3mJTJRj82i9Lm51dk3gXTEOHa+iPDRKVl0WyZIX4y4gaOK+keRNKKDbCSk3AR O2q5bjinqHbPl8b2qiJsr+SB3tksUYg9FSx2hwxWUXQKn95NM+BGe3/aES4iMzWE UfWPtiodm/z1tRMy+GGcXXDZGTSB6gVmgUb23bEMQkcb8= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received-SPF:Authentication-Results:Received:Received:MIME-Version:Received:Received:Received:Received:To:Subject:Message-Id:Date:From:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=bkf1Ab84E04e9h/Xnz1bgcnzowVJiVMXwCJqayrh6aXijHriGYIwXw3b7X6UYQ uy3h6HOLstHEDXhwvOBGuL3tjAWZx4OMuRYvub1Ztzt5sn7zhIpCzXERwB5RFyzf 89K3gaoPIZYLqINIe6Lbdvg9N0l7CyI94/xRGZdgX6fI8=; Received: (qmail 13298 invoked by alias); 2 Mar 2012 20:41:58 -0000 Received: (qmail 13284 invoked by uid 22791); 2 Mar 2012 20:41:57 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_LOW, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-ee0-f73.google.com (HELO mail-ee0-f73.google.com) (74.125.83.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 02 Mar 2012 20:41:43 +0000 Received: by eeit10 with SMTP id t10so73125eei.2 for ; Fri, 02 Mar 2012 12:41:42 -0800 (PST) Received-SPF: pass (google.com: domain of dnovillo@google.com designates 10.14.37.16 as permitted sender) client-ip=10.14.37.16; Authentication-Results: mr.google.com; spf=pass (google.com: domain of dnovillo@google.com designates 10.14.37.16 as permitted sender) smtp.mail=dnovillo@google.com; dkim=pass header.i=dnovillo@google.com Received: from mr.google.com ([10.14.37.16]) by 10.14.37.16 with SMTP id x16mr5416613eea.1.1330720902647 (num_hops = 1); Fri, 02 Mar 2012 12:41:42 -0800 (PST) Received: by 10.14.37.16 with SMTP id x16mr4719301eea.1.1330720902628; Fri, 02 Mar 2012 12:41:42 -0800 (PST) MIME-Version: 1.0 Received: by 10.14.37.16 with SMTP id x16mr4719288eea.1.1330720902513; Fri, 02 Mar 2012 12:41:42 -0800 (PST) Received: from hpza10.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id y56si4618160eea.1.2012.03.02.12.41.42 (version=TLSv1/SSLv3 cipher=AES128-SHA); Fri, 02 Mar 2012 12:41:42 -0800 (PST) Received: from tobiano.tor.corp.google.com (tobiano.tor.corp.google.com [172.29.41.6]) by hpza10.eem.corp.google.com (Postfix) with ESMTP id 53F7320004E; Fri, 2 Mar 2012 12:41:42 -0800 (PST) Received: by tobiano.tor.corp.google.com (Postfix, from userid 54752) id 59A5CAE1DC; Fri, 2 Mar 2012 15:41:41 -0500 (EST) To: reply@codereview.appspotmail.com, davidxl@google.com, gcc-patches@gcc.gnu.org Subject: [contrib] Fix match pattern for summary lines in validate_failures.py (issue5728047) Message-Id: <20120302204141.59A5CAE1DC@tobiano.tor.corp.google.com> Date: Fri, 2 Mar 2012 15:41:41 -0500 (EST) From: dnovillo@google.com (Diego Novillo) X-Gm-Message-State: ALoCoQkgjML9IIdXz+LxyVwOKC9JeJtDVwAA4qSTd5iIMjqhczfRCl+817FBnE2FU3ZyZBSQMgTOCs3eCM4wfUiqzfgyzHgQjBbWzETwuo5IK2csZb7gK/Fziuw/LOy4rXFH1KA4Lhu4Fsw18njR+mWKWotM93ZtXAjWuQNoJuQ3bAHdhkBzJOQ= 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 fixes an edge case in parsing summary lines. Some times, the description field is missing (e.g., 'FAIL: libstdc++/abi_check'), so the space that the pattern was looking for does not exist. I've changed it to match any whitespace, which includes '\n'. I also made it print the line that it fails to parse, in case there are other problems like this in the future. David, this should fix the failure you were getting in your merge. Let me know if it doesn't. 2012-03-02 Diego Novillo * testsuite-management/validate_failures.py (class TestResult): Fix match pattern for the summary line. If there is a parsing failure, show the line we failed to parse. --- This patch is available for review at http://codereview.appspot.com/5728047 diff --git a/contrib/testsuite-management/validate_failures.py b/contrib/testsuite-management/validate_failures.py index 072de79..7bc5089 100755 --- a/contrib/testsuite-management/validate_failures.py +++ b/contrib/testsuite-management/validate_failures.py @@ -97,10 +97,14 @@ class TestResult(object): self.attrs = '' if '|' in summary_line: (self.attrs, summary_line) = summary_line.split('|', 1) - (self.state, - self.name, - self.description) = re.match(r' *([A-Z]+): ([^ ]+) (.*)', - summary_line).groups() + try: + (self.state, + self.name, + self.description) = re.match(r' *([A-Z]+): (\S+)\s(.*)', + summary_line).groups() + except: + print 'Failed to parse summary line: "%s"' % summary_line + raise self.attrs = self.attrs.strip() self.state = self.state.strip() self.description = self.description.strip()