From patchwork Mon Jul 29 13:10:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 33842 Received: (qmail 128843 invoked by alias); 29 Jul 2019 13:10:11 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 128835 invoked by uid 89); 29 Jul 2019 13:10:10 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 29 Jul 2019 13:10:09 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 62A26AF80 for ; Mon, 29 Jul 2019 13:10:06 +0000 (UTC) Date: Mon, 29 Jul 2019 15:10:04 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix python.exp with check-read1 Message-ID: <20190729131003.GA11639@delia> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-IsSubscribed: yes Hi, when running python/python.exp with check-read1, we get: ... (gdb) PASS: gdb.python/python.exp: prompt substitution readline - end python gdb.prompt_hook = error_prompt^M Python Exception Python exception calledPASS: gdb.python/python.exp: set hook : ^M (gdb) PASS: gdb.python/python.exp: set the hook to default python gdb.prompt_hook = None^M (gdb) PASS: gdb.python/python.exp: set print-stack full for prompt error test set python print-stack full^M (gdb) FAIL: gdb.python/python.exp: set the hook python gdb.prompt_hook = error_prompt^M Traceback (most recent call last):^M File "", line 3, in error_prompt^M RuntimeError: Python exception called^M (gdb) FAIL: gdb.python/python.exp: set the hook to default ... The problem is that gdb_test_multiple here: ... gdb_test_multiple "python gdb.prompt_hook = error_prompt" "set the hook" { -re "Python Exception (exceptions.RuntimeError|<(type 'exceptions.|class ')RuntimeError'>) Python excepti on called.*" { pass "set hook" } } ... specifies a regexp that ends with ".*" but doesn't specify the expected $gdb_prompt. Consequently, due to check-read1, the ".*" is matched to "" and the remaining $gdb_prompt is read by the the following gdb_py_test_silent_cmd, which has its own $gdb_prompt read by the following gdb_py_test_silent_cmd, which has its own $gdb_prompt causing a mismatch for the following gdb_test_multiple: ... gdb_test_multiple "python gdb.prompt_hook = error_prompt" "set the hook" { -re "Traceback.*File.*line.*RuntimeError.*Python exception called.*" { pass "set hook" } } ... which causes both FAILs. The second gdb_test_multiple has the same problem as the first, but it happens not to cause a FAIL because it's followed by a gdb_py_test_silent_cmd and a clean_restart. Fix the regexps in both gdb_test_multiple calls. Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix python.exp with check-read1 gdb/testsuite/ChangeLog: 2019-07-29 Tom de Vries * gdb.python/python.exp: Don't terminate gdb_test_multiple regexp with ".*". --- gdb/testsuite/gdb.python/python.exp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.python/python.exp b/gdb/testsuite/gdb.python/python.exp index 3b5d1a462c..fe55234060 100644 --- a/gdb/testsuite/gdb.python/python.exp +++ b/gdb/testsuite/gdb.python/python.exp @@ -453,7 +453,7 @@ gdb_py_test_multiple "prompt substitution readline" \ "end" "" gdb_test_multiple "python gdb.prompt_hook = error_prompt" "set the hook" { - -re "Python Exception (exceptions.RuntimeError|<(type 'exceptions.|class ')RuntimeError'>) Python exception called.*" { + -re "Python Exception (exceptions.RuntimeError|<(type 'exceptions.|class ')RuntimeError'>) Python exception called.*$gdb_prompt $" { pass "set hook" } } @@ -465,7 +465,7 @@ gdb_py_test_silent_cmd "set python print-stack full" \ "set print-stack full for prompt error test" 1 gdb_test_multiple "python gdb.prompt_hook = error_prompt" "set the hook" { - -re "Traceback.*File.*line.*RuntimeError.*Python exception called.*" { + -re "Traceback.*File.*line.*RuntimeError.*Python exception called.*$gdb_prompt $" { pass "set hook" } }