[gdb/testsuite] Fix gdb.tui/new-layout.exp with tcl 8.5
authorTom de Vries <tdevries@suse.de>
Thu, 10 Dec 2020 22:44:49 +0000 (23:44 +0100)
committerTom de Vries <tdevries@suse.de>
Thu, 10 Dec 2020 22:44:49 +0000 (23:44 +0100)
In commit 4d91ddd342 "[gdb/testsuite] Fix unbalanced braces in
gdb.tui/new-layout.exp", I tried to fix a problem with test-case
gdb.tui/new-layout.exp when running with tcl 8.5.

However, at that point I only had access to the log containing the failure,
and unfortunately my patch turned out not to be effective.

So, finally fix this problem by guarding the problematic code with:
...
if { [tcl_version_at_least 8 6] } { ... }
...

Tested on x86_64-linux, specifically SLE-11 where I ran into the failure.

gdb/testsuite/ChangeLog:

2020-12-10  Tom de Vries  <tdevries@suse.de>

PR testsuite/26947
* gdb.tui/new-layout.exp: Don't execute tests with unbalanced curly
braces for tcl 8.5 and earlier.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.tui/new-layout.exp

index 09cd099b13f036b57e95676b0987ab66361746d5..e33626053eb9cd46eb39916f439cef11fced35ad 100644 (file)
@@ -1,3 +1,9 @@
+2020-12-10  Tom de Vries  <tdevries@suse.de>
+
+       PR testsuite/26947
+       * gdb.tui/new-layout.exp: Don't execute tests with unbalanced curly
+       braces for tcl 8.5 and earlier.
+
 2020-12-09  Simon Marchi  <simon.marchi@efficios.com>
 
        PR 26875, PR 26901
index d736e7f42f4409bd59790fa1617868b92082dcdc..cd9b15bcd98f1eb611d576e59bd4410544cef415 100644 (file)
@@ -44,12 +44,16 @@ gdb_test "tui new-layout example src 1 src 1" \
     "Window \"src\" seen twice in layout"
 gdb_test "tui new-layout example src 1" \
     "New layout does not contain the \"cmd\" window"
-gdb_test "tui new-layout example src 1\}" \
-    "Extra '\}' in layout specification"
-gdb_test "tui new-layout example {src 1} 1\}" \
-    "Extra '\}' in layout specification"
-gdb_test "tui new-layout example \{src 1" \
-    "Missing '\}' in layout specification"
+
+# Avoid unbalanced curly braces problems with tcl 8.5.
+if { [tcl_version_at_least 8 6] } {
+    gdb_test "tui new-layout example src 1\}" \
+       "Extra '\}' in layout specification"
+    gdb_test "tui new-layout example {src 1} 1\}" \
+       "Extra '\}' in layout specification"
+    gdb_test "tui new-layout example \{src 1" \
+       "Missing '\}' in layout specification"
+}
 
 gdb_test_no_output "tui new-layout example asm 1 status 0 cmd 1"
 
This page took 0.037205 seconds and 4 git commands to generate.