From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24243 invoked by alias); 16 Mar 2012 14:29:11 -0000 Received: (qmail 24233 invoked by uid 22791); 16 Mar 2012 14:29:10 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 16 Mar 2012 14:28:54 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q2GESrKa001182 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 16 Mar 2012 10:28:53 -0400 Received: from spoyarek.pnq.redhat.com (dhcp233-8.pnq.redhat.com [10.65.223.8] (may be forged)) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q2GESnC4030777 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Fri, 16 Mar 2012 10:28:52 -0400 Date: Fri, 16 Mar 2012 14:29:00 -0000 From: Siddhesh Poyarekar To: gdb-patches@sourceware.org Subject: [PATCH] Fix gdb.base/auxv and gdb.base/cond-eval-mode test cases Message-ID: <20120316143002.GB22830@spoyarek.pnq.redhat.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="oyUTqETQ0mS9luUI" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) 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: 2012-03/txt/msg00607.txt.bz2 --oyUTqETQ0mS9luUI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 463 Hi, The auxv test case gives a test case failure when ulimit -c is 0. I have added a check to disable the test if ulimit is 0. Further, the cond-eval-mode test looks for the wrong message, again resulting in a spurious test failure. Regards, Siddhesh testsuite/ChangeLog: 2012-03-16 Siddhesh Poyarekar * gdb.base/auxv.exp: Disable corefile checks if ulimit-c is 0. * gdb.base/cond-eval-mode.exp: Fix the anticipated warning string --oyUTqETQ0mS9luUI Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="fix-test-cases.patch" Content-length: 2154 diff --git a/gdb/testsuite/gdb.base/auxv.exp b/gdb/testsuite/gdb.base/auxv.exp index da10f05..e1b8cb0 100644 --- a/gdb/testsuite/gdb.base/auxv.exp +++ b/gdb/testsuite/gdb.base/auxv.exp @@ -42,8 +42,19 @@ set coredir "${objdir}/${subdir}/coredir.[getpid]" file mkdir $coredir set core_works [expr [isnative] && ! [is_remote target]] -# Run GDB on the test program up to where it will dump core. +global gdb_prompt + +gdb_exit +gdb_start +send_gdb "shell ulimit -c\n" +gdb_expect { + -re "0\r\n$gdb_prompt $" { + warning "ulimit -c is 0, disabling core tests" + set core_works 0 + } +} +# Run GDB on the test program up to where it will dump core. gdb_exit gdb_start gdb_reinitialize_dir $srcdir/$subdir @@ -51,11 +62,9 @@ gdb_load ${binfile} gdb_test_no_output "set print sevenbit-strings" gdb_test_no_output "set width 0" -if {$core_works} { - if {[gdb_test "cd $coredir" ".*Working directory .*" \ - "cd to temporary directory for core dumps"]} { - set core_works 0 - } +if {[gdb_test "cd $coredir" ".*Working directory .*" \ + "cd to temporary directory for core dumps"]} { + set core_works 0 } if { ![runto_main] } then { @@ -154,7 +163,7 @@ if {$core_works} { pass $test } else { set core_works 0 - warning "can't generate a core file - core tests suppressed - check ulimit -c" + warning "can't generate a core file - core tests suppressed" fail $test } } else { diff --git a/gdb/testsuite/gdb.base/cond-eval-mode.exp b/gdb/testsuite/gdb.base/cond-eval-mode.exp index dbbfc28..965c497 100644 --- a/gdb/testsuite/gdb.base/cond-eval-mode.exp +++ b/gdb/testsuite/gdb.base/cond-eval-mode.exp @@ -30,7 +30,7 @@ gdb_test_no_output $test_auto # If target-side condition evaluation is not supported, this warning will be # displayed. -set warning "warning: Target does not support breakpoint condition evaluation.\r\nUsing GDB evaluation mode instead.\r\n" +set warning "warning: Target does not support breakpoint condition evaluation.\r\nUsing host evaluation mode instead.\r\n" gdb_test_multiple $test_target $test_target { -re "$warning$gdb_prompt $" { -- 1.7.7.4 --oyUTqETQ0mS9luUI--