]> gcc.gnu.org Git - gcc.git/commitdiff
testsuite: Skip module_cmi_p and related unsupported module test
authorAlexandre Oliva <oliva@adacore.com>
Wed, 22 Feb 2023 17:35:36 +0000 (14:35 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Wed, 22 Feb 2023 17:38:17 +0000 (14:38 -0300)
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.

gcc/testsuite/g++.dg/modules/modules.exp

index 61994b059457b79b77575f6c59628e97f36fa195..e66b2082f2055c80b4040c18a7e0f90f19caf038 100644 (file)
@@ -315,6 +315,17 @@ proc module-check-requirements { tests } {
 # cleanup any detritus from previous run
 cleanup_module_files [find $DEFAULT_REPO *.gcm]
 
+# Override unsupported to set the second element of module_do to "N",
+# 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]
+}
+
 # not grouped tests, sadly tcl doesn't have negated glob
 foreach test [prune [lsort [find $srcdir/$subdir {*.[CH]}]] \
                  "$srcdir/$subdir/*_?.\[CH\]"] {
@@ -327,6 +338,9 @@ foreach test [prune [lsort [find $srcdir/$subdir {*.[CH]}]] \
            set module_cmis {}
            verbose "Testing $nshort $std" 1
            dg-test $test "$std" $DEFAULT_MODFLAGS
+           if { [lindex $module_do 1] == "N" } {
+               continue
+           }
            set testcase [string range $test [string length "$srcdir/"] end]
            cleanup_module_files [module_cmi_p $testcase $module_cmis]
        }
@@ -372,6 +386,9 @@ foreach src [lsort [find $srcdir/$subdir {*_a.[CHX}]] {
                        }
                    }
                    dg-test -keep-output $test "$std" $DEFAULT_MODFLAGS
+                   if { [lindex $module_do 1] == "N" } {
+                       break
+                   }
                    set testcase [string range $test [string length "$srcdir/"] end]
                    lappend mod_files [module_cmi_p $testcase $module_cmis]
                }
This page took 0.062809 seconds and 5 git commands to generate.