From eee8ed2f22b36dfe64a9516171871476e8ede477 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Fri, 22 Jan 2021 06:44:22 -0800 Subject: [PATCH] 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. --- 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 } -- 2.30.2