]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2010-02-24 Phil Muldoon <pmuldoon@redhat.com>
authorPhil Muldoon <pmuldoon@redhat.com>
Wed, 24 Feb 2010 11:11:17 +0000 (11:11 +0000)
committerPhil Muldoon <pmuldoon@redhat.com>
Wed, 24 Feb 2010 11:11:17 +0000 (11:11 +0000)
PR python/11314
* lib/gdb.exp (skip_python_tests): New function.
* gdb.python/py-cmd.exp: Use skip_python_tests.
* gdb.python/py-frame.exp: Likewise.
* gdb.python/py-function.exp: Likewise.
* gdb.python/py-prettyprint.exp: Likewise.
* gdb.python/py-template.exp: Likewise.
* gdb.python/py-type.exp: Likewise.
* gdb.python/py-value.exp: Likewise.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.python/py-cmd.exp
gdb/testsuite/gdb.python/py-frame.exp
gdb/testsuite/gdb.python/py-function.exp
gdb/testsuite/gdb.python/py-prettyprint.exp
gdb/testsuite/gdb.python/py-template.exp
gdb/testsuite/gdb.python/py-type.exp
gdb/testsuite/gdb.python/py-value.exp
gdb/testsuite/lib/gdb.exp

index 701055312fd0d52e79db5107b58d5372b4510700..c81edff9c737388bd69b052275539da480ce6047 100644 (file)
@@ -1,3 +1,15 @@
+2010-02-24  Phil Muldoon  <pmuldoon@redhat.com>
+
+       PR python/11314
+       * lib/gdb.exp (skip_python_tests): New function.
+       * gdb.python/py-cmd.exp: Use skip_python_tests.
+       * gdb.python/py-frame.exp: Likewise.
+       * gdb.python/py-function.exp: Likewise.
+       * gdb.python/py-prettyprint.exp: Likewise.
+       * gdb.python/py-template.exp: Likewise.
+       * gdb.python/py-type.exp: Likewise.
+       * gdb.python/py-value.exp: Likewise.
+
 2010-02-22  Pedro Alves  <pedro@codesourcery.com>
 
        PR9605
index 2a3ed0d7f1ccdacddec5776e8c2ec97205a19415..d3c05ff45f3cffaf7366f14234aa61e85b506094 100644 (file)
@@ -44,13 +44,8 @@ gdb_exit
 gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 
-gdb_test_multiple "python print 'hello, world!'" "verify python support" {
-    -re "not supported.*$gdb_prompt $" {
-      unsupported "python support is disabled"
-      return -1
-    }
-    -re "$gdb_prompt $"        {}
-}
+# Skip all tests if Python scripting is not enabled.
+if { [skip_python_tests] } { continue }
 
 # Test a simple command.
 
index 86fe660b3125ee9d5189986fe07d146dc21e7a9d..698920799d20bb869e724eed4770b753fcfa26a5 100644 (file)
@@ -46,13 +46,8 @@ gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
-gdb_test_multiple "python print 'hello, world!'" "verify python support" {
-    -re "not supported.*$gdb_prompt $" {
-      unsupported "python support is disabled"
-      return -1
-    }
-    -re "$gdb_prompt $"        {}
-}
+# Skip all tests if Python scripting is not enabled.
+if { [skip_python_tests] } { continue }
 
 # The following tests require execution.
 
index 461295de42e9812fc6fe31f6a532b727c7e90afc..38c56934907f3251789021213ef73a72eed2585d 100644 (file)
@@ -44,13 +44,8 @@ gdb_exit
 gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 
-gdb_test_multiple "python print 'hello, world!'" "verify python support" {
-    -re "not supported.*$gdb_prompt $" {
-      unsupported "python support is disabled"
-      return -1
-    }
-    -re "$gdb_prompt $"        {}
-}
+# Skip all tests if Python scripting is not enabled.
+if { [skip_python_tests] } { continue }
 
 gdb_py_test_multiple "input convenience function" \
   "python" "" \
index 26268950d4431003b3835fc1af3dc84fc3411641..414362b13bf4e1a5c2bb12f29021a224da2ef77e 100644 (file)
@@ -27,13 +27,9 @@ set binfile ${objdir}/${subdir}/${testfile}
 # Start with a fresh gdb.
 gdb_exit
 gdb_start
-gdb_test_multiple "python print 'hello, world!'" "verify python support" {
-    -re "not supported.*$gdb_prompt $" {
-      unsupported "python support is disabled"
-      return -1
-    }
-    -re "$gdb_prompt $"        {}
-}
+
+# Skip all tests if Python scripting is not enabled.
+if { [skip_python_tests] } { continue }
 
 # Run a command in GDB, and report a failure if a Python exception is thrown.
 # If report_pass is true, report a pass if no exception is thrown.
index 713ad5f376383517e7fc49df14402b619254e9e7..9089de6ff3db5545b1e912cebc6d76a99dbba75a 100644 (file)
@@ -35,13 +35,8 @@ gdb_exit
 gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 
-gdb_test_multiple "python print 23" "verify python support" {
-    -re "not supported.*$gdb_prompt $" {
-      unsupported "python support is disabled"
-      return -1
-    }
-    -re "$gdb_prompt $"        {}
-}
+# Skip all tests if Python scripting is not enabled.
+if { [skip_python_tests] } { continue }
 
 proc test_template_arg {type} {
     global testfile srcdir subdir srcfile binfile
index ef74d8712b97849d85d73d6a6b8f44a836337022..63117ade3aa93d94d1c22f22eb210899fa8f70de 100644 (file)
@@ -34,8 +34,8 @@ proc build_inferior {lang} {
   }
 }
 
-# Restart GDB, set breakpoint and run to that breakpoint.
-proc restart_gdb {bp} {
+# Restart GDB.
+proc restart_gdb {} { 
   global srcdir subdir srcfile binfile testfile hex
 
   gdb_exit
@@ -47,12 +47,14 @@ proc restart_gdb {bp} {
       perror "couldn't run to breakpoint"
       return
   }
+}
 
+# Set breakpoint and run to that breakpoint.
+proc runto_bp {bp} {
   gdb_breakpoint [gdb_get_line_number $bp]
   gdb_continue_to_breakpoint $bp
 }
 
-
 # Run a command in GDB, and report a failure if a Python exception is thrown.
 # If report_pass is true, report a pass if no exception is thrown.
 proc gdb_py_test_silent_cmd {cmd name report_pass} {
@@ -127,21 +129,18 @@ proc test_range {} {
 
 # Perform C Tests.
 build_inferior "c"
-restart_gdb "break to inspect struct and array."
+restart_gdb 
 
-gdb_test_multiple "python print 'hello, world!'" "verify python support" {
-    -re "not supported.*$gdb_prompt $" {
-      unsupported "python support is disabled"
-      return -1
-    }
-    -re "$gdb_prompt $"        {}
-}
+# Skip all tests if Python scripting is not enabled.
+if { [skip_python_tests] } { continue }
 
+runto_bp "break to inspect struct and array."
 test_fields "c"
 
 # Perform C++ Tests.
 build_inferior "c++"
-restart_gdb "break to inspect struct and array."
+restart_gdb 
+runto_bp "break to inspect struct and array."
 test_fields "c++"
 test_base_class
 test_range
index d980a3d603af6c66ceeac5fadb18c92b0c862ec1..2b18e02c41d1ad108b4396ebdaeb48fbff298518 100644 (file)
@@ -394,13 +394,8 @@ gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
-gdb_test_multiple "python print 'hello, world!'" "verify python support" {
-    -re "not supported.*$gdb_prompt $" {
-      unsupported "python support is disabled"
-      return -1
-    }
-    -re "$gdb_prompt $"        {}
-}
+# Skip all tests if Python scripting is not enabled.
+if { [skip_python_tests] } { continue }
 
 test_value_creation
 test_value_numeric_ops
index 627941d6d1e62effe0309ce9898a0c8127dea9c9..8c18f331e1622d0db8f5f41ce60ece9272feadae 100644 (file)
@@ -1299,6 +1299,21 @@ proc skip_java_tests {} {
     return 0
 }
 
+# Return a 1 for configurations that do not support Python scripting.
+
+proc skip_python_tests {} {
+    global gdb_prompt
+    gdb_test_multiple "python print 'test'" "verify python support" {
+       -re "not supported.*$gdb_prompt $"      {
+           unsupported "Python support is disabled."
+           return 1
+       }
+       -re "$gdb_prompt $"     {}
+    }
+
+    return 0
+}
+
 # Return a 1 if we should skip shared library tests.
 
 proc skip_shlib_tests {} {