public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/aoliva/heads/testme)] [PR108899] testsuite: fix proc unsupported overriding in modules.exp
@ 2023-03-30 14:08 Alexandre Oliva
  0 siblings, 0 replies; only message in thread
From: Alexandre Oliva @ 2023-03-30 14:08 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:fd36f78762c1b3d0a751fff121792f0bfaca775d

commit fd36f78762c1b3d0a751fff121792f0bfaca775d
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Thu Mar 30 05:07:30 2023 -0300

    [PR108899] testsuite: fix proc unsupported overriding in modules.exp
    
    The overrider of proc unsupported in modules.exp had two problems
    reported by Thomas Schwinge, even after Jakub Jelínek's fix:
    
    - it remained in effect while running other dejagnu testsets
    
    - it didn't quote correctly the argument list passed to it, which
      caused test names to be surrounded by curly braces, as in:
    
    UNSUPPORTED: {...}
    
    This patch fixes both issues, obsoleting and reverting Jakub's change,
    by dropping the overrider and renaming the saved proc back, and by
    using uplevel's argument list splicing.
    
    
    for  gcc/testsuite/ChangeLog
    
            PR testsuite/108899
            * g++.dg/modules/modules.exp (unsupported): Drop renaming.
            Fix quoting.

Diff:
---
 gcc/testsuite/g++.dg/modules/modules.exp | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/gcc/testsuite/g++.dg/modules/modules.exp b/gcc/testsuite/g++.dg/modules/modules.exp
index 80aa392bc7f..dc302d3d0af 100644
--- a/gcc/testsuite/g++.dg/modules/modules.exp
+++ b/gcc/testsuite/g++.dg/modules/modules.exp
@@ -319,15 +319,11 @@ cleanup_module_files [find $DEFAULT_REPO *.gcm]
 # so that, after an unsupported result in dg-test, we can skip rather
 # than fail subsequent related tests.
 set module_do {"compile" "P"}
-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]
-    }
+rename unsupported modules-saved-unsupported
+proc unsupported { args } {
+    global module_do
+    lset module_do 1 "N"
+    return [uplevel 1 modules-saved-unsupported $args]
 }
 
 # not grouped tests, sadly tcl doesn't have negated glob
@@ -412,4 +408,10 @@ foreach src [lsort [find $srcdir/$subdir {*_a.[CHX}]] {
     }
 }
 
+# Restore the original unsupported proc, lest it will affect
+# subsequent test runs, or even fail renaming if we run modules.exp
+# for multiple targets/multilibs/options.
+rename unsupported {}
+rename modules-saved-unsupported unsupported
+
 dg-finish

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-30 14:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-30 14:08 [gcc(refs/users/aoliva/heads/testme)] [PR108899] testsuite: fix proc unsupported overriding in modules.exp Alexandre Oliva

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).