From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2140) id 6D3BF3858284; Wed, 22 Feb 2023 17:40:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6D3BF3858284 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677087608; bh=5BLtG+ERkayBA5HMJAMHc+p/dVWpQIFo6wjQPQ3Ecqg=; h=From:To:Subject:Date:From; b=CmtMpQwh4FjOibghAceDNVPyAUDvk5HSkDGhy/PwxX8vuIWkURH9ixjHjZE9CE99c ywytTLjEZYQCXWVwInVgv6qAzVX9PFoYUmo/mBheBAyIkYeHsVuwIKwbA8nzCmXIDc X3v2Re9KCxZQRGeRskUxA+/3xKIl3qWOw3K/QN54= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Alexandre Oliva To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-6288] testsuite: Skip module_cmi_p and related unsupported module test X-Act-Checkin: gcc X-Git-Author: Alexandre Oliva X-Git-Refname: refs/heads/master X-Git-Oldrev: 1a684dca0e812921a733e3ed7302977c7924b2ae X-Git-Newrev: 5344482c4d3ae0618fa8f5ed38f8309db43fdb82 Message-Id: <20230222174008.6D3BF3858284@sourceware.org> Date: Wed, 22 Feb 2023 17:40:08 +0000 (GMT) List-Id: https://gcc.gnu.org/g:5344482c4d3ae0618fa8f5ed38f8309db43fdb82 commit r13-6288-g5344482c4d3ae0618fa8f5ed38f8309db43fdb82 Author: Alexandre Oliva Date: Wed Feb 22 14:35:36 2023 -0300 testsuite: Skip module_cmi_p and related unsupported module test 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. Diff: --- gcc/testsuite/g++.dg/modules/modules.exp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/gcc/testsuite/g++.dg/modules/modules.exp b/gcc/testsuite/g++.dg/modules/modules.exp index 61994b05945..e66b2082f20 100644 --- a/gcc/testsuite/g++.dg/modules/modules.exp +++ b/gcc/testsuite/g++.dg/modules/modules.exp @@ -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] }