From patchwork Fri Jan 6 18:57:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 62808 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BFF54385781F for ; Fri, 6 Jan 2023 18:57:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BFF54385781F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673031477; bh=YgJXnI35g9u2RcI5nwacV0uIJI+PUWI0CHqvQm36XvQ=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=lC0s5/J2J8AmR2yQOnu/1u0przyWg7jvYBdqa+3DkD2Yr66BlBp6AIYhMTb6Fhz4w MY/X/dI5ebXW0Nuu5cmPAw5kBhlJVA+nO5dPwSDu6W1eBtnHe8hT7/Kul0XLDYtZcq 7RQFpynzKElolHV39i3XEjfaH8eWhn5VOeApXAi4= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id 1775E3858D33 for ; Fri, 6 Jan 2023 18:57:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1775E3858D33 X-ASG-Debug-ID: 1673031450-0c856e762a4b70a0001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id tw8AWYw1PjDL9ldS (version=TLSv1 cipher=AES128-SHA bits=128 verify=NO); Fri, 06 Jan 2023 13:57:30 -0500 (EST) X-Barracuda-Envelope-From: simon.marchi@efficios.com X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from epycamd.internal.efficios.com (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) by smtp.ebox.ca (Postfix) with ESMTP id 97A7E441D64; Fri, 6 Jan 2023 13:57:30 -0500 (EST) X-Barracuda-RBL-IP: 192.222.180.24 X-Barracuda-Effective-Source-IP: 192-222-180-24.qc.cable.ebox.net[192.222.180.24] X-Barracuda-Apparent-Source-IP: 192.222.180.24 To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 1/9] gdb/testsuite/dap: use gdb_assert in gdb.dap/basic-dap.exp Date: Fri, 6 Jan 2023 13:57:21 -0500 X-ASG-Orig-Subj: [PATCH 1/9] gdb/testsuite/dap: use gdb_assert in gdb.dap/basic-dap.exp Message-Id: <20230106185729.42372-2-simon.marchi@efficios.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230106185729.42372-1-simon.marchi@efficios.com> References: <20230106185729.42372-1-simon.marchi@efficios.com> MIME-Version: 1.0 X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1673031450 X-Barracuda-Encrypted: AES128-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-Scan-Msg-Size: 2055 X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=5.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.103363 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Spam-Status: No, score=-3498.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_SOFTFAIL, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Simon Marchi via Gdb-patches From: Simon Marchi Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" Use gdb_assert instead of manual pass/fail. Change-Id: I71fbc4e37a0a1ef4783056c7424e932651fa397f --- gdb/testsuite/gdb.dap/basic-dap.exp | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/gdb/testsuite/gdb.dap/basic-dap.exp b/gdb/testsuite/gdb.dap/basic-dap.exp index d3acf0c22c8..c60989d2a6f 100644 --- a/gdb/testsuite/gdb.dap/basic-dap.exp +++ b/gdb/testsuite/gdb.dap/basic-dap.exp @@ -75,12 +75,7 @@ set obj [dap_check_request_and_response "reset breakpoint by line number" \ [format {o source [o path [%s]] breakpoints [a [o line [i %d]]]} \ [list s $srcfile] $line]] set new_line_bpno [dap_get_breakpoint_number $obj] - -if {$new_line_bpno == $line_bpno} { - pass "re-setting kept same breakpoint number" -} else { - fail "re-setting kept same breakpoint number" -} +gdb_assert {$new_line_bpno == $line_bpno} "re-setting kept same breakpoint number" # This uses "&address_breakpoint_here" as the address -- this is a # hack because we know how this is implemented under the hood. @@ -131,21 +126,13 @@ dap_match_values "global value in main" [lindex $obj 0] \ set obj [dap_request_and_response "evaluate non-existing variable" \ evaluate {o expression [s nosuchvariable]}] set d [namespace eval ton::2dict [lindex $obj 0]] -if {[dict get $d success] == "false"} { - pass "result of invalid request" -} else { - fail "result of invalid request" -} +gdb_assert { [dict get $d success] == "false" } "result of invalid request" set obj [dap_check_request_and_response "disassemble one instruction" \ disassemble \ [format {o memoryReference [s %s] instructionCount [i 1]} \ $insn_pc]] set d [namespace eval ton::2dict [lindex $obj 0]] -if {[dict exists $d body instructions]} { - pass "instructions in disassemble output" -} else { - fail "instructions in disassemble output" -} +gdb_assert { [dict exists $d body instructions] } "instructions in disassemble output" dap_shutdown