Harmonize headers between both dg-extract-results scripts

Message ID 20230914142433.fifbjzmb6iu3yoqk@ws2202.lin.mbt.kalray.eu
State Accepted
Headers
Series Harmonize headers between both dg-extract-results scripts |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Paul Iannetta Sept. 14, 2023, 2:24 p.m. UTC
  Hi,

This is a small patch so that both dg-extract-results.py and
dg-extract-results.sh share the same header.  In particular, it fixes
the fact that the regexp r'^Test Run By (\S+) on (.*)$' was never
matched in the python file.

Thanks,
--
Paul
Kalray


Author: Paul Iannetta <piannetta@kalrayinc.com>
Date:   Thu Sep 14 15:43:58 2023 +0200

    Harmonize headers between both dg-extract-results scripts

    The header of the python version looked like:
    Target is ...
    Host   is ...
    The header of the bash version looked like:
    Test run by ... on ...
    Target is ...

    After this change both headers look like:
    Test run by ... on ...
    Target is ...
    Host   is ...

    The order of the tests is not the same but since dg-cmp-results.sh it
    does not matter much.

    contrib/ChangeLog:

    2023-09-14  Paul Iannetta  <piannetta@kalrayinc.com>

            * dg-extract-results.py: Print the "Test run" line.
            * dg-extract-results.sh: Print the "Host" line.
  

Comments

Paul Iannetta Sept. 18, 2023, 6:39 a.m. UTC | #1
On Thu, Sep 14, 2023 at 04:24:33PM +0200, Paul Iannetta wrote:
> Hi,
> 
> This is a small patch so that both dg-extract-results.py and
> dg-extract-results.sh share the same header.  In particular, it fixes
> the fact that the regexp r'^Test Run By (\S+) on (.*)$' was never
> matched in the python file.

By the way, the bash script dg-extract-results.sh checks whether
python is available by invoking python.  However, it seems that the
policy on newer machines is to not provide python as a symlink (at
least on Ubuntu 22.04 and above; and RHEL 8).  Therefore, we might
want to also check against python3 so that the bash script does not
fail to find python even though it is available.

Thanks,
Paul


> Author: Paul Iannetta <piannetta@kalrayinc.com>
> Date:   Thu Sep 14 15:43:58 2023 +0200
> 
>     Harmonize headers between both dg-extract-results scripts
> 
>     The header of the python version looked like:
>     Target is ...
>     Host   is ...
>     The header of the bash version looked like:
>     Test run by ... on ...
>     Target is ...
> 
>     After this change both headers look like:
>     Test run by ... on ...
>     Target is ...
>     Host   is ...
> 
>     The order of the tests is not the same but since dg-cmp-results.sh it
>     does not matter much.
> 
>     contrib/ChangeLog:
> 
>     2023-09-14  Paul Iannetta  <piannetta@kalrayinc.com>
> 
>             * dg-extract-results.py: Print the "Test run" line.
>             * dg-extract-results.sh: Print the "Host" line.
> 
> diff --git a/contrib/dg-extract-results.py b/contrib/dg-extract-results.py
> index 30aa68771d4..34da1808c5f 100644
> --- a/contrib/dg-extract-results.py
> +++ b/contrib/dg-extract-results.py
> @@ -113,7 +113,7 @@ class Prog:
>          # Whether to create .sum rather than .log output.
>          self.do_sum = True
>          # Regexps used while parsing.
> -        self.test_run_re = re.compile (r'^Test Run By (\S+) on (.*)$')
> +        self.test_run_re = re.compile (r'^Test run by (\S+) on (.*)$')
>          self.tool_re = re.compile (r'^\t\t=== (.*) tests ===$')
>          self.result_re = re.compile (r'^(PASS|XPASS|FAIL|XFAIL|UNRESOLVED'
>                                       r'|WARNING|ERROR|UNSUPPORTED|UNTESTED'
> diff --git a/contrib/dg-extract-results.sh b/contrib/dg-extract-results.sh
> index ff6c50d029c..57f6fe0e997 100755
> --- a/contrib/dg-extract-results.sh
> +++ b/contrib/dg-extract-results.sh
> @@ -271,7 +271,7 @@ cat $SUM_FILES \
>  
>  # Write the begining of the combined summary file.
>  
> -head -n 2 $FIRST_SUM
> +head -n 3 $FIRST_SUM
>  echo
>  echo "		=== $TOOL tests ==="
>  echo
  
Paul Iannetta Sept. 25, 2023, 9:55 a.m. UTC | #2
On Mon, Sep 18, 2023 at 08:39:34AM +0200, Paul Iannetta wrote:
> On Thu, Sep 14, 2023 at 04:24:33PM +0200, Paul Iannetta wrote:
> > Hi,
> > 
> > This is a small patch so that both dg-extract-results.py and
> > dg-extract-results.sh share the same header.  In particular, it fixes
> > the fact that the regexp r'^Test Run By (\S+) on (.*)$' was never
> > matched in the python file.
> 
> By the way, the bash script dg-extract-results.sh checks whether
> python is available by invoking python.  However, it seems that the
> policy on newer machines is to not provide python as a symlink (at
> least on Ubuntu 22.04 and above; and RHEL 8).  Therefore, we might
> want to also check against python3 so that the bash script does not
> fail to find python even though it is available.
> 
> Thanks,
> Paul
> 
> 
> > Author: Paul Iannetta <piannetta@kalrayinc.com>
> > Date:   Thu Sep 14 15:43:58 2023 +0200
> > 
> >     Harmonize headers between both dg-extract-results scripts
> > 
> >     The header of the python version looked like:
> >     Target is ...
> >     Host   is ...
> >     The header of the bash version looked like:
> >     Test run by ... on ...
> >     Target is ...
> > 
> >     After this change both headers look like:
> >     Test run by ... on ...
> >     Target is ...
> >     Host   is ...
> > 
> >     The order of the tests is not the same but since dg-cmp-results.sh it
> >     does not matter much.
> > 
> >     contrib/ChangeLog:
> > 
> >     2023-09-14  Paul Iannetta  <piannetta@kalrayinc.com>
> > 
> >             * dg-extract-results.py: Print the "Test run" line.
> >             * dg-extract-results.sh: Print the "Host" line.
> > 
> > diff --git a/contrib/dg-extract-results.py b/contrib/dg-extract-results.py
> > index 30aa68771d4..34da1808c5f 100644
> > --- a/contrib/dg-extract-results.py
> > +++ b/contrib/dg-extract-results.py
> > @@ -113,7 +113,7 @@ class Prog:
> >          # Whether to create .sum rather than .log output.
> >          self.do_sum = True
> >          # Regexps used while parsing.
> > -        self.test_run_re = re.compile (r'^Test Run By (\S+) on (.*)$')
> > +        self.test_run_re = re.compile (r'^Test run by (\S+) on (.*)$')
> >          self.tool_re = re.compile (r'^\t\t=== (.*) tests ===$')
> >          self.result_re = re.compile (r'^(PASS|XPASS|FAIL|XFAIL|UNRESOLVED'
> >                                       r'|WARNING|ERROR|UNSUPPORTED|UNTESTED'
> > diff --git a/contrib/dg-extract-results.sh b/contrib/dg-extract-results.sh
> > index ff6c50d029c..57f6fe0e997 100755
> > --- a/contrib/dg-extract-results.sh
> > +++ b/contrib/dg-extract-results.sh
> > @@ -271,7 +271,7 @@ cat $SUM_FILES \
> >  
> >  # Write the begining of the combined summary file.
> >  
> > -head -n 2 $FIRST_SUM
> > +head -n 3 $FIRST_SUM
> >  echo
> >  echo "		=== $TOOL tests ==="
> >  echo
  
Jeff Law Sept. 26, 2023, 2:29 p.m. UTC | #3
On 9/25/23 03:55, Paul Iannetta wrote:
> On Mon, Sep 18, 2023 at 08:39:34AM +0200, Paul Iannetta wrote:
>> On Thu, Sep 14, 2023 at 04:24:33PM +0200, Paul Iannetta wrote:
>>> Hi,
>>>
>>> This is a small patch so that both dg-extract-results.py and
>>> dg-extract-results.sh share the same header.  In particular, it fixes
>>> the fact that the regexp r'^Test Run By (\S+) on (.*)$' was never
>>> matched in the python file.
>>
>> By the way, the bash script dg-extract-results.sh checks whether
>> python is available by invoking python.  However, it seems that the
>> policy on newer machines is to not provide python as a symlink (at
>> least on Ubuntu 22.04 and above; and RHEL 8).  Therefore, we might
>> want to also check against python3 so that the bash script does not
>> fail to find python even though it is available.
>>
>> Thanks,
>> Paul
>>
>>
>>> Author: Paul Iannetta <piannetta@kalrayinc.com>
>>> Date:   Thu Sep 14 15:43:58 2023 +0200
>>>
>>>      Harmonize headers between both dg-extract-results scripts
>>>
>>>      The header of the python version looked like:
>>>      Target is ...
>>>      Host   is ...
>>>      The header of the bash version looked like:
>>>      Test run by ... on ...
>>>      Target is ...
>>>
>>>      After this change both headers look like:
>>>      Test run by ... on ...
>>>      Target is ...
>>>      Host   is ...
>>>
>>>      The order of the tests is not the same but since dg-cmp-results.sh it
>>>      does not matter much.
>>>
>>>      contrib/ChangeLog:
>>>
>>>      2023-09-14  Paul Iannetta  <piannetta@kalrayinc.com>
>>>
>>>              * dg-extract-results.py: Print the "Test run" line.
>>>              * dg-extract-results.sh: Print the "Host" line.
OK
jeff
  
Paul Iannetta Sept. 29, 2023, 8:19 a.m. UTC | #4
On Tue, Sep 26, 2023 at 08:29:11AM -0600, Jeff Law wrote:
> 
> 
> On 9/25/23 03:55, Paul Iannetta wrote:
> > On Mon, Sep 18, 2023 at 08:39:34AM +0200, Paul Iannetta wrote:
> > > On Thu, Sep 14, 2023 at 04:24:33PM +0200, Paul Iannetta wrote:
> > > > Hi,
> > > > 
> > > > This is a small patch so that both dg-extract-results.py and
> > > > dg-extract-results.sh share the same header.  In particular, it fixes
> > > > the fact that the regexp r'^Test Run By (\S+) on (.*)$' was never
> > > > matched in the python file.
> > > 
> > > By the way, the bash script dg-extract-results.sh checks whether
> > > python is available by invoking python.  However, it seems that the
> > > policy on newer machines is to not provide python as a symlink (at
> > > least on Ubuntu 22.04 and above; and RHEL 8).  Therefore, we might
> > > want to also check against python3 so that the bash script does not
> > > fail to find python even though it is available.
> > > 
> > > Thanks,
> > > Paul
> > > 
> > > 
> > > > Author: Paul Iannetta <piannetta@kalrayinc.com>
> > > > Date:   Thu Sep 14 15:43:58 2023 +0200
> > > > 
> > > >      Harmonize headers between both dg-extract-results scripts
> > > > 
> > > >      The header of the python version looked like:
> > > >      Target is ...
> > > >      Host   is ...
> > > >      The header of the bash version looked like:
> > > >      Test run by ... on ...
> > > >      Target is ...
> > > > 
> > > >      After this change both headers look like:
> > > >      Test run by ... on ...
> > > >      Target is ...
> > > >      Host   is ...
> > > > 
> > > >      The order of the tests is not the same but since dg-cmp-results.sh it
> > > >      does not matter much.
> > > > 
> > > >      contrib/ChangeLog:
> > > > 
> > > >      2023-09-14  Paul Iannetta  <piannetta@kalrayinc.com>
> > > > 
> > > >              * dg-extract-results.py: Print the "Test run" line.
> > > >              * dg-extract-results.sh: Print the "Host" line.
> OK
> jeff
> 
Thanks,
May I ask to you commit it to trunk on my behalf?

Paul

(Kalray has a corporate copyright assignment with the FSF, so there
should be no licensing problem)
  
Jeff Law Sept. 29, 2023, 2:52 p.m. UTC | #5
On 9/29/23 02:19, Paul Iannetta wrote:
> On Tue, Sep 26, 2023 at 08:29:11AM -0600, Jeff Law wrote:
>>
>>
>> On 9/25/23 03:55, Paul Iannetta wrote:
>>> On Mon, Sep 18, 2023 at 08:39:34AM +0200, Paul Iannetta wrote:
>>>> On Thu, Sep 14, 2023 at 04:24:33PM +0200, Paul Iannetta wrote:
>>>>> Hi,
>>>>>
>>>>> This is a small patch so that both dg-extract-results.py and
>>>>> dg-extract-results.sh share the same header.  In particular, it fixes
>>>>> the fact that the regexp r'^Test Run By (\S+) on (.*)$' was never
>>>>> matched in the python file.
>>>>
>>>> By the way, the bash script dg-extract-results.sh checks whether
>>>> python is available by invoking python.  However, it seems that the
>>>> policy on newer machines is to not provide python as a symlink (at
>>>> least on Ubuntu 22.04 and above; and RHEL 8).  Therefore, we might
>>>> want to also check against python3 so that the bash script does not
>>>> fail to find python even though it is available.
>>>>
>>>> Thanks,
>>>> Paul
>>>>
>>>>
>>>>> Author: Paul Iannetta <piannetta@kalrayinc.com>
>>>>> Date:   Thu Sep 14 15:43:58 2023 +0200
>>>>>
>>>>>       Harmonize headers between both dg-extract-results scripts
>>>>>
>>>>>       The header of the python version looked like:
>>>>>       Target is ...
>>>>>       Host   is ...
>>>>>       The header of the bash version looked like:
>>>>>       Test run by ... on ...
>>>>>       Target is ...
>>>>>
>>>>>       After this change both headers look like:
>>>>>       Test run by ... on ...
>>>>>       Target is ...
>>>>>       Host   is ...
>>>>>
>>>>>       The order of the tests is not the same but since dg-cmp-results.sh it
>>>>>       does not matter much.
>>>>>
>>>>>       contrib/ChangeLog:
>>>>>
>>>>>       2023-09-14  Paul Iannetta  <piannetta@kalrayinc.com>
>>>>>
>>>>>               * dg-extract-results.py: Print the "Test run" line.
>>>>>               * dg-extract-results.sh: Print the "Host" line.
>> OK
>> jeff
>>
> Thanks,
> May I ask to you commit it to trunk on my behalf?
Done.  Thanks for letting me know you didn't have write access.

Jeff
  
Thomas Schwinge Oct. 18, 2023, 9:35 a.m. UTC | #6
Hi!

On 2023-09-29T08:52:24-0600, Jeff Law <jeffreyalaw@gmail.com> wrote:
> On 9/29/23 02:19, Paul Iannetta wrote:
>> On Tue, Sep 26, 2023 at 08:29:11AM -0600, Jeff Law wrote:
>>> On 9/25/23 03:55, Paul Iannetta wrote:
>>>> On Mon, Sep 18, 2023 at 08:39:34AM +0200, Paul Iannetta wrote:
>>>>> On Thu, Sep 14, 2023 at 04:24:33PM +0200, Paul Iannetta wrote:
>>>>>> This is a small patch so that both dg-extract-results.py and
>>>>>> dg-extract-results.sh share the same header.  In particular, it fixes
>>>>>> the fact that the regexp r'^Test Run By (\S+) on (.*)$' was never
>>>>>> matched in the python file.

Thanks for looking into this!

I confirm that 'Test run by' lines now appear in
'contrib/dg-extract-results.py'-filtered '*.sum' files.

However, a number of upper-case 'Test Run By' instances do remain in GCC
sources:

    $ git grep --cached 'Test Run By'
    contrib/dg-extract-results.py:        # and in which the second is the associated 'Test Run By' line.
    contrib/dglib.pm:               } elsif(/^(Test Run By \S+ on|runtest completed at) ... (.{3}) (\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2}) (\d{4})/) {
    gcc/testsuite/ada/acats/run_all.sh:display "Test Run By $USER on `date`"
    gotools/Makefile.am:    @echo "Test Run By $${USER} on `date`" > gotools.head
    gotools/Makefile.in:@NATIVE_TRUE@       @echo "Test Run By $${USER} on `date`" > gotools.head
    libgo/Makefile.am:      @echo "Test Run By $${USER} on `date`" > libgo.head
    libgo/Makefile.in:      @echo "Test Run By $${USER} on `date`" > libgo.head

..., and I observe the following "regression" via the upper-case instance
in 'gcc/testsuite/ada/acats/run_all.sh':

    --- [...]/gcc/testsuite/ada/acats/acats.sum
    +++ [...]/gcc/testsuite/ada/acats/acats.sum
    @@ -1,4 +1,3 @@
    -Test Run By tschwing on Sun Sep 17 22:02:20 CEST 2023
                    === acats configuration ===
    [...]

(The upper-case 'echo's in gotools ('[...]/gotools/gotools.sum') and
libgo ('[...]/[...]/libgo/libgo.sum') evidently are not affected by your
change; presumably this testing doesn't use
'contrib/dg-extract-results.py'.)

Is this (case variants) maybe something that has changed in DejaGnu at
some point in time?  (I have not checked.)

I suggest that we adapt all remaining upper-case instances in GCC,
similar to your change.  And/or, as applicable, recognize both variants
(or ignore case distinctions generally)?


>>>>> By the way, the bash script dg-extract-results.sh checks whether
>>>>> python is available by invoking python.  However, it seems that the
>>>>> policy on newer machines is to not provide python as a symlink (at
>>>>> least on Ubuntu 22.04 and above; and RHEL 8).  Therefore, we might
>>>>> want to also check against python3 so that the bash script does not
>>>>> fail to find python even though it is available.

See <https://gcc.gnu.org/PR109668> "'python' vs. 'python3'".


>> May I ask to you commit it to trunk on my behalf?

> Done.  Thanks for letting me know you didn't have write access.

Given Paul's (and colleagues'?) ongoing work on GCC (Kalray KVX back end,
complex numbers support), is it maybe now time to enable Git write access
for him (them?)?

<https://gcc.gnu.org/gitwrite.html>, "write after approval".


>>>>>> Author: Paul Iannetta <piannetta@kalrayinc.com>
>>>>>> Date:   Thu Sep 14 15:43:58 2023 +0200
>>>>>>
>>>>>>       Harmonize headers between both dg-extract-results scripts
>>>>>>
>>>>>>       The header of the python version looked like:
>>>>>>       Target is ...
>>>>>>       Host   is ...
>>>>>>       The header of the bash version looked like:
>>>>>>       Test run by ... on ...
>>>>>>       Target is ...
>>>>>>
>>>>>>       After this change both headers look like:
>>>>>>       Test run by ... on ...
>>>>>>       Target is ...
>>>>>>       Host   is ...
>>>>>>
>>>>>>       The order of the tests is not the same but since dg-cmp-results.sh it
>>>>>>       does not matter much.
>>>>>>
>>>>>>       contrib/ChangeLog:
>>>>>>
>>>>>>       2023-09-14  Paul Iannetta  <piannetta@kalrayinc.com>
>>>>>>
>>>>>>               * dg-extract-results.py: Print the "Test run" line.
>>>>>>               * dg-extract-results.sh: Print the "Host" line.

>>>>>> diff --git a/contrib/dg-extract-results.py b/contrib/dg-extract-results.py
>>>>>> index 30aa68771d4..34da1808c5f 100644
>>>>>> --- a/contrib/dg-extract-results.py
>>>>>> +++ b/contrib/dg-extract-results.py
>>>>>> @@ -113,7 +113,7 @@ class Prog:
>>>>>>          # Whether to create .sum rather than .log output.
>>>>>>          self.do_sum = True
>>>>>>          # Regexps used while parsing.
>>>>>> -        self.test_run_re = re.compile (r'^Test Run By (\S+) on (.*)$')
>>>>>> +        self.test_run_re = re.compile (r'^Test run by (\S+) on (.*)$')
>>>>>>          self.tool_re = re.compile (r'^\t\t=== (.*) tests ===$')
>>>>>>          self.result_re = re.compile (r'^(PASS|XPASS|FAIL|XFAIL|UNRESOLVED'
>>>>>>                                       r'|WARNING|ERROR|UNSUPPORTED|UNTESTED'
>>>>>> diff --git a/contrib/dg-extract-results.sh b/contrib/dg-extract-results.sh
>>>>>> index ff6c50d029c..57f6fe0e997 100755
>>>>>> --- a/contrib/dg-extract-results.sh
>>>>>> +++ b/contrib/dg-extract-results.sh
>>>>>> @@ -271,7 +271,7 @@ cat $SUM_FILES \
>>>>>>
>>>>>>  # Write the begining of the combined summary file.
>>>>>>
>>>>>> -head -n 2 $FIRST_SUM
>>>>>> +head -n 3 $FIRST_SUM
>>>>>>  echo
>>>>>>  echo "          === $TOOL tests ==="
>>>>>>  echo
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
  
Jeff Law Oct. 19, 2023, 4:48 p.m. UTC | #7
On 10/18/23 03:35, Thomas Schwinge wrote:
> 
> Is this (case variants) maybe something that has changed in DejaGnu at
> some point in time?  (I have not checked.)
No idea :-)

> 
> I suggest that we adapt all remaining upper-case instances in GCC,
> similar to your change.  And/or, as applicable, recognize both variants
> (or ignore case distinctions generally)?
Yea, we should try to get this commonized.  Probably wise to recognize 
both variants as well -- especially if there are instances of these 
strings which aren't under GCC's contorl.


> 
> Given Paul's (and colleagues'?) ongoing work on GCC (Kalray KVX back end,
> complex numbers support), is it maybe now time to enable Git write access
> for him (them?)?
> 
> <https://gcc.gnu.org/gitwrite.html>, "write after approval".
Sure.  I'd sponsor them.

jeff
  

Patch

diff --git a/contrib/dg-extract-results.py b/contrib/dg-extract-results.py
index 30aa68771d4..34da1808c5f 100644
--- a/contrib/dg-extract-results.py
+++ b/contrib/dg-extract-results.py
@@ -113,7 +113,7 @@  class Prog:
         # Whether to create .sum rather than .log output.
         self.do_sum = True
         # Regexps used while parsing.
-        self.test_run_re = re.compile (r'^Test Run By (\S+) on (.*)$')
+        self.test_run_re = re.compile (r'^Test run by (\S+) on (.*)$')
         self.tool_re = re.compile (r'^\t\t=== (.*) tests ===$')
         self.result_re = re.compile (r'^(PASS|XPASS|FAIL|XFAIL|UNRESOLVED'
                                      r'|WARNING|ERROR|UNSUPPORTED|UNTESTED'
diff --git a/contrib/dg-extract-results.sh b/contrib/dg-extract-results.sh
index ff6c50d029c..57f6fe0e997 100755
--- a/contrib/dg-extract-results.sh
+++ b/contrib/dg-extract-results.sh
@@ -271,7 +271,7 @@  cat $SUM_FILES \
 
 # Write the begining of the combined summary file.
 
-head -n 2 $FIRST_SUM
+head -n 3 $FIRST_SUM
 echo
 echo "		=== $TOOL tests ==="
 echo