diff options
| author | Phil Muldoon <pmuldoon@redhat.com> | 2010-02-24 11:11:17 +0000 |
|---|---|---|
| committer | Phil Muldoon <pmuldoon@redhat.com> | 2010-02-24 11:11:17 +0000 |
| commit | f6bbabf05407ec9e8efb75d31fedf122bc2fdc90 (patch) | |
| tree | a15ada6b720389d2b42108636f2549b7bd3b51ba /gdb/testsuite/gdb.python | |
| parent | a79b8f6ea8c26650ad9b6f29e3df46f86f4f3530 (diff) | |
| download | ppe42-binutils-f6bbabf05407ec9e8efb75d31fedf122bc2fdc90.tar.gz ppe42-binutils-f6bbabf05407ec9e8efb75d31fedf122bc2fdc90.zip | |
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.
Diffstat (limited to 'gdb/testsuite/gdb.python')
| -rw-r--r-- | gdb/testsuite/gdb.python/py-cmd.exp | 9 | ||||
| -rw-r--r-- | gdb/testsuite/gdb.python/py-frame.exp | 9 | ||||
| -rw-r--r-- | gdb/testsuite/gdb.python/py-function.exp | 9 | ||||
| -rw-r--r-- | gdb/testsuite/gdb.python/py-prettyprint.exp | 10 | ||||
| -rw-r--r-- | gdb/testsuite/gdb.python/py-template.exp | 9 | ||||
| -rw-r--r-- | gdb/testsuite/gdb.python/py-type.exp | 23 | ||||
| -rw-r--r-- | gdb/testsuite/gdb.python/py-value.exp | 9 |
7 files changed, 24 insertions, 54 deletions
diff --git a/gdb/testsuite/gdb.python/py-cmd.exp b/gdb/testsuite/gdb.python/py-cmd.exp index 2a3ed0d7f1..d3c05ff45f 100644 --- a/gdb/testsuite/gdb.python/py-cmd.exp +++ b/gdb/testsuite/gdb.python/py-cmd.exp @@ -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. diff --git a/gdb/testsuite/gdb.python/py-frame.exp b/gdb/testsuite/gdb.python/py-frame.exp index 86fe660b31..698920799d 100644 --- a/gdb/testsuite/gdb.python/py-frame.exp +++ b/gdb/testsuite/gdb.python/py-frame.exp @@ -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. diff --git a/gdb/testsuite/gdb.python/py-function.exp b/gdb/testsuite/gdb.python/py-function.exp index 461295de42..38c5693490 100644 --- a/gdb/testsuite/gdb.python/py-function.exp +++ b/gdb/testsuite/gdb.python/py-function.exp @@ -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" "" \ diff --git a/gdb/testsuite/gdb.python/py-prettyprint.exp b/gdb/testsuite/gdb.python/py-prettyprint.exp index 26268950d4..414362b13b 100644 --- a/gdb/testsuite/gdb.python/py-prettyprint.exp +++ b/gdb/testsuite/gdb.python/py-prettyprint.exp @@ -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. diff --git a/gdb/testsuite/gdb.python/py-template.exp b/gdb/testsuite/gdb.python/py-template.exp index 713ad5f376..9089de6ff3 100644 --- a/gdb/testsuite/gdb.python/py-template.exp +++ b/gdb/testsuite/gdb.python/py-template.exp @@ -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 diff --git a/gdb/testsuite/gdb.python/py-type.exp b/gdb/testsuite/gdb.python/py-type.exp index ef74d8712b..63117ade3a 100644 --- a/gdb/testsuite/gdb.python/py-type.exp +++ b/gdb/testsuite/gdb.python/py-type.exp @@ -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 diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp index d980a3d603..2b18e02c41 100644 --- a/gdb/testsuite/gdb.python/py-value.exp +++ b/gdb/testsuite/gdb.python/py-value.exp @@ -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 |

