]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite, tclint] Fix gdb.testsuite
authorTom de Vries <tdevries@suse.de>
Fri, 12 Sep 2025 04:59:57 +0000 (06:59 +0200)
committerTom de Vries <tdevries@suse.de>
Fri, 12 Sep 2025 04:59:57 +0000 (06:59 +0200)
Running tclint on the test-cases in gdb.testsuite shows a few problems:
...
board-sanity.exp:47:38: line has trailing whitespace [trailing-whitespace]
board-sanity.exp:83:1: line has trailing whitespace [trailing-whitespace]
board-sanity.exp:95:38: line has trailing whitespace [trailing-whitespace]
gdb-caching-proc-consistency.exp:66:2: expected braced word or word without \
  substitutions in argument interpreted as expr [command-args]
gdb-caching-proc-consistency.exp:117:12: eval received an argument with a \
  substitution, unable to parse its arguments [command-args]
with-override.exp:53:18: expression with substitutions should be enclosed by \
  braces [unbraced-expr]
with-override.exp:57:18: expression with substitutions should be enclosed by \
  braces [unbraced-expr]
...

Fix these.

Tested on x86_64-linux.

gdb/testsuite/gdb.testsuite/board-sanity.exp
gdb/testsuite/gdb.testsuite/gdb-caching-proc-consistency.exp
gdb/testsuite/gdb.testsuite/with-override.exp

index 9c802822f0f39f2154817c2dfba968305e880939..7b9a19e86b0428bf4bdb68c7f49f843bcb085346 100644 (file)
@@ -44,7 +44,7 @@ proc test_remote { remote host_is_target } {
        if { $host_is_target } {
            set res [remote_file $other_remote exists $file]
            gdb_assert { $res != $exists_ok } \
-               "$other_remote copy does not exist"     
+               "$other_remote copy does not exist"
        }
     }
 
@@ -80,7 +80,7 @@ proc test_remote { remote host_is_target } {
        set build_file [remote_upload $remote $file]
        gdb_assert { [string equal [file tail $build_file] $file] == 1 } \
            "remote_upload returns valid value"
-       
+
        set res [remote_file $remote delete $file]
        gdb_assert { [string equal $res $delete_ok] == 1 } \
            "remove $remote copy"
@@ -92,7 +92,7 @@ proc test_remote { remote host_is_target } {
        if { $host_is_target } {
            set res [remote_file $other_remote exists $file]
            gdb_assert { $res != $exists_ok } \
-               "$other_remote copy does not exist"     
+               "$other_remote copy does not exist"
        }
 
        set res [remote_file build exists $file]
index 4676a41803f484a5440fbdfd607b39cee9910851..27f905e9f64f9ab24c3e877f16064443a478d5da 100644 (file)
@@ -63,8 +63,8 @@ proc test_file { file } {
 
     set fp [open $file]
     while { [gets $fp line] >= 0 } {
-       if [regexp -- "^gdb_caching_proc \[ \t\]*(\[^ \t\]*)" $line \
-               match procname] {
+       if [regexp -- "^gdb_caching_proc \[ \t\]*(\[^ \t\]*)" $line \
+                 match procname] }  {
            lappend procnames $procname
        }
     }
@@ -114,7 +114,7 @@ if { ![gdb_simple_compile $me $src executable] } {
 }
 
 # Test gdb_caching_procs in gdb/testsuite/lib/*.exp
-set files [eval glob -types f $srcdir/lib/*.exp]
+set files [glob -types f $srcdir/lib/*.exp]
 set files [lsort $files]
 foreach file $files {
     test_file $file
index 91801501ee4b1b56bb8c331a7164bf1679b66b54..1a4ee6adbbb872a2372eb6532273a13cb35d89c1 100644 (file)
@@ -50,11 +50,11 @@ with_test_prefix no-args {
 }
 
 proc foo { {a 0} } {
-    return [expr $a + 1]
+    return [expr {$a + 1}]
 }
 
 proc foo_plus_1 { {a 0} } {
-    return [expr $a + 2]
+    return [expr {$a + 2}]
 }
 
 with_test_prefix default-arg {