From patchwork Thu Nov 29 23:12:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Evans X-Patchwork-Id: 202836 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 5F4242C0086 for ; Fri, 30 Nov 2012 10:12:55 +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=1354835576; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:From:MIME-Version:Content-Type: Content-Transfer-Encoding:Message-ID:Date:To:Cc:Subject: In-Reply-To:References:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=uAX9vzlWD8dORDKcfWn0jUWcHzg=; b=lLvcbYY0DdrVfUw +zjDNMCEVzV3kHS3AoH5pFcBlMKLbdnFgxvA1o3gcb5OyUfNOqwrlmEkcmG/C2fK /WRiX6Qw3gGzfwodFV3gTg8JFiaQ6EfZiytnNou2WoNpUeLHwn5609kQ6HawCxc8 bY5S4F2JTpcsMBstcrv3mUwKAxNg= 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:Received:Received:Received:From:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID:Date:To:Cc:Subject:In-Reply-To:References:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=ksM7UkZrxIoO9jxtgx+GDC8bMpiyN5qHxExCNAYwIhcAlVdKKzEvCcdVm4ELxJ BldzUG5vt16CFaiua0jjj5HUa/KHqMNrM4mLUkI0TAvX9PHXEmx0oIx4cN6aE83x giiCAxXIcCBRI1kBw7C5Fzn2I3+5MqHjnirgudnmNy2v0=; Received: (qmail 19046 invoked by alias); 29 Nov 2012 23:12:51 -0000 Received: (qmail 19011 invoked by uid 22791); 29 Nov 2012 23:12:49 -0000 X-SWARE-Spam-Status: No, hits=-5.1 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, KHOP_THREADED, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-ia0-f201.google.com (HELO mail-ia0-f201.google.com) (209.85.210.201) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 29 Nov 2012 23:12:40 +0000 Received: by mail-ia0-f201.google.com with SMTP id z3so3238913iad.2 for ; Thu, 29 Nov 2012 15:12:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:mime-version:content-type:content-transfer-encoding:message-id :date:to:cc:subject:in-reply-to:references:x-mailer :x-gm-message-state; bh=WsJuGbEozEUf2T1foGCE1HjJEnx53+xc438CuFt8sKo=; b=gVoysYeya6gky+uojuLHe0lAlYd26m5eLyis+y/XwnbLi021SCLue46gQNilsid/in 1zheHLIH4nTcygjIe0AGgxAy5sFHEf4ZdkauIasBQrYSUpCWAUkFPt2ip2C4roMBY88s Q4Tgvs5B7l0tMhWH76xClRX+TlfEn4dFnjERDoksIbaVPuPuZXN652IeBfgzvv7E23tR ETyAYX1QizkCnCKxXlaj3Pg+CEfiu8yvOCymww4FFKAWeT6E9186uZbB3P73b7nNu5TS xfcTaUKdnlyNqquDbUtft2UboA+ToKAy62XlZPtTl+vWG82YwtBwFYlLw1+KRQMbOczD P6zQ== Received: by 10.42.165.132 with SMTP id k4mr17711152icy.18.1354230759599; Thu, 29 Nov 2012 15:12:39 -0800 (PST) Received: from wpzn4.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id o7si1030296igl.0.2012.11.29.15.12.39 (version=TLSv1/SSLv3 cipher=AES128-SHA); Thu, 29 Nov 2012 15:12:39 -0800 (PST) Received: from ruffy2.mtv.corp.google.com (ruffy2.mtv.corp.google.com [172.17.128.107]) by wpzn4.hot.corp.google.com (Postfix) with ESMTP id BDF4E82004A; Thu, 29 Nov 2012 15:12:38 -0800 (PST) From: Doug Evans MIME-Version: 1.0 Message-ID: <20663.60390.66132.570663@ruffy2.mtv.corp.google.com> Date: Thu, 29 Nov 2012 15:12:38 -0800 To: Diego Novillo Cc: gcc-patches@gcc.gnu.org Subject: Re: [RFA 7/8] validate_failures.py: New options --manifest_subdir, --manifest_name In-Reply-To: References: X-Gm-Message-State: ALoCoQlWUTsyMuk/A06UW54N6A5DedNhquGmdwxjShGDedViTjGPUFRrWTxwzsev0x8+NzfM8G476YopS9BJg55fFswGv2SoIcndM/lS2+0bmcFEktpCJ9uETY6wu1R28IzJ2adAMMp0k6aGpeXgqPcRTVbIienFGLrhGH0zKd6j/4ZCnDwrU2wj1JS/SmRShskPwtxE/L2vS9byb3VI88us3rrvh/FQgw== 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 Diego Novillo writes: > On Sat, Nov 24, 2012 at 5:58 PM, Doug Evans wrote: > > Hi. > > This seventh patch adds new options --manifest_subdir, --manifest_name. > > Useful when using validate_failures.py with a different tool, instead of gcc. > > > > Ok to check in? > > > > 2012-11-24 Doug Evans > > > > * testsuite-management/validate_failures.py: New options --manifest_subdir, > > --manifest_name. > > OK. This is another baby-steps kinda patch. Instead of adding --manifest_{subdir,name}, this patch just parameterizes the gcc-specific manifest subdir, and provides a utility to compute the manifest path. Ok to check in? 2012-11-29 Doug Evans * testsuite-management/validate_failures.py: Add function GetManifestPath. New global _MANIFEST_SUBDIR. Index: validate_failures.py =================================================================== --- validate_failures.py (revision 193968) +++ validate_failures.py (working copy) @@ -37,7 +37,7 @@ 1- Determine the target built: TARGET 2- Determine the source directory: SRCDIR 3- Look for a failure manifest file in - /contrib/testsuite-management/.xfail + //.xfail 4- Collect all the .sum files from the build tree. 5- Produce a report stating: a- Failures expected in the manifest but not present in the build. @@ -55,11 +55,16 @@ # Handled test results. _VALID_TEST_RESULTS = [ 'FAIL', 'UNRESOLVED', 'XPASS', 'ERROR' ] -# Pattern for naming manifest files. The first argument should be -# the toplevel GCC source directory. The second argument is the -# target triple used during the build. -_MANIFEST_PATH_PATTERN = '%s/contrib/testsuite-management/%s.xfail' +# Subdirectory of srcdir in which to find the manifest file. +_MANIFEST_SUBDIR = 'contrib/testsuite-management' +# Pattern for naming manifest files. +# The first argument should be the toplevel GCC(/GNU tool) source directory. +# The second argument is the manifest subdir. +# The third argument is the manifest target, which defaults to the target +# triplet used during the build. +_MANIFEST_PATH_PATTERN = '%s/%s/%s.xfail' + # The options passed to the program. _OPTIONS = None @@ -284,6 +289,17 @@ return actual_vs_manifest, manifest_vs_actual +def GetManifestPath(srcdir, target, user_provided_must_exist): + """Return the full path to the manifest file.""" + manifest_path = _OPTIONS.manifest + if manifest_path: + if user_provided_must_exist and not os.path.exists(manifest_path): + Error('Manifest does not exist: %s' % manifest_path) + return manifest_path + else: + 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 =') @@ -333,14 +349,8 @@ def CheckExpectedResults(): - if not _OPTIONS.manifest: - (srcdir, target) = GetBuildData() - manifest_path = _MANIFEST_PATH_PATTERN % (srcdir, target) - else: - manifest_path = _OPTIONS.manifest - if not os.path.exists(manifest_path): - Error('Manifest file %s does not exist.' % manifest_path) - + (srcdir, target) = GetBuildData() + manifest_path = GetManifestPath(srcdir, target, True) print 'Manifest: %s' % manifest_path manifest = GetManifest(manifest_path) sum_files = GetSumFiles(_OPTIONS.results, _OPTIONS.build_dir) @@ -355,7 +365,8 @@ def ProduceManifest(): (srcdir, target) = GetBuildData() - manifest_path = _MANIFEST_PATH_PATTERN % (srcdir, target) + manifest_path = GetManifestPath(srcdir, target, False) + print 'Manifest: %s' % manifest_path if os.path.exists(manifest_path) and not _OPTIONS.force: Error('Manifest file %s already exists.\nUse --force to overwrite.' % manifest_path)