[PATCH] testsuite: prune DOS drive letter in test outputs

Jan Beulich jbeulich@suse.com
Wed Feb 22 08:26:34 GMT 2023


On 21.02.2023 17:14, Clément Chigot wrote:
> --- a/binutils/testsuite/lib/binutils-common.exp
> +++ b/binutils/testsuite/lib/binutils-common.exp
> @@ -687,6 +687,22 @@ if ![string length [info proc prune_warnings]] {
>      }
>  }
>  
> +# prune_dump_output OUTPUT
> +#
> +# Clean up the output from system specific or unwanted characters.
> +# This allows to simplify the regexp inside dump tests.
> +proc prune_dump_output { output } {
> +    if [ishost "*-*-mingw*"] {

Cygwin as well then?

> +	# Prune DOS drive letter from an absolute path if it appears
> +	# at the beginning of a line.
> +	regsub -all "(^|\n)\[\[:upper:\]\]:" $output "\\1" output

Drive letters aren't guaranteed upper case, are they? I also think this
may end up too lax, as there may be messages which don't start with a
path. I would expect that you want to also match "warning:", "error:",
and alike infixes. Plus wouldn't you better match (but not remove) the
first \ or / following the colon?

> --- a/ld/testsuite/ld-elf/noinit-sections-2.l
> +++ b/ld/testsuite/ld-elf/noinit-sections-2.l
> @@ -1,5 +1,5 @@
>  #...
> -(|.:)[^:]*: warning: orphan section `.noinit.var_noinit' from \S+ being placed in section `.noinit.var_noinit'
> +[^:]*: warning: orphan section `.noinit.var_noinit' from \S+ being placed in section `.noinit.var_noinit'
>  #...
> -(|.:)[^:]*: warning: orphan section `.gnu.linkonce.n.var_noinit2' from \S+ being placed in section `.gnu.linkonce.n.var_noinit2'
> +[^:]*: warning: orphan section `.gnu.linkonce.n.var_noinit2' from \S+ being placed in section `.gnu.linkonce.n.var_noinit2'
>  #pass

Did you commit the earlier patch, which now needs reverting?

Jan


More information about the Binutils mailing list