From patchwork Thu Nov 9 18:00:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Preudhomme X-Patchwork-Id: 836461 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-466440-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="XqhcGJOp"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yXrZV4tYqz9sNr for ; Fri, 10 Nov 2017 05:01:21 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=HttuFMOcL98pnfRDixg50VxSAZb9ETY8ZZ3IOQAAVieIVVByTq tfeyt/IQNQtHa6guFOjw8pHxmgNX0uxlTW5qCJRM7izJdHH9Yzg/pkao/2ZDfa3C EW2LQzlx00uwMEQRLo4DIusG+8R+D5XZrdH/AbrsyuIU9LYp4hc9OkViM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=84wy4DmoG3uPUJ/s5GLxfJWluas=; b=XqhcGJOprHfpfaNXZbrg iEQ4Yfz8VaxCKMY7lI7AIL3TEKAZ8IBT0OIxFTDt9kFHxKJU0ZtYHST1z1bJe+/8 VctYPZ7MU2AzDP2dce6rpJtzojyB6Y2zsATIdFTzf7tdfLDYT1QwrGGK49CwGaNw iUM+idgXjqaDvOWDG+OK9S4= Received: (qmail 47164 invoked by alias); 9 Nov 2017 18:01:11 -0000 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 Received: (qmail 46411 invoked by uid 89); 9 Nov 2017 18:01:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=5329, filename, HX-Envelope-From:sk:thomas., Ran X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 09 Nov 2017 18:01:03 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8A3B314; Thu, 9 Nov 2017 10:01:01 -0800 (PST) Received: from [10.2.206.52] (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E0D333F246; Thu, 9 Nov 2017 10:01:00 -0800 (PST) To: Rainer Orth , Mike Stump , "gcc-patches@gcc.gnu.org" From: Thomas Preudhomme Subject: [PATCH, GCC/testsuite] Fix retrieval of testname Message-ID: <526a4e38-510a-e7d8-b379-23a4f0c328f6@foss.arm.com> Date: Thu, 9 Nov 2017 18:00:59 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 X-IsSubscribed: yes When gcc-dg-runtest is used to run a test the test is run several times with different options. For clarity of the log, the test infrastructure then append the options to the testname. This means that all the code that must deal with the testcase itself (eg. removing the output files after the test has run) needs to remove the option name. There is already a pattern (see below) for this in several place of the testsuite framework but it is also missing in many places. This patch fixes all of these places. The pattern is as follows: set testcase [testname-for-summary] ; The name might include a list of options; extract the file name. set testcase [lindex $testcase 0] ChangeLog entry is as follows: *** gcc/testsuite/ChangeLog *** 2017-11-08 Thomas Preud'homme * lib/scanasm.exp (scan-assembler): Extract filename from testname used in summary. (scan-assembler-not): Likewise. (scan-hidden): Likewise. (scan-not-hidden): Likewise. (scan-stack-usage): Likewise. (scan-stack-usage-not): Likewise. (scan-assembler-times): Likewise. (scan-assembler-dem): Likewise. (scan-assembler-dem-not): Likewise. (object-size): Likewise. (scan-lto-assembler): Likewise. * lib/scandump.exp (scan-dump): Likewise. (scan-dump-times): Likewise. (scan-dump-not): Likewise. (scan-dump-dem): Likewise. (scan-dump-dem-not): Likewise Testing: Ran testsuite on bootstrap aarch64-linux-gnu and x86_64-linux-gnu compiled with C, fortran and ada support without any regression. Is this ok for trunk? Best regards, Thomas diff --git a/gcc/testsuite/lib/scanasm.exp b/gcc/testsuite/lib/scanasm.exp index a66bb28253196410554405facefa8641d1020c1d..33286152f30df959a4bffa81634d0bfe7b898e8f 100644 --- a/gcc/testsuite/lib/scanasm.exp +++ b/gcc/testsuite/lib/scanasm.exp @@ -78,7 +78,9 @@ proc dg-scan { name positive testcase output_file orig_args } { proc scan-assembler { args } { set testcase [testname-for-summary] - set output_file "[file rootname [file tail $testcase]].s" + # The name might include a list of options; extract the file name. + set filename [lindex $testcase 0] + set output_file "[file rootname [file tail $filename]].s" dg-scan "scan-assembler" 1 $testcase $output_file $args } @@ -89,7 +91,9 @@ force_conventional_output_for scan-assembler proc scan-assembler-not { args } { set testcase [testname-for-summary] - set output_file "[file rootname [file tail $testcase]].s" + # The name might include a list of options; extract the file name. + set filename [lindex $testcase 0] + set output_file "[file rootname [file tail $filename]].s" dg-scan "scan-assembler-not" 0 $testcase $output_file $args } @@ -117,7 +121,9 @@ proc hidden-scan-for { symbol } { proc scan-hidden { args } { set testcase [testname-for-summary] - set output_file "[file rootname [file tail $testcase]].s" + # The name might include a list of options; extract the file name. + set filename [lindex $testcase 0] + set output_file "[file rootname [file tail $filename]].s" set symbol [lindex $args 0] @@ -133,7 +139,9 @@ proc scan-hidden { args } { proc scan-not-hidden { args } { set testcase [testname-for-summary] - set output_file "[file rootname [file tail $testcase]].s" + # The name might include a list of options; extract the file name. + set filename [lindex $testcase 0] + set output_file "[file rootname [file tail $filename]].s" set symbol [lindex $args 0] set hidden_scan [hidden-scan-for $symbol] @@ -163,7 +171,9 @@ proc scan-file-not { output_file args } { proc scan-stack-usage { args } { set testcase [testname-for-summary] - set output_file "[file rootname [file tail $testcase]].su" + # The name might include a list of options; extract the file name. + set filename [lindex $testcase 0] + set output_file "[file rootname [file tail $filename]].su" dg-scan "scan-file" 1 $testcase $output_file $args } @@ -173,7 +183,9 @@ proc scan-stack-usage { args } { proc scan-stack-usage-not { args } { set testcase [testname-for-summary] - set output_file "[file rootname [file tail $testcase]].su" + # The name might include a list of options; extract the file name. + set filename [lindex $testcase 0] + set output_file "[file rootname [file tail $filename]].su" dg-scan "scan-file-not" 0 $testcase $output_file $args } @@ -230,12 +242,14 @@ proc scan-assembler-times { args } { } set testcase [testname-for-summary] + # The name might include a list of options; extract the file name. + set filename [lindex $testcase 0] set pattern [lindex $args 0] set times [lindex $args 1] set pp_pattern [make_pattern_printable $pattern] # This must match the rule in gcc-dg.exp. - set output_file "[file rootname [file tail $testcase]].s" + set output_file "[file rootname [file tail $filename]].s" set files [glob -nocomplain $output_file] if { $files == "" } { @@ -292,9 +306,11 @@ proc scan-assembler-dem { args } { } set testcase [testname-for-summary] + # The name might include a list of options; extract the file name. + set filename [lindex $testcase 0] set pattern [lindex $args 0] set pp_pattern [make_pattern_printable $pattern] - set output_file "[file rootname [file tail $testcase]].s" + set output_file "[file rootname [file tail $filename]].s" set files [glob -nocomplain $output_file] if { $files == "" } { @@ -346,9 +362,11 @@ proc scan-assembler-dem-not { args } { } set testcase [testname-for-summary] + # The name might include a list of options; extract the file name. + set filename [lindex $testcase 0] set pattern [lindex $args 0] set pp_pattern [make_pattern_printable $pattern] - set output_file "[file rootname [file tail $testcase]].s" + set output_file "[file rootname [file tail $filename]].s" set files [glob -nocomplain $output_file] if { $files == "" } { @@ -401,6 +419,8 @@ proc object-size { args } { } set testcase [testname-for-summary] + # The name might include a list of options; extract the file name. + set filename [lindex $testcase 0] set what [lindex $args 0] set where [lsearch { text data bss total } $what] if { $where == -1 } { @@ -418,7 +438,7 @@ proc object-size { args } { return } - set output_file "[file rootname [file tail $testcase]].o" + set output_file "[file rootname [file tail $filename]].o" if ![file_on_host exists $output_file] { verbose -log "$testcase: $output_file does not exist" unresolved "$testcase object-size $what $cmp $with" @@ -512,7 +532,9 @@ proc dg-function-on-line { args } { proc scan-lto-assembler { args } { set testcase [testname-for-summary] - set output_file "[file rootname [file tail $testcase]].exe.ltrans0.s" + # The name might include a list of options; extract the file name. + set filename [lindex $testcase 0] + set output_file "[file rootname [file tail $filename]].exe.ltrans0.s" verbose "output_file: $output_file" dg-scan "scan-assembler" 1 $testcase $output_file $args } diff --git a/gcc/testsuite/lib/scandump.exp b/gcc/testsuite/lib/scandump.exp index 4a64ac6e05ddfafb8c27d24e381e6e6dc53afe96..a2425a23c1e79103286250df353dab3e5eea622e 100644 --- a/gcc/testsuite/lib/scandump.exp +++ b/gcc/testsuite/lib/scandump.exp @@ -45,11 +45,13 @@ proc scan-dump { args } { } set testcase [testname-for-summary] + # The name might include a list of options; extract the file name. + set filename [lindex $testcase 0] set printable_pattern [make_pattern_printable [lindex $args 1]] set suf [dump-suffix [lindex $args 2]] set testname "$testcase scan-[lindex $args 0]-dump $suf \"$printable_pattern\"" - set src [file tail [lindex $testcase 0]] + set src [file tail $filename] set output_file "[glob -nocomplain $src.[lindex $args 2]]" if { $output_file == "" } { verbose -log "$testcase: dump file does not exist" @@ -86,11 +88,13 @@ proc scan-dump-times { args } { } set testcase [testname-for-summary] + # The name might include a list of options; extract the file name. + set filename [lindex $testcase 0] set times [lindex $args 2] set suf [dump-suffix [lindex $args 3]] set printable_pattern [make_pattern_printable [lindex $args 1]] set testname "$testcase scan-[lindex $args 0]-dump-times $suf \"$printable_pattern\" [lindex $args 2]" - set src [file tail [lindex $testcase 0]] + set src [file tail $filename] set output_file "[glob -nocomplain $src.[lindex $args 3]]" if { $output_file == "" } { verbose -log "$testcase: dump file does not exist" @@ -128,10 +132,12 @@ proc scan-dump-not { args } { } set testcase [testname-for-summary] + # The name might include a list of options; extract the file name. + set filename [lindex $testcase 0] set printable_pattern [make_pattern_printable [lindex $args 1]] set suf [dump-suffix [lindex $args 2]] set testname "$testcase scan-[lindex $args 0]-dump-not $suf \"$printable_pattern\"" - set src [file tail [lindex $testcase 0]] + set src [file tail $filename] set output_file "[glob -nocomplain $src.[lindex $args 2]]" if { $output_file == "" } { verbose -log "$testcase: dump file does not exist" @@ -181,10 +187,12 @@ proc scan-dump-dem { args } { } set testcase [testname-for-summary] + # The name might include a list of options; extract the file name. + set filename [lindex $testcase 0] set printable_pattern [make_pattern_printable [lindex $args 1]] set suf [dump-suffix [lindex $args 2]] set testname "$testcase scan-[lindex $args 0]-dump-dem $suf \"$printable_pattern\"" - set src [file tail [lindex $testcase 0]] + set src [file tail $filename] set output_file "[glob -nocomplain $src.[lindex $args 2]]" if { $output_file == "" } { verbose -log "$testcase: dump file does not exist" @@ -233,10 +241,12 @@ proc scan-dump-dem-not { args } { } set testcase [testname-for-summary] + # The name might include a list of options; extract the file name. + set filename [lindex $testcase 0] set printable_pattern [make_pattern_printable [lindex $args 1] set suf [dump-suffix [lindex $args 2]] set testname "$testcase scan-[lindex $args 0]-dump-dem-not $suf \"$printable_pattern\"" - set src [file tail [lindex $testcase 0]] + set src [file tail $filename] set output_file "[glob -nocomplain $src.[lindex $args 2]]" if { $output_file == "" } { verbose -log "$testcase: dump file does not exist"