From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1984) id 6A7D63858C52; Fri, 23 Sep 2022 10:00:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6A7D63858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663927229; bh=4G+M6wOgrIsuK2n2bUYXVX1X4zDI/p+lPbv1rqYH7uY=; h=From:To:Subject:Date:From; b=S9UJwQytDXSlGLWZZcxyd7uiX8huvkvQzJhz90Vx38y/X30OuqEmyK0lQm18anGau aVFZe7cerjtuSt8xsbh1xnitSsGs8MUR1mRIrDR7Uxs9FoFofex3sVKCrv4hqcPutI 4gWmGbsoE19jmJMAuA0GjOTkwXAOFNLg6xgqQnCk= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Tamar Christina To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-2811] testsuite: make check-functions-body dump expected and seen cases on failure. X-Act-Checkin: gcc X-Git-Author: Tamar Christina X-Git-Refname: refs/heads/master X-Git-Oldrev: b7fd7fb5011106c062df9275ca8fddcbce4ebdeb X-Git-Newrev: 50324a0d39b9e9d47e8959d7f7f2460b16e8f2a2 Message-Id: <20220923100029.6A7D63858C52@sourceware.org> Date: Fri, 23 Sep 2022 10:00:29 +0000 (GMT) List-Id: https://gcc.gnu.org/g:50324a0d39b9e9d47e8959d7f7f2460b16e8f2a2 commit r13-2811-g50324a0d39b9e9d47e8959d7f7f2460b16e8f2a2 Author: Tamar Christina Date: Fri Sep 23 10:56:30 2022 +0100 testsuite: make check-functions-body dump expected and seen cases on failure. 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. gcc/testsuite/ChangeLog: * lib/scanasm.exp (check_function_body): Add debug output to verbose log on failure. Diff: --- gcc/testsuite/lib/scanasm.exp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/lib/scanasm.exp b/gcc/testsuite/lib/scanasm.exp index a80630bb2a8..7c9dcfc9b2e 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: