From patchwork Sat Mar 23 23:04:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 31957 Received: (qmail 83529 invoked by alias); 23 Mar 2019 23:04:59 -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 83407 invoked by uid 89); 23 Mar 2019 23:04:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=Supply, thrown, gdb_test, cli X-HELO: mail-wr1-f43.google.com Received: from mail-wr1-f43.google.com (HELO mail-wr1-f43.google.com) (209.85.221.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 23 Mar 2019 23:04:57 +0000 Received: by mail-wr1-f43.google.com with SMTP id w10so6133937wrm.4 for ; Sat, 23 Mar 2019 16:04:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=f5llpKgfMJwQsfz86pvHbJ880GXdKBx8w89CW4woJ8k=; b=VLPIm4jcWL3gIsiKt4/n4zEQKkQEpFiTEpAY6L2hGqr169kJF+WDIuJpk5IFb7uCcQ S6MY4kCJjZnlF6qiSEVy8ZQLbDHoUFMLIbXxmdjaRCTJyUt8Ivc8oz6Yy9jmhCQIV4K4 56dHykWAgsojSqQoznfw2iFpZCRqvLtnBAhFqST0hPH5gDlvze77OYmrWGDLymh8UlDG hmHD4qpGeuPbe373631RjFTT+CY9Mt4QSYqjaCRedCyrU72Nr3tQh8gJ2xku0cN9wnWv eopOcqigYh59LT9ofwGUjK15UGTwCbiV6tmzjwOeM1p5vqJsSY44aj9IJCP7S3TZDTQA LF3g== Return-Path: Received: from localhost (host86-174-153-232.range86-174.btcentralplus.com. [86.174.153.232]) by smtp.gmail.com with ESMTPSA id b204sm9881451wmh.29.2019.03.23.16.04.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 23 Mar 2019 16:04:53 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH 2/3] gdb/testsuite: Make test names unique in gdb.python/py-prettyprint.exp Date: Sat, 23 Mar 2019 23:04:43 +0000 Message-Id: <6398e1704bab8844536849ff3829b3eb34bf5b24.1553382150.git.andrew.burgess@embecosm.com> In-Reply-To: References: In-Reply-To: References: X-IsSubscribed: yes This makes the test names unique in gdb.python/py-prettyprint.exp, it also switches to use gdb_breakpoint and gdb_continue_to_breakpoint more so that we avoid test names with the source line number in - this is bad if the test source ever changes as the test names will then change. One final change is to switch from using gdb_py_test_silent_cmd to use gdb_test_no_output, the former should be used for running python commands and can catch any thrown exception. However, in this case the command being run is not a python command, its just a normal GDB CLI command that produces no output, so lets use the appropriate wrapper function. gdb/testsuite/ChangeLog: * gdb.python/py-prettyprint.exp: Use gdb_breakpoint and gdb_continue_to_breakpoint more throughout this test. (run_lang_tests) Supply unique test names, and use gdb_test_no_output. --- gdb/testsuite/ChangeLog | 7 +++++++ gdb/testsuite/gdb.python/py-prettyprint.exp | 26 ++++++++++++++------------ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/gdb/testsuite/gdb.python/py-prettyprint.exp b/gdb/testsuite/gdb.python/py-prettyprint.exp index 5ec5fdb2b8b..335908279c9 100644 --- a/gdb/testsuite/gdb.python/py-prettyprint.exp +++ b/gdb/testsuite/gdb.python/py-prettyprint.exp @@ -49,9 +49,9 @@ proc run_lang_tests {exefile lang} { gdb_test_no_output "set print pretty on" - gdb_test "b [gdb_get_line_number {break to inspect} ${testfile}.c ]" \ - ".*Breakpoint.*" - gdb_test "continue" ".*Breakpoint.*" + gdb_breakpoint [gdb_get_line_number "break to inspect" ${testfile}.c] + gdb_continue_to_breakpoint "break to inspect" ".*break to inspect.*" + set remote_python_file [gdb_remote_download host \ ${srcdir}/${subdir}/${testfile}.py] @@ -78,12 +78,15 @@ proc run_lang_tests {exefile lang} { gdb_test "print ref" "= a=<15> b=< a=<8> b=<$hex>>" gdb_test "print derived" \ " = \{.* = pp class name: Vbase1.* = \{.* = pp value variable is: 1,.*members of Vbase2:.*_vptr.Vbase2 = $hex.* = \{.*members of Vbase3.*members of Derived:.*value = 2.*" - gdb_test "print ns " "\"embedded\\\\000null\\\\000string\"" - gdb_py_test_silent_cmd "set print elements 3" "" 1 - gdb_test "print ns" "emb\.\.\.." - gdb_py_test_silent_cmd "set print elements 10" "" 1 - gdb_test "print ns" "embedded\\\\000n\.\.\.." - gdb_py_test_silent_cmd "set print elements 200" "" 1 + gdb_test "print ns " "\"embedded\\\\000null\\\\000string\"" \ + "print ns with default element limit" + gdb_test_no_output "set print elements 3" + gdb_test "print ns" "emb\.\.\.." \ + "print ns with element limit of 3" + gdb_test_no_output "set print elements 10" + gdb_test "print ns" "embedded\\\\000n\.\.\.." \ + "print ns with element limit of 10" + gdb_test_no_output "set print elements 200" } if { ![is_address_zero_readable] } { @@ -168,9 +171,8 @@ gdb_continue_to_breakpoint "eval-break" ".* eval-break .*" gdb_test "info locals" "eval9 = eval=<123456789>" -gdb_test "b [gdb_get_line_number {break to inspect} ${testfile}.c ]" \ - ".*Breakpoint.*" -gdb_test "continue" ".*Breakpoint.*" +gdb_breakpoint [gdb_get_line_number "break to inspect" ${testfile}.c ] +gdb_continue_to_breakpoint "break to inspect" ".*break to inspect.*" gdb_test "print ss" " = a=< a=<1> b=<$hex>> b=< a=<2> b=<$hex>>" \ "print ss enabled #1"