public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Martin Liška" <mliska@suse.cz>
To: Ben Boeckel <ben.boeckel@kitware.com>,
	David Malcolm <dmalcolm@redhat.com>
Cc: Jason Merrill <jason@redhat.com>, Ben Boeckel <me@benboeckel.net>,
	gcc-patches@gcc.gnu.org, nathan@acm.org, fortran@gcc.gnu.org,
	gcc@gcc.gnu.org, brad.king@kitware.com
Subject: Re: [PATCH RESEND 0/1] RFC: P1689R5 support
Date: Wed, 19 Oct 2022 09:21:13 +0200	[thread overview]
Message-ID: <0843c33f-7d91-d0f6-b00c-21ece92f48c6@suse.cz> (raw)
In-Reply-To: <Y06aeVsCZWEPtxSb@megas.dev.benboeckel.internal>

On 10/18/22 14:22, Ben Boeckel wrote:
> On Thu, Oct 13, 2022 at 13:08:46 -0400, David Malcolm wrote:
>> On Mon, 2022-10-10 at 16:21 -0400, Jason Merrill wrote:
>>> David Malcolm would probably know best about JSON wrangling.
>>
>> Unfortunately our JSON output doesn't make any guarantees about the
>> ordering of keys within an object, so the precise textual output
>> changes from run to run.  I've coped with that in my test cases by
>> limiting myself to simple regexes of fragments of the JSON output.
>>
>> Martin Liska [CCed] went much further in
>> 4e275dccfc2467b3fe39012a3dd2a80bac257dd0 by adding a run-gcov-pytest
>> DejaGnu directive, allowing for test cases for gcov to be written in
>> Python, which can thus test much more interesting assertions about the
>> generated JSON.
> 
> Ok, if Python is acceptable, I'll use its stdlib to do "fancy" things.
> Part of this is because I want to assert that unnecessary fields don't
> exist and that sounds…unlikely to be possible in any maintainable way
> (assuming it is possible) with regexen. `jq` could help immensely, but
> that is probably a bridge too far :) .

Yes, please use Python if you have a more complicated output verification.

Examples I introduced:
./gcc/testsuite/g++.dg/gcov/test-pr98273.py
./gcc/testsuite/g++.dg/gcov/test-gcov-17.py

Martin

> 
> Thanks,
> 
> --Ben


      reply	other threads:[~2022-10-19  7:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-04 15:11 Ben Boeckel
2022-10-04 15:12 ` [PATCH RESEND 1/1] p1689r5: initial support Ben Boeckel
2022-10-04 19:12   ` Harald Anlauf
2022-10-11 11:30     ` Ben Boeckel
2022-10-10 21:04   ` Jason Merrill
2022-10-11 11:42     ` Ben Boeckel
2022-10-18 12:18       ` Ben Boeckel
2022-10-20 15:39         ` Jason Merrill
2022-10-20 17:31           ` Ben Boeckel
2022-10-20 18:22             ` Jason Merrill
2022-10-10 20:21 ` [PATCH RESEND 0/1] RFC: P1689R5 support Jason Merrill
2022-10-13 17:08   ` David Malcolm
2022-10-18 12:22     ` Ben Boeckel
2022-10-19  7:21       ` Martin Liška [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0843c33f-7d91-d0f6-b00c-21ece92f48c6@suse.cz \
    --to=mliska@suse.cz \
    --cc=ben.boeckel@kitware.com \
    --cc=brad.king@kitware.com \
    --cc=dmalcolm@redhat.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gcc@gcc.gnu.org \
    --cc=jason@redhat.com \
    --cc=me@benboeckel.net \
    --cc=nathan@acm.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).