aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog15
-rw-r--r--baseboards/androideabi.exp4
-rw-r--r--baseboards/arm-ice.exp2
-rw-r--r--baseboards/arm-sim.exp2
-rw-r--r--baseboards/i386-sid.exp2
-rw-r--r--baseboards/mips-sim-idt32.exp2
-rw-r--r--baseboards/mips-sim-idt64.exp2
-rw-r--r--baseboards/mips-sim.exp2
-rw-r--r--baseboards/mt-sid.exp2
-rw-r--r--baseboards/sh-sid.exp2
-rw-r--r--baseboards/vr4100-sim.exp2
-rw-r--r--baseboards/vr4111-sim.exp2
-rw-r--r--baseboards/vr4300-sim.exp2
-rw-r--r--config/aarch64-fv8.exp2
-rw-r--r--config/gdb_stub.exp4
-rw-r--r--config/sim.exp4
-rw-r--r--config/vxworks.exp2
-rw-r--r--lib/dg.exp20
-rw-r--r--lib/framework.exp6
-rw-r--r--lib/remote.exp34
-rw-r--r--lib/target.exp40
-rw-r--r--lib/targetdb.exp2
-rw-r--r--lib/utils.exp8
-rw-r--r--runtest.exp22
-rw-r--r--testsuite/runtest.all/target.test4
-rw-r--r--testsuite/runtest.all/utils.test4
26 files changed, 104 insertions, 89 deletions
diff --git a/ChangeLog b/ChangeLog
index e2fc784..e770be3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,20 @@
2018-12-08 Ben Elliston <bje@gnu.org>
+ * runtest.exp, lib/utils.exp, lib/targetdb.exp, lib/target.exp,
+ lib/remote.exp, lib/framework.exp, lib/dg.exp, config/vxworks.exp,
+ config/sim.exp, config/gdb_stub.exp, config/aarch64-fv8.exp,
+ baseboards/vr4300-sim.exp, baseboards/vr4111-sim.exp,
+ baseboards/vr4100-sim.exp, baseboards/sh-sid.exp,
+ baseboards/mt-sid.exp, baseboards/mips-sim.exp,
+ baseboards/mips-sim-idt64.exp, baseboards/mips-sim-idt32.exp,
+ baseboards/i386-sid.exp, baseboards/arm-sim.exp,
+ baseboards/arm-ice.exp, baseboards/androideabi.exp,
+ testsuite/runtest.all/utils.test,
+ testsuite/runtest.all/target.test: Replace string literal
+ comparisons using == and != with 'eq' and 'ne'.
+
+2018-12-08 Ben Elliston <bje@gnu.org>
+
* runtest.exp, lib/utils.exp, lib/target.exp, lib/ssh.exp,
lib/rsh.exp, lib/rlogin.exp, lib/remote.exp, lib/libgloss.exp,
lib/framework.exp, lib/dg.exp, lib/dejagnu.exp,
diff --git a/baseboards/androideabi.exp b/baseboards/androideabi.exp
index 8a29ab6..f6dda2a 100644
--- a/baseboards/androideabi.exp
+++ b/baseboards/androideabi.exp
@@ -71,10 +71,10 @@ proc adb_load { dest prog args } {
return "unresolved"
}
set retval [remote_exec $dest "test -x $remotefile"]
- if { $retval != "0 {}" } {
+ if { $retval ne "0 {}" } {
# Android doesn't support symbolic input for chmod, therefore set executable permission by number
set retval [remote_exec $dest "chmod 755 $remotefile"]
- if { $retval != "0 {}" } {
+ if { $retval ne "0 {}" } {
verbose -log "Setting executable permissions of $prog on [board_info $dest name] failed." 3
return "unresolved"
}
diff --git a/baseboards/arm-ice.exp b/baseboards/arm-ice.exp
index 3dc5d39..6b698b2 100644
--- a/baseboards/arm-ice.exp
+++ b/baseboards/arm-ice.exp
@@ -23,7 +23,7 @@ load_generic_config "gdb-comm"
# No multilib flags needed by default.
process_multilib_options ""
-if { [board_info $board obj_format] == "pe" } {
+if { [board_info $board obj_format] eq "pe" } {
set additional_options "-Wl,-oformat,pe-arm-little,--image-base,0"
} else {
set additional_options ""
diff --git a/baseboards/arm-sim.exp b/baseboards/arm-sim.exp
index d63d9d9..ca8f8c2 100644
--- a/baseboards/arm-sim.exp
+++ b/baseboards/arm-sim.exp
@@ -23,7 +23,7 @@ load_generic_config "sim"
# No multilib flags needed by default.
process_multilib_options ""
-if { [board_info $board obj_format] == "pe" } {
+if { [board_info $board obj_format] eq "pe" } {
set additional_options "-Wl,-oformat,pe-arm-little,--image-base,0"
# set_board_info uses_underscores 1
} else {
diff --git a/baseboards/i386-sid.exp b/baseboards/i386-sid.exp
index 0b2f5db..3e5abb7 100644
--- a/baseboards/i386-sid.exp
+++ b/baseboards/i386-sid.exp
@@ -28,7 +28,7 @@ set_board_info ldflags "-nostdlib [libgloss_link_flags] [newlib_link_flags]"
set_board_info ldscript "-Tcygmon.ld"
set_board_info gdb,start_symbol "__start"
-if { ${tool} == "gdb" } {
+if { ${tool} eq "gdb" } {
set_board_info sim,options "-f [find_sid_conf i386-gdb]"
} else {
set_board_info sim,options "-f [find_sid_conf i386-gloss]"
diff --git a/baseboards/mips-sim-idt32.exp b/baseboards/mips-sim-idt32.exp
index 1ffb258..a16529a 100644
--- a/baseboards/mips-sim-idt32.exp
+++ b/baseboards/mips-sim-idt32.exp
@@ -38,7 +38,7 @@ set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]"
set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]"
# Use idt.
-if { [board_info $board obj_format] == "ecoff" } {
+if { [board_info $board obj_format] eq "ecoff" } {
set_board_info ldscript "-Tidtecoff.ld"
} else {
set_board_info ldscript "-Tidt32.ld"
diff --git a/baseboards/mips-sim-idt64.exp b/baseboards/mips-sim-idt64.exp
index 959943a..d85acd1 100644
--- a/baseboards/mips-sim-idt64.exp
+++ b/baseboards/mips-sim-idt64.exp
@@ -38,7 +38,7 @@ set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]"
set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]"
# Use idt.
-if { [board_info $board obj_format] == "ecoff" } {
+if { [board_info $board obj_format] eq "ecoff" } {
set_board_info ldscript "-Tidtecoff.ld"
} else {
set_board_info ldscript "-Tidt64.ld"
diff --git a/baseboards/mips-sim.exp b/baseboards/mips-sim.exp
index a3f8214..aea34ce 100644
--- a/baseboards/mips-sim.exp
+++ b/baseboards/mips-sim.exp
@@ -37,7 +37,7 @@ set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]"
set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]"
# Use idt.
-if { [board_info $board obj_format] == "ecoff" } {
+if { [board_info $board obj_format] eq "ecoff" } {
set_board_info ldscript "-Tidtecoff.ld"
} else {
set_board_info ldscript "-Tidt.ld"
diff --git a/baseboards/mt-sid.exp b/baseboards/mt-sid.exp
index 6949dcb..52700a3 100644
--- a/baseboards/mt-sid.exp
+++ b/baseboards/mt-sid.exp
@@ -26,7 +26,7 @@ set_board_info ldflags "-msim [libgloss_link_flags] [newlib_link_flags]"
verbose "Using simulator [board_info $board sim]\n"
set_board_info sim [find_rawsid]
-if { ${tool} == "gdb" } {
+if { ${tool} eq "gdb" } {
set_board_info sim,options "-f [find_sid_conf mt-gdb]"
} else {
set_board_info sim,options "-f [find_sid_conf mt-gloss]"
diff --git a/baseboards/sh-sid.exp b/baseboards/sh-sid.exp
index 0c3b282..537ec76 100644
--- a/baseboards/sh-sid.exp
+++ b/baseboards/sh-sid.exp
@@ -26,7 +26,7 @@ process_multilib_options ""
verbose "Using simulator [board_info $board sim]\n"
set_board_info sim [find_rawsid]
-if { ${tool} == "gdb" } {
+if { ${tool} eq "gdb" } {
set_board_info sim,options "-f [find_sid_conf sh-gdb]"
} else {
set_board_info sim,options "-f [find_sid_conf sh-gloss]"
diff --git a/baseboards/vr4100-sim.exp b/baseboards/vr4100-sim.exp
index 2e229b8..2d24356 100644
--- a/baseboards/vr4100-sim.exp
+++ b/baseboards/vr4100-sim.exp
@@ -17,7 +17,7 @@
# Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
# DDB linker script.
-if { [board_info $board obj_format] == "ecoff" } {
+if { [board_info $board obj_format] eq "ecoff" } {
set_board_info ldscript "-Tddbecoff.ld"
} else {
set_board_info ldscript "-Tddb.ld"
diff --git a/baseboards/vr4111-sim.exp b/baseboards/vr4111-sim.exp
index 2e229b8..2d24356 100644
--- a/baseboards/vr4111-sim.exp
+++ b/baseboards/vr4111-sim.exp
@@ -17,7 +17,7 @@
# Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
# DDB linker script.
-if { [board_info $board obj_format] == "ecoff" } {
+if { [board_info $board obj_format] eq "ecoff" } {
set_board_info ldscript "-Tddbecoff.ld"
} else {
set_board_info ldscript "-Tddb.ld"
diff --git a/baseboards/vr4300-sim.exp b/baseboards/vr4300-sim.exp
index 2e229b8..2d24356 100644
--- a/baseboards/vr4300-sim.exp
+++ b/baseboards/vr4300-sim.exp
@@ -17,7 +17,7 @@
# Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
# DDB linker script.
-if { [board_info $board obj_format] == "ecoff" } {
+if { [board_info $board obj_format] eq "ecoff" } {
set_board_info ldscript "-Tddbecoff.ld"
} else {
set_board_info ldscript "-Tddb.ld"
diff --git a/config/aarch64-fv8.exp b/config/aarch64-fv8.exp
index 17a0efc..fa7fddf 100644
--- a/config/aarch64-fv8.exp
+++ b/config/aarch64-fv8.exp
@@ -32,7 +32,7 @@ proc ${board}_download { dest file args } {
# Extract the endianess of the executable
set status [catch "exec od -An -v -j5 -N1 -t x1 $file" bigendian]
set args "--quiet"
- if { $bigendian == "02"} {
+ if { $bigendian eq "02"} {
set args "$args --bigendian"
}
diff --git a/config/gdb_stub.exp b/config/gdb_stub.exp
index b86c8e5..d776b84 100644
--- a/config/gdb_stub.exp
+++ b/config/gdb_stub.exp
@@ -347,7 +347,7 @@ proc gdb_stub_start { dest } {
global gdb_prompt
set exit_brnum [gdb_stub_add_breakpoint _exit]
- if { $exit_brnum == "undef" || [board_info $dest exists always_break_exit] } {
+ if { $exit_brnum eq "undef" || [board_info $dest exists always_break_exit] } {
set exit_brnum [gdb_stub_add_breakpoint exit]
}
set abort_brnum [gdb_stub_add_breakpoint abort]
@@ -399,7 +399,7 @@ proc gdb_stub_spawn { dest prog args } {
}
set result [gdb_stub_start $dest]
- if { [lindex $result 0] != "pass" } {
+ if { [lindex $result 0] ne "pass" } {
remote_reboot target
} else {
return 666; # does anyone use this value?
diff --git a/config/sim.exp b/config/sim.exp
index 8d9088c..2a66731 100644
--- a/config/sim.exp
+++ b/config/sim.exp
@@ -81,9 +81,9 @@ proc sim_load { dest prog args } {
set output ""
- if { [board_info target sim,protocol] == "sid" } {
+ if { [board_info target sim,protocol] eq "sid" } {
set cmd "-e \"set cpu-loader file [list $prog]\""
- } elseif { [board_info target sim,protocol] == "rawsid" } {
+ } elseif { [board_info target sim,protocol] eq "rawsid" } {
set cmd "--load=$prog"
} else {
set cmd $prog
diff --git a/config/vxworks.exp b/config/vxworks.exp
index 86ac884..7acb234 100644
--- a/config/vxworks.exp
+++ b/config/vxworks.exp
@@ -425,7 +425,7 @@ proc vxworks_unld { dest } {
if {[board_info $dest exists vx_module]} {
# Vxworks5.0 does not have the unld command.
- if { [board_info $dest os] != "vxworks5.0" } {
+ if { [board_info $dest os] ne "vxworks5.0" } {
remote_exec $dest "unld" "[board_info $dest vx_module]"
}
unset board_info([board_info $dest name],vx_module)
diff --git a/lib/dg.exp b/lib/dg.exp
index 5232d2a..31da244 100644
--- a/lib/dg.exp
+++ b/lib/dg.exp
@@ -227,7 +227,7 @@ proc dg-process-target { selector } {
foreach triplet $selector {
if {[string match $triplet $target_triplet]} {
set triplet_match 1
- } elseif { $isnative && $triplet == "native" } {
+ } elseif { $isnative && $triplet eq "native" } {
set triplet_match 1
}
}
@@ -236,9 +236,9 @@ proc dg-process-target { selector } {
}
if { $triplet_match } {
- return [expr { $what == "xfail" ? "F" : "S" }]
+ return [expr { $what eq "xfail" ? "F" : "S" }]
} else {
- return [expr { $what == "xfail" ? "P" : "N" }]
+ return [expr { $what eq "xfail" ? "P" : "N" }]
}
}
@@ -313,7 +313,7 @@ proc dg-do { args } {
# The user really shouldn't have multiple lines of target
# selectors, but try to do the intuitive thing (multiple lines
# are OR'd together).
- if { $selected != "S" } {
+ if { $selected ne "S" } {
set selected "N"
} else {
set doaction [lindex ${do-what} 0]
@@ -594,10 +594,10 @@ proc dg-test { args } {
if { [string index [lindex $args 0] 0] eq "-" } {
for { set i 0 } { $i < [llength $args] } { incr i } {
- if { [lindex $args $i] == "--" } {
+ if { [lindex $args $i] eq "--" } {
incr i
break
- } elseif { [lindex $args $i] == "-keep-output" } {
+ } elseif { [lindex $args $i] eq "-keep-output" } {
set keep 1
} elseif { [string index [lindex $args $i] 0] eq "-" } {
clone_output "ERROR: dg-test: illegal argument: [lindex $args $i]"
@@ -680,7 +680,7 @@ proc dg-test { args } {
}
# If we're not supposed to try this test on this target, we're done.
- if { [lindex ${dg-do-what} 1] == "N" } {
+ if { [lindex ${dg-do-what} 1] eq "N" } {
unsupported "$name"
verbose "$name not supported on this target, skipping it" 3
return
@@ -794,7 +794,7 @@ proc dg-test { args } {
# Run the executable image if asked to do so.
# FIXME: This is the only place where we assume a standard meaning to
# the `keyword' argument of dg-do. This could be cleaned up.
- if { [lindex ${dg-do-what} 0] == "run" } {
+ if { [lindex ${dg-do-what} 0] eq "run" } {
if {![file exists $output_file]} {
unresolved "$name compilation failed to produce executable"
} else {
@@ -802,14 +802,14 @@ proc dg-test { args } {
set result [${tool}_load $output_file]
set status [lindex $result 0]
set output [lindex $result 1]
- if { [lindex ${dg-do-what} 2] == "F" } {
+ if { [lindex ${dg-do-what} 2] eq "F" } {
setup_xfail "*-*-*"
}
if { "$status" eq "pass" } {
pass "$name execution test"
verbose "Exec succeeded." 3
if { [llength ${dg-output-text}] > 1 } {
- if { [lindex ${dg-output-text} 0] == "F" } {
+ if { [lindex ${dg-output-text} 0] eq "F" } {
setup_xfail "*-*-*"
}
set texttmp [lindex ${dg-output-text} 1]
diff --git a/lib/framework.exp b/lib/framework.exp
index 9b11bd0..3ca5728 100644
--- a/lib/framework.exp
+++ b/lib/framework.exp
@@ -147,7 +147,7 @@ proc is_remote { board } {
return 0
}
- if { $board == "host" } {
+ if { $board eq "host" } {
if { [info exists host_board] && $host_board ne "" } {
verbose "board is $board, is remote" 3
return 1
@@ -157,12 +157,12 @@ proc is_remote { board } {
}
}
- if { $board == "target" } {
+ if { $board eq "target" } {
global current_target_name
if {[info exists current_target_name]} {
# This shouldn't happen, but we'll be paranoid anyway.
- if { $current_target_name != "target" } {
+ if { $current_target_name ne "target" } {
return [is_remote $current_target_name]
}
}
diff --git a/lib/remote.exp b/lib/remote.exp
index f703f35..08b1753 100644
--- a/lib/remote.exp
+++ b/lib/remote.exp
@@ -45,7 +45,7 @@ proc remote_open { args } {
}
# Shudder...
- if { $reboot && $type == "target" } {
+ if { $reboot && $type eq "target" } {
reboot_target
}
@@ -245,7 +245,7 @@ proc local_exec { commandline inp outp timeout } {
if { $r2 == 0 } {
set r2 [lindex $wres 3]
if { [llength $wres] > 4 } {
- if { [lindex $wres 4] == "CHILDKILLED" } {
+ if { [lindex $wres 4] eq "CHILDKILLED" } {
set r2 1
}
}
@@ -348,7 +348,7 @@ proc standard_exec { hostname args } {
proc remote_close { host } {
while { 1 } {
set result [call_remote "" close "$host"]
- if { [remote_pop_conn $host] != "pass" } {
+ if { [remote_pop_conn $host] ne "pass" } {
break
}
}
@@ -582,12 +582,12 @@ proc call_remote { type proc dest args } {
set dest [board_info $dest name]
}
- if { $proc == "reboot" } {
+ if { $proc eq "reboot" } {
regsub {/.*} "$dest" "" dest
verbose "Changed dest to $dest"
}
- if { $dest != "host" && $dest != "build" && $dest != "target" } {
+ if { $dest ne "host" && $dest ne "build" && $dest ne "target" } {
if { ![board_info $dest exists name] } {
global board
@@ -595,7 +595,7 @@ proc call_remote { type proc dest args } {
error "board exists"
}
load_board_description $dest
- if { $proc == "reboot" } {
+ if { $proc eq "reboot" } {
regsub {/.*} "$dest" "" dest
verbose "Changed dest to $dest"
}
@@ -603,7 +603,7 @@ proc call_remote { type proc dest args } {
}
set high_prot ""
- if { $type != "raw" } {
+ if { $type ne "raw" } {
if {[board_info $dest exists protocol]} {
set high_prot "${dest} [board_info $dest protocol]"
} else {
@@ -646,7 +646,7 @@ proc call_remote { type proc dest args } {
}
}
}
- if { $proc == "close" } {
+ if { $proc eq "close" } {
return ""
}
error "No procedure for '$proc' in call_remote"
@@ -763,7 +763,7 @@ proc standard_file { dest op args } {
return [file tail $file]
}
dirname {
- if { [file pathtype $file] == "relative" } {
+ if { [file pathtype $file] eq "relative" } {
set file [remote_file $dest absolute $file]
}
set result [file dirname $file]
@@ -814,7 +814,7 @@ proc standard_file { dest op args } {
# removed.
#
proc unix_clean_filename { dest file } {
- if { [file pathtype $file] == "relative" } {
+ if { [file pathtype $file] eq "relative" } {
set file [remote_file $dest join [pwd] $file]
}
set result ""
@@ -822,7 +822,7 @@ proc unix_clean_filename { dest file } {
if { $x eq "." || $x eq "" } {
continue
}
- if { $x == ".." } {
+ if { $x eq ".." } {
set rlen [expr {[llength $result] - 2}]
if { $rlen >= 0 } {
set result [lrange $result 0 $rlen]
@@ -863,7 +863,7 @@ proc remote_spawn { dest commandline args } {
verbose "spawning command $commandline"
if { [llength $args] > 0 } {
- if { [lindex $args 0] == "readonly" } {
+ if { [lindex $args 0] eq "readonly" } {
set result [catch { open "| ${commandline} |& cat" "r" } id]
if { $result != 0 } {
return -1
@@ -1023,7 +1023,7 @@ proc remote_load { dest prog args } {
set result [eval call_remote \"\" load \"$dname\" \"$prog\" $args]
# Not quite happy about the "pass" condition, but it makes sense if
# you think about it for a while-- *why* did the test not pass?
- if { $empty && [lindex $result 0] == "pass" } {
+ if { $empty && [lindex $result 0] eq "pass" } {
if { [getenv LOAD_REMOTECACHE] ne "" } {
set dir "[getenv REMOTELOAD_CACHE]/$tool/$dname"
if {![file exists $dir]} {
@@ -1186,7 +1186,7 @@ proc standard_wait { dest timeout } {
if { [lindex $s 0] != 0 && [lindex $s 2] == 0 } {
set status [lindex $s 3]
if { [llength $s] > 4 } {
- if { [lindex $s 4] == "CHILDKILLED" } {
+ if { [lindex $s 4] eq "CHILDKILLED" } {
set status 1
}
}
@@ -1284,7 +1284,7 @@ proc remote_expect { board timeout args } {
append res "${x} "
continue
}
- if { $x == "-re" } {
+ if { $x eq "-re" } {
append res "${x} "
set next [expr {$i + 1}]
set y [lrange $args $next $next]
@@ -1302,7 +1302,7 @@ proc remote_expect { board timeout args } {
set error_sect [lindex $args $i]
}
} else {
- if { ${x} == "eof" } {
+ if { ${x} eq "eof" } {
set save_next 1
} elseif { ${x} eq "default" || ${x} eq "timeout" } {
if { $error_sect eq "" } {
@@ -1413,7 +1413,7 @@ proc remote_swap_conn { host } {
} else {
set conninfo {}
}
- if { [remote_pop_conn $host] != "pass" } {
+ if { [remote_pop_conn $host] ne "pass" } {
set board_info($name,fileid) $fileid
set board_info($name,conninfo) $conninfo
return "fail"
diff --git a/lib/target.exp b/lib/target.exp
index 2573666..dbb50f6 100644
--- a/lib/target.exp
+++ b/lib/target.exp
@@ -183,7 +183,7 @@ proc prune_warnings { text } {
# Remove the lines that are output by the HP F77 compiler to
# indicate the functions that are being compiled.
upvar compiler_type compiler_type
- if { [info exists compiler_type] && $compiler_type == "f77" } {
+ if { [info exists compiler_type] && $compiler_type eq "f77" } {
regsub -all "\[ \ta-zA-Z_0-9\./\]*:\[\r\n\]+" $text "" text
}
@@ -307,7 +307,7 @@ proc default_target_compile {source destfile type options} {
global LDFLAGS_FOR_TARGET
global compiler_flags
- if { $destfile eq "" && $type != "preprocess" && $type != "none" } {
+ if { $destfile eq "" && $type ne "preprocess" && $type ne "none" } {
error "Must supply an output filename for the compile to default_target_compile"
}
@@ -334,7 +334,7 @@ proc default_target_compile {source destfile type options} {
foreach i $options {
- if { $i == "ada" } {
+ if { $i eq "ada" } {
set compiler_type "ada"
if {[board_info $dest exists adaflags]} {
append add_flags " [target_info adaflags]"
@@ -346,7 +346,7 @@ proc default_target_compile {source destfile type options} {
}
}
- if { $i == "c++" } {
+ if { $i eq "c++" } {
set compiler_type "c++"
if {[board_info $dest exists cxxflags]} {
append add_flags " [target_info cxxflags]"
@@ -359,7 +359,7 @@ proc default_target_compile {source destfile type options} {
}
}
- if { $i == "d" } {
+ if { $i eq "d" } {
set compiler_type "d"
if {[board_info $dest exists dflags]} {
append add_flags " [target_info dflags]"
@@ -371,7 +371,7 @@ proc default_target_compile {source destfile type options} {
}
}
- if { $i == "f77" } {
+ if { $i eq "f77" } {
set compiler_type "f77"
if {[board_info $dest exists f77flags]} {
append add_flags " [target_info f77flags]"
@@ -383,7 +383,7 @@ proc default_target_compile {source destfile type options} {
}
}
- if { $i == "f90" } {
+ if { $i eq "f90" } {
set compiler_type "f90"
if {[board_info $dest exists f90flags]} {
append add_flags " [target_info f90flags]"
@@ -453,7 +453,7 @@ proc default_target_compile {source destfile type options} {
global GNATMAKE_FOR_TARGET
if {[info exists GNATMAKE_FOR_TARGET]} {
- if { $compiler_type == "ada" } {
+ if { $compiler_type eq "ada" } {
set compiler $GNATMAKE_FOR_TARGET
}
}
@@ -465,25 +465,25 @@ proc default_target_compile {source destfile type options} {
}
if {[info exists CXX_FOR_TARGET]} {
- if { $compiler_type == "c++" } {
+ if { $compiler_type eq "c++" } {
set compiler $CXX_FOR_TARGET
}
}
if {[info exists D_FOR_TARGET]} {
- if { $compiler_type == "d" } {
+ if { $compiler_type eq "d" } {
set compiler $D_FOR_TARGET
}
}
if {[info exists F77_FOR_TARGET]} {
- if { $compiler_type == "f77" } {
+ if { $compiler_type eq "f77" } {
set compiler $F77_FOR_TARGET
}
}
if {[info exists F90_FOR_TARGET]} {
- if { $compiler_type == "f90" } {
+ if { $compiler_type eq "f90" } {
set compiler $F90_FOR_TARGET
}
}
@@ -501,15 +501,15 @@ proc default_target_compile {source destfile type options} {
}
}
- if {$type == "object"} {
+ if {$type eq "object"} {
append add_flags " -c"
}
- if { $type == "preprocess" } {
+ if { $type eq "preprocess" } {
append add_flags " -E"
}
- if { $type == "assembly" } {
+ if { $type eq "assembly" } {
append add_flags " -S"
}
@@ -517,11 +517,11 @@ proc default_target_compile {source destfile type options} {
append add_flags " [board_info $dest cflags]"
}
- if { $type == "executable" } {
+ if { $type eq "executable" } {
if {[board_info $dest exists ldflags]} {
append add_flags " [board_info $dest ldflags]"
}
- if { $compiler_type == "c++" } {
+ if { $compiler_type eq "c++" } {
append add_flags " [g++_link_flags]"
}
if {[isnative]} {
@@ -547,7 +547,7 @@ proc default_target_compile {source destfile type options} {
}
foreach i $options {
- if { $i == "debug" } {
+ if { $i eq "debug" } {
if {[board_info $dest exists debug_flags]} {
append add_flags " [board_info $dest debug_flags]"
} else {
@@ -560,7 +560,7 @@ proc default_target_compile {source destfile type options} {
append add_flags " $optimize"
}
- if { $type == "executable" } {
+ if { $type eq "executable" } {
append add_flags " $ldflags"
foreach x $libs {
if {[file exists $x]} {
@@ -630,7 +630,7 @@ proc default_target_compile {source destfile type options} {
# This is obscure: we put SOURCES at the end when building an
# object, because otherwise, in some situations, libtool will
# become confused about the name of the actual source file.
- if {$type == "object"} {
+ if {$type eq "object"} {
set opts "$add_flags $sources"
} else {
set opts "$sources $add_flags"
diff --git a/lib/targetdb.exp b/lib/targetdb.exp
index 88af2d1..21882ca 100644
--- a/lib/targetdb.exp
+++ b/lib/targetdb.exp
@@ -28,7 +28,7 @@ proc board_info { machine op args } {
if {[info exists target_info($machine,name)]} {
set machine $target_info($machine,name)
}
- if { $op == "exists" } {
+ if { $op eq "exists" } {
if { [llength $args] == 0 } {
return [info exists board_info($machine,name)]
} else {
diff --git a/lib/utils.exp b/lib/utils.exp
index 3c00b3f..e859e4d 100644
--- a/lib/utils.exp
+++ b/lib/utils.exp
@@ -30,7 +30,7 @@
# returns: a list of directories excluding the root directory
#
proc getdirs { args } {
- if { [lindex $args 0] == "-all" } {
+ if { [lindex $args 0] eq "-all" } {
set alldirs 1
set args [lrange $args 1 end]
} else {
@@ -88,10 +88,10 @@ proc getdirs { args } {
# Given a base and a destination, return a relative file name that refers
# to the destination when used relative to the given base.
proc relative_filename { base destination } {
- if { [file pathtype $base] != "absolute" } {
+ if { [file pathtype $base] ne "absolute" } {
set base [file normalize $base]
}
- if { [file pathtype $destination] != "absolute" } {
+ if { [file pathtype $destination] ne "absolute" } {
set destination [file normalize $destination]
}
@@ -211,7 +211,7 @@ proc which { file } {
proc grep { args } {
set options ""
- if { [lindex $args 0] == "-n" } {
+ if { [lindex $args 0] eq "-n" } {
append options "line "
set args [lrange $args 1 end]
}
diff --git a/runtest.exp b/runtest.exp
index ced4d1e..15cd53f 100644
--- a/runtest.exp
+++ b/runtest.exp
@@ -143,14 +143,14 @@ proc verbose { args } {
set i 0
if { [string index [lindex $args 0] 0] eq "-" } {
for { set i 0 } { $i < [llength $args] } { incr i } {
- if { [lindex $args $i] == "--" } {
+ if { [lindex $args $i] eq "--" } {
incr i
break
- } elseif { [lindex $args $i] == "-n" } {
+ } elseif { [lindex $args $i] eq "-n" } {
set newline 0
- } elseif { [lindex $args $i] == "-log" } {
+ } elseif { [lindex $args $i] eq "-log" } {
set logfile 1
- } elseif { [lindex $args $i] == "-x" } {
+ } elseif { [lindex $args $i] eq "-x" } {
set xml 1
} elseif { [string index [lindex $args $i] 0] eq "-" } {
clone_output "ERROR: verbose: illegal argument: [lindex $args $i]"
@@ -281,11 +281,11 @@ proc findfile { args } {
proc load_file { args } {
set i 0
set only_one 0
- if { [lindex $args $i] == "-1" } {
+ if { [lindex $args $i] eq "-1" } {
set only_one 1
incr i
}
- if { [lindex $args $i] == "--" } {
+ if { [lindex $args $i] eq "--" } {
incr i
}
@@ -326,7 +326,7 @@ proc search_and_load_file { type filelist dirlist } {
if {[file exists [file join ${dir} ${initfile}]]} {
set found 1
set error ""
- if { ${type} != "library file" } {
+ if { ${type} ne "library file" } {
send_user "Using ${dir}/${initfile} as ${type}.\n"
} else {
verbose "Loading ${dir}/${initfile}"
@@ -761,7 +761,7 @@ proc setup_target_hook { whole_name name } {
load_config base-config.exp
if {![load_board_description ${name} ${whole_name} ${hb}]} {
- if { $name != "unix" } {
+ if { $name ne "unix" } {
perror "couldn't load description file for ${name}"
exit 1
} else {
@@ -933,7 +933,7 @@ proc load_tool_init { file } {
set loaded_libs(tool/$file) ""
- if { [lindex [file split $srcdir] end] != "testsuite" } {
+ if { [lindex [file split $srcdir] end] ne "testsuite" } {
lappend searchpath [file join $srcdir testsuite lib tool]
lappend searchpath [file join $srcdir testsuite lib]
} else {
@@ -1370,7 +1370,7 @@ proc load_board_description { board_name args } {
if {![info exists board_info($whole_name,isremote)]} {
set board_info($whole_name,isremote) 1
if {[info exists board_type]} {
- if { $board_type == "build" } {
+ if { $board_type eq "build" } {
set board_info($whole_name,isremote) 0
}
}
@@ -1412,7 +1412,7 @@ proc load_base_board_description { board_name } {
if {![info exists board_info($board_name,isremote)]} {
set board_info($board_name,isremote) 1
if {[info exists board_type]} {
- if { $board_type == "build" } {
+ if { $board_type eq "build" } {
set board_info($board_name,isremote) 0
}
}
diff --git a/testsuite/runtest.all/target.test b/testsuite/runtest.all/target.test
index a9d8853..6729eda 100644
--- a/testsuite/runtest.all/target.test
+++ b/testsuite/runtest.all/target.test
@@ -66,7 +66,7 @@ set target_info(mvme,baud) "9600"
# test push_config target
push_config target idp
-if { $target_info(target,name) == "idp" } {
+if { $target_info(target,name) eq "idp" } {
puts "PASSED: push_config target"
} else {
puts "FAILED: push_config target"
@@ -81,7 +81,7 @@ if { ![info exists target_info(target,name)] } {
}
push_config host idp
-if { $target_info(host,name) == "idp" } {
+if { $target_info(host,name) eq "idp" } {
puts "PASSED: push_config target"
} else {
puts "FAILED: push_config target"
diff --git a/testsuite/runtest.all/utils.test b/testsuite/runtest.all/utils.test
index 43399d0..b5310ca 100644
--- a/testsuite/runtest.all/utils.test
+++ b/testsuite/runtest.all/utils.test
@@ -76,7 +76,7 @@ if [info exists env(TESTRUN)] {
#
setenv TESTRUN FooBar
if [info exists env(TESTRUN)] {
- if { $env(TESTRUN) == "FooBar" } {
+ if { $env(TESTRUN) eq "FooBar" } {
pass "setenv, set an environment variable"
} else {
fail "setenv, set an environment variable"
@@ -88,7 +88,7 @@ if [info exists env(TESTRUN)] {
# Test getenv:
#
if [info exists env(TESTRUN)] {
- if { [getenv TESTRUN] == "FooBar" } {
+ if { [getenv TESTRUN] eq "FooBar" } {
pass "getenv, get an environment variable"
} else {
fail "getenv, get an environment variable"