aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2024-12-04 10:21:00 +0100
committerTom de Vries <tdevries@suse.de>2024-12-04 10:21:00 +0100
commit624fafc58befdaca88f744877d7c2d99b411e190 (patch)
treee900bed442a728adea80dfb6eb7417530948fce7 /gdb/testsuite/gdb.python
parent0c57d55c4479231bd63d6623d1bfbcb340ffdb20 (diff)
downloadgdb-624fafc58befdaca88f744877d7c2d99b411e190.zip
gdb-624fafc58befdaca88f744877d7c2d99b411e190.tar.gz
gdb-624fafc58befdaca88f744877d7c2d99b411e190.tar.bz2
[gdb/testsuite] Fix failure in gdb.python/py-startup-opt.exp
In commit 922ab963e1c ("[gdb/python] Handle empty PYTHONDONTWRITEBYTECODE") I added a test in gdb.python/py-startup-opt.exp that checks the "show python dont-write-bytecode" output. Then in commit 348290c7ef4 ("[gdb/python] Warn and ignore ineffective python settings") I changed the output of "show python dont-write-bytecode" after python initialization. I tested these changes individually, and found no problems but after committing both the test started failing, which the Linaro CI reported. Fix this by updating the expected output. While we're at it, make the test a bit more generic by testing "show python $setting" in all cases. Tested on x86_64-linux, using: - PYTHONDONTWRITEBYTECODE= - PYTHONDONTWRITEBYTECODE=1 - unset PYTHONDONTWRITEBYTECODE
Diffstat (limited to 'gdb/testsuite/gdb.python')
-rw-r--r--gdb/testsuite/gdb.python/py-startup-opt.exp12
1 files changed, 7 insertions, 5 deletions
diff --git a/gdb/testsuite/gdb.python/py-startup-opt.exp b/gdb/testsuite/gdb.python/py-startup-opt.exp
index df35a37..038814a 100644
--- a/gdb/testsuite/gdb.python/py-startup-opt.exp
+++ b/gdb/testsuite/gdb.python/py-startup-opt.exp
@@ -94,13 +94,15 @@ proc test_python_settings { exp_state } {
" print (\"${attr} is off\")" "" \
"end" "${attr} is ${answer}"
- if { $attr == "dont_write_bytecode" && $exp_state == "off" } {
+ if { $attr == "dont_write_bytecode" } {
set setting dont-write-bytecode
- set show_setting \
- "Python's $setting setting is auto (currently $answer)."
- gdb_test "show python $setting" \
- [string_to_regexp $show_setting]
+ } else {
+ set setting ignore-environment
}
+ set show_setting \
+ "Python's $setting setting is $answer."
+ gdb_test "show python $setting" \
+ [string_to_regexp $show_setting]
}
gdb_exit