From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17136 invoked by alias); 21 Feb 2011 11:41:05 -0000 Received: (qmail 17126 invoked by uid 22791); 21 Feb 2011 11:41:04 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 21 Feb 2011 11:40:53 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id C26032BAC35; Mon, 21 Feb 2011 06:40:51 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 4JW2F-npmBRE; Mon, 21 Feb 2011 06:40:51 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 497542BAC33; Mon, 21 Feb 2011 06:40:51 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 5E8ED1459B0; Mon, 21 Feb 2011 15:40:45 +0400 (RET) From: Joel Brobecker To: gdb-patches@sourceware.org Cc: Joel Brobecker Subject: [RFA/testsuite] minor adjustments in gdb.python/py-block.exp Date: Mon, 21 Feb 2011 11:50:00 -0000 Message-Id: <1298288444-21605-1-git-send-email-brobecker@adacore.com> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-02/txt/msg00537.txt.bz2 Hello, I wouldn't mind a spot-check on this patch, particularly in the use of prepare_for_testing. I think it's correct, and it works on x86_64-linux, but my command of TCL sometimes tricks me. gdb/testsuite/ChangeLog: * gdb.python/py-block.exp: Simplify using prepare_for_testing. Delete variable binfile, no longer use. Add or modify test comments to make them unique. Tested on x86_64-linux. Thanks, -- Joel --- gdb/testsuite/gdb.python/py-block.exp | 20 +++++++------------- 1 files changed, 7 insertions(+), 13 deletions(-) diff --git a/gdb/testsuite/gdb.python/py-block.exp b/gdb/testsuite/gdb.python/py-block.exp index b1a49d6..c400df7 100644 --- a/gdb/testsuite/gdb.python/py-block.exp +++ b/gdb/testsuite/gdb.python/py-block.exp @@ -24,18 +24,10 @@ load_lib gdb-python.exp set testfile "py-block" set srcfile ${testfile}.c -set binfile ${objdir}/${subdir}/${testfile} -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { - untested "Couldn't compile ${srcfile}" +if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } { return -1 } -# Start with a fresh gdb. -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} - # Skip all tests if Python scripting is not enabled. if { [skip_python_tests] } { continue } @@ -60,11 +52,13 @@ gdb_test "python print block.end" "${decimal}" "Check end not None" gdb_test_no_output "python block = block.superblock" "Get superblock" gdb_test "python print block.function" "None" "Second anonymous block" gdb_test_no_output "python block = block.superblock" "Get superblock 2" -gdb_test "python print block.function" "block_func" +gdb_test "python print block.function" "block_func" \ + "Print superblock 2 function" # Switch frames, then test for main block. gdb_test "up" ".*" -gdb_py_test_silent_cmd "python frame = gdb.selected_frame()" "Get Frame" 0 -gdb_py_test_silent_cmd "python block = frame.block()" "Get block" 0 -gdb_test "python print block" "" "Check block not None" +gdb_py_test_silent_cmd "python frame = gdb.selected_frame()" "Get Frame 2" 0 +gdb_py_test_silent_cmd "python block = frame.block()" "Get Frame 2's block" 0 +gdb_test "python print block" "" \ + "Check Frame 2's block not None" gdb_test "python print block.function" "main" "main block" -- 1.7.1