diff options
author | Nathan Sidwell <nathan@acm.org> | 2021-01-22 06:44:22 -0800 |
---|---|---|
committer | Nathan Sidwell <nathan@acm.org> | 2021-01-22 06:44:22 -0800 |
commit | eee8ed2f22b36dfe64a9516171871476e8ede477 (patch) | |
tree | e2a49ea0adfa5cff1aaf4e085acaf050264648a3 | |
parent | 4be156d6bef317b8704052f11431457a577ed564 (diff) | |
download | gcc-eee8ed2f22b36dfe64a9516171871476e8ede477.zip gcc-eee8ed2f22b36dfe64a9516171871476e8ede477.tar.gz gcc-eee8ed2f22b36dfe64a9516171871476e8ede477.tar.bz2 |
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.
-rw-r--r-- | gcc/testsuite/g++.dg/modules/modules.exp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/gcc/testsuite/g++.dg/modules/modules.exp b/gcc/testsuite/g++.dg/modules/modules.exp index bd88bde..8c9a00e 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 } |