From patchwork Thu Aug 16 21:48:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Seitz X-Patchwork-Id: 28942 Received: (qmail 106413 invoked by alias); 16 Aug 2018 21:49:10 -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 102058 invoked by uid 89); 16 Aug 2018 21:48:40 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Keith, Seitz, seitz, keith X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 16 Aug 2018 21:48:39 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 809AA308FBAB for ; Thu, 16 Aug 2018 21:48:28 +0000 (UTC) Received: from theo.uglyboxes.com (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4A53C5D6A8 for ; Thu, 16 Aug 2018 21:48:28 +0000 (UTC) From: Keith Seitz To: gdb-patches@sourceware.org Subject: [PATCH] Use gdb_test_no_output for compile tests expected to pass Date: Thu, 16 Aug 2018 14:48:27 -0700 Message-Id: <20180816214827.21559-1-keiths@redhat.com> X-IsSubscribed: yes There is a small think-o in compile.exp: if { $srcfile3 != "" } { gdb_test "p constvar" " = 3" gdb_test "info addr constvar" {Symbol "constvar" is constant\.} gdb_test "compile code globalvar = constvar;"; # INCORRECT gdb_test "print globalvar" " = 3" "print constvar value" } else { untested "print constvar value" } The line marked INCORRECT runs a simple "compile code" which is expected to succeed. When this happens, the compile plug-in and GDB will not output anything. The use of gdb_test matches against anything. This is certainly not the intent, and this patch corrects the two instances of this in the file. [The rest of gdb.compile looks okay.] testsuite/ChangeLog: * gdb.compile/compile.exp: Use gdb_test_no_output for "compile code" tests expected to pass. --- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/gdb.compile/compile.exp | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 1b4dde59bb..292e0ca1ae 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +YYYY-MM-DD Keith Seitz + + * gdb.compile/compile.exp: Use gdb_test_no_output for "compile code" + tests expected to pass. + 2018-08-14 Jan Vrany * gdb.mi/mi-disassemble.exp (test_disassembly_only): Add tests for diff --git a/gdb/testsuite/gdb.compile/compile.exp b/gdb/testsuite/gdb.compile/compile.exp index 4303c02f26..2ed5577752 100644 --- a/gdb/testsuite/gdb.compile/compile.exp +++ b/gdb/testsuite/gdb.compile/compile.exp @@ -256,7 +256,7 @@ gdb_test "print union_object.intfield" " = 7" # LOC_UNRESOLVED tests. gdb_test "print unresolved" " = 20" -gdb_test "compile code globalvar = unresolved;" +gdb_test_no_output "compile code globalvar = unresolved;" gdb_test "print globalvar" " = 20" "print unresolved value" # Test shadowing with global and static variables. @@ -353,7 +353,7 @@ if { $srcfile3 != "" } { gdb_test "p constvar" " = 3" gdb_test "info addr constvar" {Symbol "constvar" is constant\.} - gdb_test "compile code globalvar = constvar;" + gdb_test_no_output "compile code globalvar = constvar;" gdb_test "print globalvar" " = 3" "print constvar value" } else { untested "print constvar value"