aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-01-06 20:36:38 -0700
committerTom Tromey <tom@tromey.com>2023-01-13 13:18:56 -0700
commit222ef1693c7a2abe00f0297405c8fe7e135d050e (patch)
tree2380c4ade7f8e6995f018127de403213784c8e9a /gdb
parent4b075c16ef8d28c238892acf51ec7d672f4db929 (diff)
downloadfsf-binutils-gdb-222ef1693c7a2abe00f0297405c8fe7e135d050e.zip
fsf-binutils-gdb-222ef1693c7a2abe00f0297405c8fe7e135d050e.tar.gz
fsf-binutils-gdb-222ef1693c7a2abe00f0297405c8fe7e135d050e.tar.bz2
Rewrite skip_python_tests
This rewrites skip_python_tests to examine the output of "gdb --configuration". This is a bit nicer because it does not require an already-running gdb.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/lib/gdb.exp24
-rw-r--r--gdb/testsuite/lib/mi-support.exp5
2 files changed, 4 insertions, 25 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 3d416f9..64eef97 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -2449,28 +2449,10 @@ proc skip_rust_tests {} {
}
# Return a 1 for configurations that do not support Python scripting.
-# PROMPT_REGEXP is the expected prompt.
-proc skip_python_tests_prompt { prompt_regexp } {
- gdb_test_multiple "python print ('test')" "verify python support" \
- -prompt "$prompt_regexp" {
- -re "not supported.*$prompt_regexp" {
- unsupported "Python support is disabled."
- return 1
- }
- -re "$prompt_regexp" {}
- }
-
- return 0
-}
-
-# Return a 1 for configurations that do not support Python scripting.
-# Note: This also sets various globals that specify which version of Python
-# is in use. See skip_python_tests_prompt.
-
-proc skip_python_tests {} {
- global gdb_prompt
- return [skip_python_tests_prompt "$gdb_prompt $"]
+gdb_caching_proc skip_python_tests {
+ set output [remote_exec host $::GDB --configuration]
+ return [expr {[string first "--with-python" $output] == -1}]
}
# Return a 1 if we should skip shared library tests.
diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
index 1ee087d..f756cbe 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -2735,12 +2735,9 @@ proc mi_make_breakpoint_table {bp_list} {
}
# Return a 1 for configurations that do not support Python scripting.
-# Note: This also sets various globals that specify which version of Python
-# is in use. See skip_python_tests_prompt.
proc mi_skip_python_tests {} {
- global mi_gdb_prompt
- return [skip_python_tests_prompt "$mi_gdb_prompt$"]
+ return [skip_python_tests]
}
# As skip_libstdcxx_probe_tests_prompt, with mi_gdb_prompt.