From patchwork Wed Feb 6 20:22:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diego Novillo X-Patchwork-Id: 218735 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 BD4522C02C9 for ; Thu, 7 Feb 2013 07:23:04 +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=1360786985; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Date:From:To:Subject:Message-ID:MIME-Version: Content-Type:Content-Disposition:User-Agent:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=GQMRNZRSLM7Z0GE0a0RtB51GipY=; b=LL/Ekf358b0ST/WZDc+0X3BbLezClkG8ljE1e9RlhmP9sITv/d6ndeRiTJpQGP CCdFwOcHwBT2+JfDPVC4XPqo2XRXLtkw6xZ3A2MYS3admSf7w9/X7PGG8o8XoCB4 GM3yofGdN+ysd1/mtFeZauRYi3NXicDc8Zyuf2nTte9k0= 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:X-Google-DKIM-Signature:X-Received:Received:Received:Received:Date:From:To:Subject:Message-ID:MIME-Version:Content-Type:Content-Disposition:User-Agent:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=dDr+tMC+HEfarphdnPac1S9T0oxuAuIvTpko/SYxjy8s0EZoQK6yZt/1JYs9Fm epglQfs9ZnOYnR0a1mL1K0csu+YivAGz1c5/PVJaDE3Rt3kuoitFzCinarBdHM6Z i1VdqJetpfvlx3jr8GdISVOmjQPBs6gJAxAhsBJ08ZhtE=; Received: (qmail 459 invoked by alias); 6 Feb 2013 20:22:47 -0000 Received: (qmail 423 invoked by uid 22791); 6 Feb 2013 20:22:44 -0000 X-SWARE-Spam-Status: No, hits=-5.2 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-gh0-f202.google.com (HELO mail-gh0-f202.google.com) (209.85.160.202) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 06 Feb 2013 20:22:38 +0000 Received: by mail-gh0-f202.google.com with SMTP id z10so193933ghb.5 for ; Wed, 06 Feb 2013 12:22:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:date:from:to:subject:message-id:mime-version :content-type:content-disposition:organization:user-agent :x-gm-message-state; bh=G5DfTDILmf7MZu7LXY1Ocw7M1TDms8VqT/dm4i1o8vQ=; b=MOnZwOZOoXZXMpCPNcjp9h1Dv1H93akZw8xvjmFiRBPjUAh+OGHlQmDk3D2IVDBF8n 33napJ9m6TmH+IucXHRi5k0b3SD/3YPFY1z2KLlsYuz3UII47PYI7sSAapyI70dlkBXc hhciByesatN2P1Doh6DHy8OisKMsO/hWY2VDQ2dGbSWVT4VMZ5RKsoQONexpyKsU0kic 43eBVrUbE7Z3j15wScev4kvlEMZfBAUGUllvlhQJBZfrtQpUphUi5AvT9tO23eU7Ov+U kCyVsP/1wywkmVAktrwBDaxmy9u8DVqDAH5s4WJ86GDoqRrCcf02AFkDSW1Wds1kmKrn /MYA== X-Received: by 10.236.154.2 with SMTP id g2mr14077786yhk.13.1360182157853; Wed, 06 Feb 2013 12:22:37 -0800 (PST) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id k11si612072ano.3.2013.02.06.12.22.37 (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Wed, 06 Feb 2013 12:22:37 -0800 (PST) Received: from tobiano.tor.corp.google.com (tobiano.tor.corp.google.com [172.30.222.17]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id 9FA0E31C102 for ; Wed, 6 Feb 2013 12:22:37 -0800 (PST) Received: by tobiano.tor.corp.google.com (Postfix, from userid 54752) id EB6C51604FC; Wed, 6 Feb 2013 15:22:36 -0500 (EST) Date: Wed, 6 Feb 2013 15:22:36 -0500 From: Diego Novillo To: gcc-patches@gcc.gnu.org Subject: [committed] Fix validate_failures.py in standalone testing Message-ID: <20130206202236.GA20130@google.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Gm-Message-State: ALoCoQmJqG9wUvLzWeltmhupCnY8wV2OyZXd2GHY5AKfGy5m6Pg2JSHT5G2voiPgVvu6pywaFNGAbv7oGW8J+B/HO7KL5PEVfcKZZMJ1HNPz2+iUrR9eP/y0+9bJvqN8Fc3sOKAwDE789ZWFElmnG15/LsavduSSF0zLAqbgqJvxuUEN4rsVz7hnwFh3q8Qkq4vCPWT2pLDzg8DSuj0N63JC45MkCn+OxTs+MVEYTiIti2R4AETdcL4= 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 using validate_failures.py with --manifest and --results, we don't need a GCC build directory. This is useful when using the validator outside of the build tree. We were insisting on finding a valid build tree regardless of those options. Tested on x86_64. Committed to trunk. * testsuite-management/validate_failures.py: Update Copyright years. Request contributions not to use Python features newer than 2.4. (GetBuildData): If this is not a build directory, emit an error only if --results or --manifest are missing. diff --git a/contrib/testsuite-management/validate_failures.py b/contrib/testsuite-management/validate_failures.py index 5c80ca3..76f9aab 100755 --- a/contrib/testsuite-management/validate_failures.py +++ b/contrib/testsuite-management/validate_failures.py @@ -2,10 +2,14 @@ # Script to compare testsuite failures against a list of known-to-fail # tests. +# +# NOTE: This script is used in installations that are running Python 2.4. +# Please stick to syntax features available in 2.4 and earlier +# versions. # Contributed by Diego Novillo # -# Copyright (C) 2011, 2012 Free Software Foundation, Inc. +# Copyright (C) 2011-2013 Free Software Foundation, Inc. # # This file is part of GCC. # @@ -78,7 +82,7 @@ _MANIFEST_PATH_PATTERN = '%s/%s/%s.xfail' _OPTIONS = None def Error(msg): - print >>sys.stderr, '\nerror: %s' % msg + print >>sys.stderr, 'error: %s' % msg sys.exit(1) @@ -358,15 +362,24 @@ def GetManifestPath(srcdir, target, user_provided_must_exist): Error('Manifest does not exist: %s' % manifest_path) return manifest_path else: + assert srdir and target return _MANIFEST_PATH_PATTERN % (srcdir, _MANIFEST_SUBDIR, target) def GetBuildData(): - target = GetMakefileValue('%s/Makefile' % _OPTIONS.build_dir, 'target_alias=') srcdir = GetMakefileValue('%s/Makefile' % _OPTIONS.build_dir, 'srcdir =') + target = GetMakefileValue('%s/Makefile' % _OPTIONS.build_dir, 'target_alias=') if not ValidBuildDirectory(_OPTIONS.build_dir, target): - Error('%s is not a valid GCC top level build directory.' % - _OPTIONS.build_dir) + # If we have been given a set of results to use, we may + # not be inside a valid GCC build directory. In that case, + # the user must provide both a manifest file and a set + # of results to check against it. + if not _OPTIONS.results or not _OPTIONS.manifest: + Error('%s is not a valid GCC top level build directory. ' + 'You must use --manifest and --results to do the validation.' % + _OPTIONS.build_dir) + else: + return None, None print 'Source directory: %s' % srcdir print 'Build target: %s' % target return srcdir, target @@ -410,7 +423,7 @@ def PerformComparison(expected, actual, ignore_missing_failures): def CheckExpectedResults(): - (srcdir, target) = GetBuildData() + srcdir, target = GetBuildData() manifest_path = GetManifestPath(srcdir, target, True) print 'Manifest: %s' % manifest_path manifest = GetManifest(manifest_path) @@ -485,7 +498,8 @@ def Main(argv): parser.add_option('--manifest', action='store', type='string', dest='manifest', default=None, help='Name of the manifest file to use (default = ' - 'taken from contrib/testsuite-managment/.xfail)') + 'taken from ' + 'contrib/testsuite-managment/.xfail)') parser.add_option('--produce_manifest', action='store_true', dest='produce_manifest', default=False, help='Produce the manifest for the current '