* [PATCH][testsuite]: make check-functions-body dump expected and seen cases on failure.
@ 2022-09-23 9:23 Tamar Christina
2022-09-23 9:32 ` Richard Sandiford
0 siblings, 1 reply; 2+ messages in thread
From: Tamar Christina @ 2022-09-23 9:23 UTC (permalink / raw)
To: gcc-patches; +Cc: nd, richard.sandiford
[-- Attachment #1: Type: text/plain, Size: 1330 bytes --]
Hi All,
Often times when a check_function_body check fails it can be quite hard to
figure out why as no additional information is provided.
This changes it so that on failures it prints out the regex expression it's
using and the text it's comparing against to the verbose log.
This makes it much easier to figure out why a test has failed.
Bootstrapped Regtested on aarch64-none-linux-gnu and no issues.
Ok for master?
Thanks,
Tamar
gcc/testsuite/ChangeLog:
* lib/scanasm.exp (check_function_body): Add debug output to verbose log
on failure.
--- inline copy of patch --
diff --git a/gcc/testsuite/lib/scanasm.exp b/gcc/testsuite/lib/scanasm.exp
index a80630bb2a819812ce1fe05184535011a12f1288..7c9dcfc9b2e49093355219f76838161f4c3302df 100644
--- a/gcc/testsuite/lib/scanasm.exp
+++ b/gcc/testsuite/lib/scanasm.exp
@@ -803,7 +803,12 @@ proc check_function_body { functions name body_regexp } {
if { ![info exists up_functions($name)] } {
return 0
}
- return [regexp "^$body_regexp\$" $up_functions($name)]
+ set fn_res [regexp "^$body_regexp\$" $up_functions($name)]
+ if { !$fn_res } {
+ verbose -log "body: $body_regexp"
+ verbose -log "against: $up_functions($name)"
+ }
+ return $fn_res
}
# Check the implementations of functions against expected output. Used as:
--
[-- Attachment #2: rb16250.patch --]
[-- Type: text/plain, Size: 741 bytes --]
diff --git a/gcc/testsuite/lib/scanasm.exp b/gcc/testsuite/lib/scanasm.exp
index a80630bb2a819812ce1fe05184535011a12f1288..7c9dcfc9b2e49093355219f76838161f4c3302df 100644
--- a/gcc/testsuite/lib/scanasm.exp
+++ b/gcc/testsuite/lib/scanasm.exp
@@ -803,7 +803,12 @@ proc check_function_body { functions name body_regexp } {
if { ![info exists up_functions($name)] } {
return 0
}
- return [regexp "^$body_regexp\$" $up_functions($name)]
+ set fn_res [regexp "^$body_regexp\$" $up_functions($name)]
+ if { !$fn_res } {
+ verbose -log "body: $body_regexp"
+ verbose -log "against: $up_functions($name)"
+ }
+ return $fn_res
}
# Check the implementations of functions against expected output. Used as:
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH][testsuite]: make check-functions-body dump expected and seen cases on failure.
2022-09-23 9:23 [PATCH][testsuite]: make check-functions-body dump expected and seen cases on failure Tamar Christina
@ 2022-09-23 9:32 ` Richard Sandiford
0 siblings, 0 replies; 2+ messages in thread
From: Richard Sandiford @ 2022-09-23 9:32 UTC (permalink / raw)
To: Tamar Christina; +Cc: gcc-patches, nd
Tamar Christina <tamar.christina@arm.com> writes:
> Hi All,
>
> Often times when a check_function_body check fails it can be quite hard to
> figure out why as no additional information is provided.
>
> This changes it so that on failures it prints out the regex expression it's
> using and the text it's comparing against to the verbose log.
>
> This makes it much easier to figure out why a test has failed.
>
> Bootstrapped Regtested on aarch64-none-linux-gnu and no issues.
>
> Ok for master?
>
> Thanks,
> Tamar
>
> gcc/testsuite/ChangeLog:
>
> * lib/scanasm.exp (check_function_body): Add debug output to verbose log
> on failure.
OK, thanks.
Richard
>
> --- inline copy of patch --
> diff --git a/gcc/testsuite/lib/scanasm.exp b/gcc/testsuite/lib/scanasm.exp
> index a80630bb2a819812ce1fe05184535011a12f1288..7c9dcfc9b2e49093355219f76838161f4c3302df 100644
> --- a/gcc/testsuite/lib/scanasm.exp
> +++ b/gcc/testsuite/lib/scanasm.exp
> @@ -803,7 +803,12 @@ proc check_function_body { functions name body_regexp } {
> if { ![info exists up_functions($name)] } {
> return 0
> }
> - return [regexp "^$body_regexp\$" $up_functions($name)]
> + set fn_res [regexp "^$body_regexp\$" $up_functions($name)]
> + if { !$fn_res } {
> + verbose -log "body: $body_regexp"
> + verbose -log "against: $up_functions($name)"
> + }
> + return $fn_res
> }
>
> # Check the implementations of functions against expected output. Used as:
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-09-23 9:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-23 9:23 [PATCH][testsuite]: make check-functions-body dump expected and seen cases on failure Tamar Christina
2022-09-23 9:32 ` Richard Sandiford
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).