From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2153) id A76883858C24; Fri, 5 Apr 2024 09:06:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A76883858C24 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712307974; bh=cY8exwO48pqlanzC43VuO8E2pYx8RTMu+Et4+YTSIdw=; h=From:To:Subject:Date:From; b=YznyUjAsRqBjSxf96cZOUvZ8+p2HRNikfxN2XNnbhBTA6fDI3K/V3UuPMkPB+2HPa OhqBHyFy7wyeCEIEoxvTDfMCxV1rcxOhi03/yM7LA+GFTc3qTzVEtSHdb7ZWVySrOo zbgYYglzD33AeqfbLJHEyq1WvAZ/tizJP91QRu1E= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" From: Jakub Jelinek To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-9802] testsuite: Fix up error on gcov1.d X-Act-Checkin: gcc X-Git-Author: Jakub Jelinek X-Git-Refname: refs/heads/master X-Git-Oldrev: 592536eb3c0a97a55b1019ff0216ef77e6ca847e X-Git-Newrev: effd947fcc2bbe0dfbc7d470eab4bc65bd9b46c8 Message-Id: <20240405090614.A76883858C24@sourceware.org> Date: Fri, 5 Apr 2024 09:06:14 +0000 (GMT) List-Id: https://gcc.gnu.org/g:effd947fcc2bbe0dfbc7d470eab4bc65bd9b46c8 commit r14-9802-geffd947fcc2bbe0dfbc7d470eab4bc65bd9b46c8 Author: Jakub Jelinek Date: Fri Apr 5 11:05:01 2024 +0200 testsuite: Fix up error on gcov1.d 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. 2024-04-05 Jakub Jelinek * gdc.dg/dg.exp: Prune gcov*.d from the list of tests to run. * gdc.dg/gcov.exp: Update copyright years. Diff: --- gcc/testsuite/gdc.dg/dg.exp | 3 ++- gcc/testsuite/gdc.dg/gcov.exp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/gdc.dg/dg.exp b/gcc/testsuite/gdc.dg/dg.exp index 786b5359b85..50527c5372f 100644 --- a/gcc/testsuite/gdc.dg/dg.exp +++ b/gcc/testsuite/gdc.dg/dg.exp @@ -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 diff --git a/gcc/testsuite/gdc.dg/gcov.exp b/gcc/testsuite/gdc.dg/gcov.exp index 4218771b208..ea70ea85f28 100644 --- a/gcc/testsuite/gdc.dg/gcov.exp +++ b/gcc/testsuite/gdc.dg/gcov.exp @@ -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