public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-6860] testsuite: Uniquify test names [PR 98795]
@ 2021-01-22 14:48 Nathan Sidwell
  0 siblings, 0 replies; only message in thread
From: Nathan Sidwell @ 2021-01-22 14:48 UTC (permalink / raw)
  To: gcc-cvs

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

commit r11-6860-geee8ed2f22b36dfe64a9516171871476e8ede477
Author: Nathan Sidwell <nathan@acm.org>
Date:   Fri Jan 22 06:44:22 2021 -0800

    testsuite: Uniquify test names [PR 98795]
    
    Header unit names come from the path the preprocessor determines, and
    thus can be absolute.  This tweaks the testsuite to elide that
    absoluteness when embedded in a CMI name.  We were also not
    distinguishing link and execute tests by the $std flags, so append
    them when necessary.
    
            PR testsuite/98795
            gcc/testsuite/
            * g++.dg/modules/modules.exp (module_cmi_p): Avoid
            embedded absolute paths.
            (module_do_it): Append $std to test name.

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

diff --git a/gcc/testsuite/g++.dg/modules/modules.exp b/gcc/testsuite/g++.dg/modules/modules.exp
index bd88bde60dc..8c9a00e68e9 100644
--- a/gcc/testsuite/g++.dg/modules/modules.exp
+++ b/gcc/testsuite/g++.dg/modules/modules.exp
@@ -118,10 +118,12 @@ proc module_cmi_p { src ifs } {
 	}
 	set not [lindex $if_arg 2]
 	set cmi [lindex $if_arg 3]
+	global srcdir
+	set relcmi [string map [list $srcdir "/\$srcdir"] $cmi]
 	if { $not != [file_on_host exists $cmi] } {
-	    pass "$src module-cmi $spec ($cmi)"
+	    pass "$src module-cmi $spec ($relcmi)"
 	} else {
-	    fail "$src module-cmi $spec ($cmi)"
+	    fail "$src module-cmi $spec ($relcmi)"
 	    set not [expr ! $not ]
 	}
 	if { ! $not } {
@@ -210,8 +212,10 @@ proc module_do_it { do_what testcase std asm_list } {
     }
 
     set options { }
+    set ident $testcase
     if { $std != "" } {
 	lappend options "additional_flags=$std"
+	set ident "$ident $std"
     }
     if { [llength $do_what] > 3 } {
 	lappend options "additional_flags=[lindex $do_what 3]"
@@ -222,15 +226,15 @@ proc module_do_it { do_what testcase std asm_list } {
     # link it
     verbose "Linking $asm_list" 1
     if { !$ok } {
-	unresolved "$testcase link"
+	unresolved "$identlink"
     } else {
 	set out [${tool}_target_compile $asm_list \
 		     $execname executable $options]
 	eval $xfail
 	if { $out == "" } {
-	    pass "$testcase link"
+	    pass "$ident link"
 	} else {
-	    fail "$testcase link"
+	    fail "$ident link"
 	    set ok 0
 	}
     }
@@ -238,12 +242,12 @@ proc module_do_it { do_what testcase std asm_list } {
     # run it?
     if { !$run } {
     } elseif { !$ok } {
-	unresolved "$testcase execute"
+	unresolved "$ident execute"
     } else {
 	set out [${tool}_load $execname "" ""]
 	set status [lindex $out 0]
 	eval $xfail
-	$status "$testcase execute"
+	$status "$ident execute"
 	if { $status != "pass" } {
 	    set $ok 0
 	}


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

only message in thread, other threads:[~2021-01-22 14:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-22 14:48 [gcc r11-6860] testsuite: Uniquify test names [PR 98795] Nathan Sidwell

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