[pushed,gdb/testsuite] Fix failure in gdb.python/py-startup-opt.exp
Checks
Commit Message
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
---
gdb/testsuite/gdb.python/py-startup-opt.exp | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
base-commit: 0c57d55c4479231bd63d6623d1bfbcb340ffdb20
@@ -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