From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id CC0763858D39; Wed, 19 Oct 2022 07:21:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CC0763858D39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 9CFB520232; Wed, 19 Oct 2022 07:21:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1666164073; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BMrlF48mqX/+Zkgyxe4tk7le3dpT9dpQ1qg8rZ8j/Kw=; b=ACitxL/ZB2KNPFZOw707xdUlzzO/qy7cSzUJ8F9Ls5XPouGsqawfyrTuAbhthGHZVRJbUw ThMNEPoO7UDt5HHXdHCo9087VB+jtkyqp10za/1ir3SEfkrhEY8T1+4SF/c6WxMdnRRxtY B1axOswz+A/Pc1HcN7xWi23AijbWCo0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1666164073; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BMrlF48mqX/+Zkgyxe4tk7le3dpT9dpQ1qg8rZ8j/Kw=; b=u84QnRIGWc8a8Z4oSOSEiYog3gu90pITHT5azdhmZIS1lx/1zcXCIHW9/FI8gbKZlL6xRL YCfb81VBPjNaCyDQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 5E16F13A36; Wed, 19 Oct 2022 07:21:13 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id VgfiFWmlT2MkOAAAMHmgww (envelope-from ); Wed, 19 Oct 2022 07:21:13 +0000 Message-ID: <0843c33f-7d91-d0f6-b00c-21ece92f48c6@suse.cz> Date: Wed, 19 Oct 2022 09:21:13 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [PATCH RESEND 0/1] RFC: P1689R5 support To: Ben Boeckel , David Malcolm Cc: Jason Merrill , Ben Boeckel , gcc-patches@gcc.gnu.org, nathan@acm.org, fortran@gcc.gnu.org, gcc@gcc.gnu.org, brad.king@kitware.com References: <20221004151200.1275636-1-ben.boeckel@kitware.com> <3bfbf143-d85e-cb93-68eb-686262e2acc3@redhat.com> <340d9872b51aebe8a7392b7122def32ed3ca279f.camel@redhat.com> Content-Language: en-US From: =?UTF-8?Q?Martin_Li=c5=a1ka?= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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