aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2025-02-13 16:43:39 +0000
committerAndrew Burgess <aburgess@redhat.com>2025-02-14 21:12:32 +0000
commita9764ef043b1dabe86f0445dd31b3df3a369ae41 (patch)
tree83ffe7bd8cbfd0c490446df376c74215d6136c0d /gdb/testsuite/gdb.python
parentf589ead3af31d50513428d930290443a59aed425 (diff)
downloadbinutils-a9764ef043b1dabe86f0445dd31b3df3a369ae41.zip
binutils-a9764ef043b1dabe86f0445dd31b3df3a369ae41.tar.gz
binutils-a9764ef043b1dabe86f0445dd31b3df3a369ae41.tar.bz2
gdb/testsuite: clean ups in gdb.python/py-source-styling.exp
The top comment in gdb.python/py-source-styling.exp was completely wrong, clearly a cut&paste job from elsewhere. Write a comment that actually reflects what the test does. I've also moved the allow_python_tests check earlier in the file. And I changed some 'return -1' into just 'return'. I'm not aware that the '-1' adds any value. I also folded a 'pass $gdb_test_name' into the preceding gdb_assert, which I think is neater. There is no change in what is actually being tested after this commit. Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/testsuite/gdb.python')
-rw-r--r--gdb/testsuite/gdb.python/py-source-styling.exp16
1 files changed, 8 insertions, 8 deletions
diff --git a/gdb/testsuite/gdb.python/py-source-styling.exp b/gdb/testsuite/gdb.python/py-source-styling.exp
index 7b5c1b0..a406771 100644
--- a/gdb/testsuite/gdb.python/py-source-styling.exp
+++ b/gdb/testsuite/gdb.python/py-source-styling.exp
@@ -13,8 +13,11 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# This file is part of the GDB testsuite. It checks for memory leaks
-# associated with allocating and deallocation gdb.Inferior objects.
+# Check that the Python pygments module can be used for source
+# highlighting when GNU source highlight is not available (or is
+# disabled, as is done in this test).
+
+require allow_python_tests
load_lib gdb-python.exp
@@ -26,14 +29,12 @@ with_ansi_styling_terminal {
# capable, otherwise we'll get a UnicodeEncodeError trying to
# encode the output.
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
- return -1
+ return
}
- if { ![allow_python_tests] } { continue }
-
if { ![gdb_py_module_available "pygments"] } {
unsupported "pygments module not available"
- return -1
+ return
}
if ![runto_main] {
@@ -55,8 +56,7 @@ with_ansi_styling_terminal {
exp_continue
}
-re "$gdb_prompt $" {
- gdb_assert { $seen_style_escape }
- pass $gdb_test_name
+ gdb_assert { $seen_style_escape } $gdb_test_name
}
}
}