From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 86652 invoked by alias); 22 Oct 2015 21:21:31 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 86592 invoked by uid 89); 22 Oct 2015 21:21:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-qg0-f52.google.com Received: from mail-qg0-f52.google.com (HELO mail-qg0-f52.google.com) (209.85.192.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 22 Oct 2015 21:21:29 +0000 Received: by qgbb65 with SMTP id b65so68750201qgb.2 for ; Thu, 22 Oct 2015 14:21:26 -0700 (PDT) X-Received: by 10.140.194.8 with SMTP id p8mr23020684qha.63.1445548886841; Thu, 22 Oct 2015 14:21:26 -0700 (PDT) Received: from [192.168.0.26] (70-59-0-242.hlrn.qwest.net. [70.59.0.242]) by smtp.gmail.com with ESMTPSA id 14sm6104691qhx.10.2015.10.22.14.21.25 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Oct 2015 14:21:26 -0700 (PDT) Message-ID: <56295353.7030304@gmail.com> Date: Thu, 22 Oct 2015 21:39:00 -0000 From: Martin Sebor User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Joseph Myers CC: Eric Botcazou , gcc-patches@gcc.gnu.org Subject: Re: [PATCH 3 of 3] print help for undocumented options References: <561E8DF1.7070909@gmail.com> <5627FF90.1020105@gmail.com> <2477567.R8o8J52Xvm@polaris> <56291023.6070403@gmail.com> In-Reply-To: <56291023.6070403@gmail.com> Content-Type: multipart/mixed; boundary="------------010901090007040405070509" X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg02357.txt.bz2 This is a multi-part message in MIME format. --------------010901090007040405070509 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Content-length: 338 While fixing up the ChangeLogs for the commit (as requested below) I noticed that a number of new options have been added with help text with no period at the end. The attached patch fixes those up and adds a test to help catch these problems before they creep in again. Martin https://gcc.gnu.org/ml/gcc-patches/2015-10/msg02224.html --------------010901090007040405070509 Content-Type: text/x-patch; name="gcc-help-undocumented-opts-3.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="gcc-help-undocumented-opts-3.patch" Content-length: 5360 gcc/ChangeLog: 2015-10-22 Martin Sebor PR driver/68043 * config/i386/i386.opt: Add missing periods to the ends of sentences. * config/msp430/msp430.opt: Same. gcc/testsuite/ChangeLog: 2015-10-22 Martin Sebor PR driver/68043 * gcc.misc-tests/help.exp: Verify that option descriptions end in periods. * lib/options.exp (check_for_options): Use the regexp --line option. Print unexpected match on failure. Index: gcc/config/i386/i386.opt =================================================================== --- gcc/config/i386/i386.opt (revision 229177) +++ gcc/config/i386/i386.opt (working copy) @@ -701,15 +701,15 @@ mfma4 Target Report Mask(ISA_FMA4) Var(ix86_isa_flags) Save -Support FMA4 built-in functions and code generation +Support FMA4 built-in functions and code generation. mxop Target Report Mask(ISA_XOP) Var(ix86_isa_flags) Save -Support XOP built-in functions and code generation +Support XOP built-in functions and code generation. mlwp Target Report Mask(ISA_LWP) Var(ix86_isa_flags) Save -Support LWP built-in functions and code generation +Support LWP built-in functions and code generation. mabm Target Report Mask(ISA_ABM) Var(ix86_isa_flags) Save Index: gcc/config/msp430/msp430.opt =================================================================== --- gcc/config/msp430/msp430.opt (revision 229177) +++ gcc/config/msp430/msp430.opt (working copy) @@ -83,8 +83,8 @@ msilicon-errata= Target Joined RejectNegative Report ToLower -Passes on a request to the assembler to enable fixes for various silicon errata +Passes on a request to the assembler to enable fixes for various silicon errata. msilicon-errata-warn= Target Joined RejectNegative Report ToLower -Passes on a request to the assembler to warn about various silicon errata +Passes on a request to the assembler to warn about various silicon errata. Index: gcc/testsuite/gcc.misc-tests/help.exp =================================================================== --- gcc/testsuite/gcc.misc-tests/help.exp (revision 229177) +++ gcc/testsuite/gcc.misc-tests/help.exp (working copy) @@ -81,24 +81,40 @@ # Specify patterns (arguments 3 and later) that match option names # at the beginning of the line and not when they are referenced by # some other options later on. -# The (?w) Tcl embedded option tells the Tcl regexp parser to treat -# the '^' character as an anchor. check_for_options c "--help=joined" \ - "(?w)^ *-Wformat=" "(?w)^ *-fstrict-prototype" "" + "^ +-Wformat=" "^ +-fstrict-prototype" "" check_for_options c "--help=separate" \ - "(?w)^ *-MF" "(?w)^ *-fstrict-prototype" "" + "^ +-MF" "^ +-fstrict-prototype" "" check_for_options c "--help=warnings,joined" \ - "(?w)^ *-Wformat=" "(?w)^ *-Wtrigraphs" "" + "^ +-Wformat=" "^ +-Wtrigraphs" "" check_for_options c "--help=warnings,^joined" \ - "(?w)^ *-Wtrigraphs" "(?w)^ *-Wformat=" "" + "^ +-Wtrigraphs" "^ +-Wformat=" "" check_for_options c "--help=joined,separate" \ - "(?w)^ *-I" "" "" + "^ +-I" "" "" check_for_options c "--help=^joined,separate" \ - "(?w)^ *--param " "" "" + "^ +--param " "" "" check_for_options c "--help=joined,^separate" \ - "(?w)^ *--help=" "" "" + "^ +--help=" "" "" check_for_options c "--help=joined,undocumented" "" "" "" +# Check to make sure the description for every option is a complete +# sentence ending in a period. This matters not just for consistency +# but also because other sentences may be appended to it by the help +# subsystem. Do this one help class at a time to make it easier to +# find the source a failure. + +# GCC breaks up --help output into lines at most $COLUMNS characters +# wide (or 80 when COLUMNS is not defined), set the COLUMNS environment +# variable to a value large enough to prevent this. +global env +set env(COLUMNS) 1024 + +foreach cls { "ada" "c" "c++" "fortran" "go" \ + "optimizers" "param" "target" "warnings" } { + + check_for_options c "--help=$cls" "" "^ +-.*\[^:.\]$" "" +} + # Listing only excludes gives empty results. check_for_options c "--help=^joined,^separate" "" "" "" Index: gcc/testsuite/lib/options.exp =================================================================== --- gcc/testsuite/lib/options.exp (revision 229177) +++ gcc/testsuite/lib/options.exp (working copy) @@ -50,7 +50,7 @@ # Verify that COMPILER_PATTERRNS appear in gcc output. foreach pattern [split $compiler_patterns "\n"] { if {$pattern != ""} { - if {[regexp -- "$pattern" $gcc_output]} { + if {[regexp -line -- "$pattern" $gcc_output]} { pass "$test $pattern" } else { if {$expected_failure != ""} { @@ -65,13 +65,15 @@ # Verify that COMPILER_NON_PATTERRNS do not appear in gcc output. foreach pattern [split $compiler_non_patterns "\n"] { if {$pattern != ""} { - if {![regexp -- "$pattern" $gcc_output]} { + if {![regexp -line -- "$pattern" $gcc_output result]} { pass "$test $pattern" } else { if {$expected_failure != ""} { xfail "$test \"$pattern\" absent from output" } else { - fail "$test \"$pattern\" absent from output" + # Print the unexpected line that caused the failure + # to make it easier to find in the multiline output. + fail "$test \"$pattern\" absent from output: \"$result\"" } } } --------------010901090007040405070509--