From patchwork Mon Oct 23 14:18:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 23765 Received: (qmail 15806 invoked by alias); 23 Oct 2017 14:18:35 -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 15746 invoked by uid 89); 23 Oct 2017 14:18:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=4623 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; Mon, 23 Oct 2017 14:18:33 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0E558C0641F2 for ; Mon, 23 Oct 2017 14:18:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0E558C0641F2 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves@redhat.com Received: from cascais.lan (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7C2067A1E2 for ; Mon, 23 Oct 2017 14:18:31 +0000 (UTC) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 4/6] Fix unstable test names in gdb.python/py-objfile.exp Date: Mon, 23 Oct 2017 15:18:25 +0100 Message-Id: <1508768307-11531-5-git-send-email-palves@redhat.com> In-Reply-To: <1508768307-11531-1-git-send-email-palves@redhat.com> References: <1508768307-11531-1-git-send-email-palves@redhat.com> Currently, if you diff testsuite/gdb.sum of different builds you see this spurious hunk: -PASS: gdb.python/py-objfile.exp: get python valueof "sep_objfile.build_id" (6a0bfcab663f9810ccff33c756afdebb940037d4) +PASS: gdb.python/py-objfile.exp: get python valueof "sep_objfile.build_id" (1f5531c657c57777b05fc95baa0025fd1d115c3b) Fix this by syncing get_python_valueof with get_integer_valueof, which stopped outputting the value in commit 2f20e312aad6 ("get_integer_valueof: Don't output value in test name"). After this commit we'll show: PASS: gdb.python/py-objfile.exp: get python valueof "sep_objfile.build_id" As the comment explicitly says get_python_valueof is modeled on get_integer_valueof, I went ahead and also added the optional 'test' parameter while at it. gdb/testsuite/ChangeLog: yyyy-mm-dd Pedro Alves * lib/gdb-python.exp (get_python_valueof): Add 'test' optional parameter and handle it. Don't output read value in test name. --- gdb/testsuite/lib/gdb-python.exp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/gdb/testsuite/lib/gdb-python.exp b/gdb/testsuite/lib/gdb-python.exp index 1fef27e..c0c0d68 100644 --- a/gdb/testsuite/lib/gdb-python.exp +++ b/gdb/testsuite/lib/gdb-python.exp @@ -46,19 +46,23 @@ proc gdb_py_test_multiple { name args } { return 0 } -# Return the result of python expression EXPR. -# DEFAULT is returned if there's an error. -# This is modelled after get_integer_valueof. +# Return the result of python expression EXPR. DEFAULT is returned if +# there's an error. TEST is the test message to use. It can be +# omitted, in which case a test message is built from EXP. This is +# modeled after get_integer_valueof. -proc get_python_valueof { exp default } { +proc get_python_valueof { exp default {test ""} } { global gdb_prompt - set test "get python valueof \"${exp}\"" + if {$test == ""} { + set test "get python valueof \"${exp}\"" + } + set val ${default} gdb_test_multiple "python print (\"valueof: %s\" % (${exp}))" "$test" { -re "valueof: (\[^\r\n\]*)\[\r\n\]*$gdb_prompt $" { set val $expect_out(1,string) - pass "$test ($val)" + pass "$test" } timeout { fail "$test (timeout)"