public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: "Jan Hubicka" <jh@suse.cz>, "Richard Biener" <rguenther@suse.de>,
	"Jørgen Kvalsvik" <j@lambda.is>
Cc: gcc-patches@gcc.gnu.org
Subject: [PATCH] testsuite: Fix up error on gcov1.d
Date: Fri, 5 Apr 2024 10:34:51 +0200	[thread overview]
Message-ID: <Zg+3q7n3bCFqaOTC@tucnak> (raw)
In-Reply-To: <20240223111800.1209438-2-j@lambda.is>

On Fri, Feb 23, 2024 at 12:18:00PM +0100, Jørgen Kvalsvik wrote:
> This is a mostly straight port from the gcov-19.c tests from the C test
> suite. The only notable differences from C to D are that D flips the
> true/false outcomes for loop headers, and the D front end ties loop and
> ternary conditions to slightly different locus.
> 
> The test for >64 conditions warning is disabled as it either needs
> support from the testing framework or a something similar to #pragma GCC
> diagnostic push to not cause a test failure from detecting a warning.
> 
> gcc/testsuite/ChangeLog:
> 
> 	* gdc.dg/gcov.exp: New test.
> 	* gdc.dg/gcov1.d: New test.

Unfortunately, this doesn't work.
I see
PASS: gdc.dg/gcov1.d   execution test
ERROR: (DejaGnu) proc "run-gcov conditions { --conditions gcov1.d }" does not exist.
The error code is TCL LOOKUP COMMAND run-gcov
The info on the error is:
invalid command name "run-gcov"
    while executing
"::tcl_unknown run-gcov conditions { --conditions gcov1.d }"
    ("uplevel" body line 1)
    invoked from within
"uplevel 1 ::tcl_unknown $args"
ERROR: gdc.dg/gcov1.d  : error executing dg-final: invalid command name "run-gcov"
both on x86_64-linux and i686-linux.
The problem is that the test hasn't been added to a new directory, but
to a directory already covered by a different *.exp file - dg.exp.
Now, usually either one has a test directory like gcc.misc-tests where
there are many *.exp files but each *.exp file globs for its own tests,
or there is one *.exp per directory and covers everything in there.
By having both dg.exp and gcov.exp in the same directory with dg.exp
covering all *.d files in there and gcov gcov*.d in there, the gcov*.d
tests are tested twice, once using the dg.exp driver and once using gcov.exp
driver.  With the latter, they do work properly, with the former they don't
because gcov.exp lib file isn't loaded and so run-gcov isn't available.

The following patch fixes that similarly how g++.dg/modules/modules.exp,
gcc.target/s390/s390.exp or gcc.target/i386/i386.exp deal with that,
by pruning some tests based on glob patterns from the list.

Tested on x86_64-linux with make -j32 check-d, ok for trunk?

2024-04-05  Jakub Jelinek  <jakub@redhat.com>

	* gdc.dg/dg.exp: Prune gcov*.d from the list of tests to run.
	* gdc.dg/gcov.exp: Update copyright years.

--- gcc/testsuite/gdc.dg/dg.exp.jj	2024-01-03 22:33:38.249693029 +0100
+++ gcc/testsuite/gdc.dg/dg.exp	2024-04-05 10:20:13.518823037 +0200
@@ -30,7 +30,8 @@ dg-init
 
 # Main loop.
 gdc-dg-runtest [lsort \
-       [glob -nocomplain $srcdir/$subdir/*.d ] ] "" $DEFAULT_DFLAGS
+       [prune [glob -nocomplain $srcdir/$subdir/*.d ] \
+	      $srcdir/$subdir/gcov*.d ] ] "" $DEFAULT_DFLAGS
 
 # All done.
 dg-finish
--- gcc/testsuite/gdc.dg/gcov.exp.jj	2024-04-04 21:45:56.025155257 +0200
+++ gcc/testsuite/gdc.dg/gcov.exp	2024-04-05 10:20:23.678682559 +0200
@@ -1,4 +1,4 @@
-#   Copyright (C) 1997-2023 Free Software Foundation, Inc.
+#   Copyright (C) 1997-2024 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by

	Jakub


  parent reply	other threads:[~2024-04-05  8:35 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-23 11:17 [PATCH v10 1/2] Add condition coverage (MC/DC) Jørgen Kvalsvik
2024-02-23 11:18 ` [PATCH v10 2/2] Add gcov MC/DC tests for GDC Jørgen Kvalsvik
2024-02-23 11:44   ` Iain Buclaw
2024-04-05  8:34   ` Jakub Jelinek [this message]
2024-04-05  8:57     ` [PATCH] testsuite: Fix up error on gcov1.d Richard Biener
2024-03-12 20:40 ` Ping [PATCH v10 1/2] Add condition coverage (MC/DC) Jørgen Kvalsvik
2024-03-21 12:23   ` Ping^2 " Jørgen Kvalsvik
2024-04-03  7:32     ` Ping^3 " Jørgen Kvalsvik
2024-04-04 12:10 ` Jan Hubicka
2024-04-04 12:54   ` Jørgen Kvalsvik
2024-04-04 13:56     ` Jan Hubicka
2024-04-05 13:00     ` Rainer Orth
2024-04-05 13:34       ` Jørgen Kvalsvik
2024-04-05 14:03     ` H.J. Lu
2024-04-15  8:53     ` Rainer Orth
2024-04-15  9:03       ` Jørgen Kvalsvik
2024-04-15  9:39       ` Jørgen Kvalsvik
2024-04-15 11:18         ` Rainer Orth
2024-04-15 11:34           ` Jørgen Kvalsvik

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=Zg+3q7n3bCFqaOTC@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=j@lambda.is \
    --cc=jh@suse.cz \
    --cc=rguenther@suse.de \
    /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).