public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Richard Biener <rguenther@suse.de>,
	Jason Merrill <jason@redhat.com>,
	Alexandre Oliva <oliva@adacore.com>,
	ro@cebitec.uni-bielefeld.de, mikestump@comcast.net
Cc: gcc-patches@gcc.gnu.org, nathan@acm.org
Subject: [PATCH] testsuite: Fix up modules.exp [PR108899]
Date: Thu, 23 Feb 2023 15:18:04 +0100	[thread overview]
Message-ID: <Y/d1nMrKs775Bfs+@tucnak> (raw)
In-Reply-To: <orilft1u6h.fsf@lxoliva.fsfla.org>

Hi!

On Wed, Feb 22, 2023 at 02:33:42PM -0300, Alexandre Oliva via Gcc-patches wrote:
> When a multi-source module is found to be unsupported, we fail
> module_cmi_p and subsequent sources.  Override proc unsupported to
> mark the result in module_do, and test it to skip module_cmp_p and
> subsequent related tests.
> 
> for  gcc/testsuite/ChangeLog
> 
> 	* g++.dg/modules/modules.exp: Override unsupported to update
> 	module_do, and test it after dg-test.

This patch breaks testing with more than one set of options in
target board, like
make check-g++ RUNTESTFLAGS='--target_board=unix\{-m32,-m64\} modules.exp'
yields:
...
		=== g++ Summary for unix/-m32 ===

# of expected passes		7217
# of unexpected failures	1
# of expected failures		18
# of unsupported tests		2
Running target unix/-m64
...
ERROR: tcl error sourcing /home/jakub/src/gcc/gcc/testsuite/g++.dg/modules/modules.exp.
ERROR: tcl error code TCL OPERATION RENAME TARGET_EXISTS
ERROR: can't rename to "saved-unsupported": command already exists
    while executing
"rename unsupported saved-unsupported"
    (file "/home/jakub/src/gcc/gcc/testsuite/g++.dg/modules/modules.exp" line 322)
    invoked from within
"source /home/jakub/src/gcc/gcc/testsuite/g++.dg/modules/modules.exp"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 source /home/jakub/src/gcc/gcc/testsuite/g++.dg/modules/modules.exp"
    invoked from within
"catch "uplevel #0 source $test_file_name" msg"

In other spots where we in *.exp files rename some routine, we guard that
and the following patch does that for modules.exp too.

Tested with running
make check-g++ RUNTESTFLAGS='--target_board=unix\{-m32,-m64\} modules.exp'
again which now works properly again.

Ok for trunk?

2023-02-23  Jakub Jelinek  <jakub@redhat.com>

	PR testsuite/108899
	* g++.dg/modules/modules.exp: Only override unsupported if it
	exists and saved-unsupported doesn't.

--- gcc/testsuite/g++.dg/modules/modules.exp.jj	2023-02-22 20:50:34.208421799 +0100
+++ gcc/testsuite/g++.dg/modules/modules.exp	2023-02-23 13:07:40.207320104 +0100
@@ -319,11 +319,15 @@ cleanup_module_files [find $DEFAULT_REPO
 # so that, after an unsupported result in dg-test, we can skip rather
 # than fail subsequent related tests.
 set module_do {"compile" "P"}
-rename unsupported saved-unsupported
-proc unsupported { args } {
-    global module_do
-    lset module_do 1 "N"
-    return [saved-unsupported $args]
+if { [info procs unsupported] != [list] \
+      && [info procs saved-unsupported] == [list] } {
+    rename unsupported saved-unsupported
+
+    proc unsupported { args } {
+	global module_do
+	lset module_do 1 "N"
+	return [saved-unsupported $args]
+    }
 }
 
 # not grouped tests, sadly tcl doesn't have negated glob


	Jakub


  reply	other threads:[~2023-02-23 14:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-17  6:55 [PATCH] Skip module_cmi_p and related unsupported module test Alexandre Oliva
2023-02-20  4:27 ` Jason Merrill
2023-02-22 17:33   ` Alexandre Oliva
2023-02-23 14:18     ` Jakub Jelinek [this message]
2023-02-23 15:02       ` [PATCH] testsuite: Fix up modules.exp [PR108899] Richard Biener
2023-03-29 19:59       ` 'g++.dg/modules/modules.exp': don't leak local 'unsupported' proc [PR108899] (was: [PATCH] testsuite: Fix up modules.exp [PR108899]) Thomas Schwinge
2023-03-30  7:00         ` 'g++.dg/modules/modules.exp': don't leak local 'unsupported' proc [PR108899] Alexandre Oliva
2023-03-30  9:39           ` Thomas Schwinge
2023-03-30 13:51           ` Alexandre Oliva
2023-03-31 18:52             ` Jason Merrill
2023-04-01 18:06             ` Mike Stump
2023-04-05  7:47             ` Thomas Schwinge
2023-04-06  2:38               ` Alexandre Oliva
2023-04-06 20:11                 ` Thomas Schwinge
2023-04-06 23:40                   ` Alexandre Oliva

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=Y/d1nMrKs775Bfs+@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jason@redhat.com \
    --cc=mikestump@comcast.net \
    --cc=nathan@acm.org \
    --cc=oliva@adacore.com \
    --cc=rguenther@suse.de \
    --cc=ro@cebitec.uni-bielefeld.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).