Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Fix gdb.base/auxv and gdb.base/cond-eval-mode test cases
@ 2012-03-16 14:29 Siddhesh Poyarekar
  2012-03-16 15:50 ` Pedro Alves
  0 siblings, 1 reply; 10+ messages in thread
From: Siddhesh Poyarekar @ 2012-03-16 14:29 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 463 bytes --]

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  <siddhesh@redhat.com>

	* gdb.base/auxv.exp: Disable corefile checks if ulimit-c is 0.
	* gdb.base/cond-eval-mode.exp: Fix the anticipated warning
	string

[-- Attachment #2: fix-test-cases.patch --]
[-- Type: text/plain, Size: 2154 bytes --]

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-03-19 18:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-16 14:29 [PATCH] Fix gdb.base/auxv and gdb.base/cond-eval-mode test cases Siddhesh Poyarekar
2012-03-16 15:50 ` Pedro Alves
2012-03-17  7:27   ` Siddhesh Poyarekar
2012-03-19  9:35     ` [commit] " Jan Kratochvil
2012-03-17  7:37   ` [PATCH] Fix core dump test case failure with a ulimit check in gdb.base/auxv.exp Siddhesh Poyarekar
2012-03-19  9:43     ` Jan Kratochvil
2012-03-19 15:57       ` Siddhesh Poyarekar
2012-03-19 16:13         ` Jan Kratochvil
2012-03-19 16:39           ` Siddhesh Poyarekar
2012-03-19 18:40             ` [commit] " Jan Kratochvil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox