diff options
author | Ben Elliston <bje@gnu.org> | 2018-12-08 00:09:42 +1100 |
---|---|---|
committer | Ben Elliston <bje@gnu.org> | 2018-12-08 00:09:42 +1100 |
commit | b3d43d3be8208272573563943690fff25ee50c8f (patch) | |
tree | 7245bff4e6eb16bd95c5c9ecfc65bd76241a8a7e /lib | |
parent | 4c9fa60d34fce9f5df2a48b6e025a8a2c0ac3acd (diff) | |
download | dejagnu-b3d43d3be8208272573563943690fff25ee50c8f.zip dejagnu-b3d43d3be8208272573563943690fff25ee50c8f.tar.gz dejagnu-b3d43d3be8208272573563943690fff25ee50c8f.tar.bz2 |
* 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,
config/vxworks.exp, config/unix.exp, config/sim.exp,
config/gdb_stub.exp, config/gdb-comm.exp, config/adb.exp,
baseboards/multi-sim.exp, baseboards/cris-sim.exp,
baseboards/basic-sim.exp, baseboards/basic-sid.exp,
baseboards/androideabi.exp, testsuite/runtest.all/load_lib.exp,
testsuite/libdejagnu/tunit.exp: Replace empty string comparisons
using == and != with 'eq' and 'ne'.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/dejagnu.exp | 2 | ||||
-rw-r--r-- | lib/dg.exp | 4 | ||||
-rw-r--r-- | lib/framework.exp | 14 | ||||
-rw-r--r-- | lib/libgloss.exp | 118 | ||||
-rw-r--r-- | lib/remote.exp | 60 | ||||
-rw-r--r-- | lib/rlogin.exp | 2 | ||||
-rw-r--r-- | lib/rsh.exp | 4 | ||||
-rw-r--r-- | lib/ssh.exp | 4 | ||||
-rw-r--r-- | lib/target.exp | 22 | ||||
-rw-r--r-- | lib/utils.exp | 2 |
10 files changed, 116 insertions, 116 deletions
diff --git a/lib/dejagnu.exp b/lib/dejagnu.exp index 8ca241a..d0766e6 100644 --- a/lib/dejagnu.exp +++ b/lib/dejagnu.exp @@ -89,7 +89,7 @@ proc host_compile {compline} { if { [lindex $status 0] != 0 } { verbose -log "compiler exited with status [lindex $status 0]" } - if { [lindex $status 1] != "" } { + if { [lindex $status 1] ne "" } { verbose -log "output is:\n[lindex $status 1]" 2 } @@ -629,7 +629,7 @@ proc dg-test { args } { # We append the compilation flags, if any, to ensure that the test case # names are unique. - if { "$tool_flags" != "" } { + if { "$tool_flags" ne "" } { set name "$name $tool_flags" } @@ -751,7 +751,7 @@ proc dg-test { args } { # Remove messages from the tool that we can ignore. set comp_output [prune_warnings $comp_output] - if { [info procs ${tool}-dg-prune] != "" } { + if { [info procs ${tool}-dg-prune] ne "" } { set comp_output [${tool}-dg-prune $target_triplet $comp_output] switch -glob -- $comp_output { "::untested::*" { diff --git a/lib/framework.exp b/lib/framework.exp index fa0c0b0..9b11bd0 100644 --- a/lib/framework.exp +++ b/lib/framework.exp @@ -57,7 +57,7 @@ proc open_logs { } { global xml_file global xml - if { ${tool} == "" } { + if { ${tool} eq "" } { set tool testrun } catch "file delete -force -- $outdir/$tool.sum" @@ -148,7 +148,7 @@ proc is_remote { board } { } if { $board == "host" } { - if { [info exists host_board] && $host_board != "" } { + if { [info exists host_board] && $host_board ne "" } { verbose "board is $board, is remote" 3 return 1 } else { @@ -288,7 +288,7 @@ proc clone_output { message } { global sum_file global all_flag - if { $sum_file != "" } { + if { $sum_file ne "" } { puts $sum_file "$message" } @@ -349,7 +349,7 @@ proc log_and_exit {} { log_summary total # extract version number - if {[info procs ${tool}_version] != ""} { + if {[info procs ${tool}_version] ne ""} { if {[catch "${tool}_version" output]} { warning "${tool}_version failed:\n$output" } @@ -357,7 +357,7 @@ proc log_and_exit {} { close_logs verbose -log "runtest completed at [timestamp -format %c]" if {$mail_logs} { - if { ${tool} == "" } { + if { ${tool} eq "" } { set tool testrun } mail_file $outdir/$tool.sum $mailing_list "Dejagnu Summary Log" @@ -385,7 +385,7 @@ proc xml_tag { tag body } { proc xml_output { message } { global xml_file - if { $xml_file != "" } { + if { $xml_file ne "" } { puts $xml_file $message } } @@ -803,7 +803,7 @@ proc record_test { type message args } { } global multipass_name - if { $multipass_name != "" } { + if { $multipass_name ne "" } { set message [format "%s: %s: %s" "$type" "$multipass_name" "$message"] } else { set message "$type: $message" diff --git a/lib/libgloss.exp b/lib/libgloss.exp index 6a4fb0e..0e033df 100644 --- a/lib/libgloss.exp +++ b/lib/libgloss.exp @@ -85,7 +85,7 @@ proc libgloss_link_flags { args } { # set the proper paths for gcc if the target subdir exists, else assume we # have no libgloss support for this target. - if { $gloss_srcdir == "" } { + if { $gloss_srcdir eq "" } { return "" } if {[file exists [file join $gccpath libgloss $cpu]]} { @@ -120,7 +120,7 @@ proc newlib_link_flags { args } { } set ld_script_path [lookfor_file ${tool_root_dir} "ld/ldscripts"] - if { $ld_script_path != "" } { + if { $ld_script_path ne "" } { set result "-L[file dirname $ld_script_path]" } else { set result "" @@ -155,7 +155,7 @@ proc newlib_include_flags { args } { verbose "Newlib path is $gccpath/newlib" set newlib_dir [lookfor_file ${srcdir} newlib/libc/include/assert.h] - if { ${newlib_dir} != "" } { + if { ${newlib_dir} ne "" } { set newlib_dir [file dirname ${newlib_dir}] } # Note - we use -isystem rather than -I because newlib contains @@ -180,7 +180,7 @@ proc libio_include_flags { args } { set gccpath "[get_multilibs]" - if { $gccpath == "" } { + if { $gccpath eq "" } { set gccpath "$tool_root_dir" } @@ -188,12 +188,12 @@ proc libio_include_flags { args } { # linux doesn't build _G_config.h and the test above fails, so # we search for iostream.list too. - if { $libio_bin_dir == "" } { + if { $libio_bin_dir eq "" } { set libio_bin_dir [lookfor_file ${gccpath} libio/iostream.list] } set libio_src_dir [lookfor_file ${srcdir} libio/Makefile.in] - if { $libio_bin_dir != "" && $libio_src_dir != "" } { + if { $libio_bin_dir ne "" && $libio_src_dir ne "" } { set libio_src_dir [file dirname ${libio_src_dir}] set libio_bin_dir [file dirname ${libio_bin_dir}] # Note - unlike the newlib_include_flags proc above we use the -I @@ -215,7 +215,7 @@ proc libio_link_flags { args } { set gccpath "[get_multilibs]" set libio_dir [lookfor_file ${gccpath} libio/libio.a] - if { $libio_dir != "" } { + if { $libio_dir ne "" } { return "-L[file dirname ${libio_dir}]" } else { return "" @@ -235,23 +235,23 @@ proc g++_include_flags { args } { set flags "" set dir [lookfor_file ${srcdir} libg++] - if { ${dir} != "" } { + if { ${dir} ne "" } { # See comment in libio_include_flags about using -I. append flags " -I${dir} -I${dir}/src" } set dir [lookfor_file ${srcdir} libstdc++-v3] - if { ${dir} != "" } { + if { ${dir} ne "" } { append flags " -I${dir}/include -I${dir}/include/std -I${dir}/include/c_std -I${dir}/libsupc++" } set dir [lookfor_file ${gccpath} libstdc++-v3] - if { ${dir} != "" } { + if { ${dir} ne "" } { append flags " -I${dir}/include -I${dir}/include/${target_alias}" } set dir [lookfor_file ${srcdir} libstdc++] - if { ${dir} != "" } { + if { ${dir} ne "" } { append flags " -I${dir} -I${dir}/stl" } @@ -267,7 +267,7 @@ proc g++_link_flags { args } { set flags "" set ld_library_path "." - if { $gccpath != "" } { + if { $gccpath ne "" } { if {[file exists [file join ${gccpath} lib libstdc++.a]]} { append ld_library_path ":${gccpath}/lib" } @@ -293,21 +293,21 @@ proc g++_link_flags { args } { global tool_root_dir set libgpp [lookfor_file ${tool_root_dir} libg++] - if { $libgpp != "" } { + if { $libgpp ne "" } { append flags "-L${libgpp} " append ld_library_path ":${libgpp}" } set libstdcpp [lookfor_file ${tool_root_dir} libstdc++] - if { $libstdcpp != "" } { + if { $libstdcpp ne "" } { append flags "-L${libstdcpp} " append ld_library_path ":${libstdcpp}" } set libiberty [lookfor_file ${tool_root_dir} libiberty] - if { $libiberty != "" } { + if { $libiberty ne "" } { append flags "-L${libiberty} " } set librx [lookfor_file ${tool_root_dir} librx] - if { $librx != "" } { + if { $librx ne "" } { append flags "-L${librx} " } } @@ -327,7 +327,7 @@ proc libstdc++_include_flags { args } { set flags "" set dir [lookfor_file ${srcdir} libstdc++-v3] - if { ${dir} != "" } { + if { ${dir} ne "" } { # See comment in libio_include_flags about using -I. append flags " -I${dir}/include -I${dir}/include/std -I${dir}/include/c_std -I${dir}/libsupc++" } @@ -335,12 +335,12 @@ proc libstdc++_include_flags { args } { set gccpath [get_multilibs] set dir [lookfor_file ${gccpath} libstdc++-v3] - if { ${dir} != "" } { + if { ${dir} ne "" } { append flags " -I${dir}/include -I${dir}/include/${target_alias}" } set dir [lookfor_file ${srcdir} libstdc++] - if { ${dir} != "" } { + if { ${dir} ne "" } { append flags " -I${dir} -I${dir}/stl" } @@ -355,7 +355,7 @@ proc libstdc++_link_flags { args } { set libio_dir "" set flags "" - if { $gccpath != "" } { + if { $gccpath ne "" } { if {[file exists [file join ${gccpath} libstdc++ libstdc++.a]]} { append flags "-L${gccpath}/libstdc++ " append ld_library_path ":${gccpath}/libstdc++" @@ -370,16 +370,16 @@ proc libstdc++_link_flags { args } { global tool_root_dir set libstdcpp [lookfor_file ${tool_root_dir} libstdc++] - if { $libstdcpp != "" } { + if { $libstdcpp ne "" } { append flags "-L${libstdcpp} " append ld_library_path ":${libstdcpp}" } set libiberty [lookfor_file ${tool_root_dir} libiberty] - if { $libiberty != "" } { + if { $libiberty ne "" } { append flags "-L${libiberty} " } set librx [lookfor_file ${tool_root_dir} librx] - if { $librx != "" } { + if { $librx ne "" } { append flags "-L${librx} " } } @@ -421,7 +421,7 @@ proc get_multilibs { args } { set compiler [find_gcc] } - if { $compiler == "" } { + if { $compiler eq "" } { return "" } @@ -457,7 +457,7 @@ proc get_multilibs { args } { # extract the options and their directory names as know by gcc foreach i "[exec $compiler --print-multi-lib]" { - if {$extra != ""} { + if {$extra ne ""} { # string trimright would do the wrong thing if we included # the leading @@ in $extra set i [string trimright $i $extra] @@ -487,7 +487,7 @@ proc get_multilibs { args } { regsub -all " -" $moptions " " dirty_moptions set moptions "" foreach x [split $dirty_moptions " "] { - if { $x != "" && [lsearch -exact $moptions $x] < 0 } { + if { $x ne "" && [lsearch -exact $moptions $x] < 0 } { lappend moptions $x } } @@ -498,11 +498,11 @@ proc get_multilibs { args } { # search for the top level multilib directory set multitop [lookfor_file "${comp_base_dir}" "${target_alias}"] - if { $multitop == "" } { + if { $multitop eq "" } { set multitop [lookfor_file "${comp_base_dir}" "libraries"] - if { $multitop == "" } { + if { $multitop eq "" } { set multitop "[lookfor_file ${comp_base_dir} gcc/xgcc]" - if { $multitop != "" } { + if { $multitop ne "" } { set multitop [file dirname [file dirname $multitop]] } else { return "" @@ -512,7 +512,7 @@ proc get_multilibs { args } { set gccpath [eval exec "$compiler" --print-multi-directory $mopts] set gccpath [lindex $gccpath 0] - if { $gccpath != "" } { + if { $gccpath ne "" } { verbose "GCC path is $gccpath" if { [llength $args] == 0 } { set board_info($target_board,multitop) "$multitop/$gccpath" @@ -530,7 +530,7 @@ proc get_multilibs { args } { } } # if we find some - if {$multimatches != ""} { + if {$multimatches ne ""} { # Split it into a list of pairs. If an moptions are the first # of a pair, then replace it with the second. If an moption # is not in multimatches, we assume it's not a multilib option @@ -608,16 +608,16 @@ proc find_binutils_prog { name } { if {![isremote host]} { set file [lookfor_file $tool_root_dir $name] - if { $file == "" } { + if { $file eq "" } { set file [lookfor_file $tool_root_dir ${name}-new] } - if { $file == "" } { + if { $file eq "" } { set file [lookfor_file $tool_root_dir binutils/$name] } - if { $file == "" } { + if { $file eq "" } { set file [lookfor_file $tool_root_dir binutils/${name}-new] } - if { $file != "" } { + if { $file ne "" } { set NAME "$file" } else { set NAME [transform $name] @@ -633,10 +633,10 @@ proc find_gcc {} { if {![isremote host]} { set file [lookfor_file $tool_root_dir xgcc] - if { $file == "" } { + if { $file eq "" } { set file [lookfor_file $tool_root_dir gcc/xgcc] } - if { $file != "" } { + if { $file ne "" } { set CC "$file -B[file dirname $file]/" } else { set CC [transform gcc] @@ -652,10 +652,10 @@ proc find_gcj {} { if {![isremote host]} { set file [lookfor_file $tool_root_dir gcj] - if { $file == "" } { + if { $file eq "" } { set file [lookfor_file $tool_root_dir gcc/gcj] } - if { $file != "" } { + if { $file ne "" } { set CC "$file -B[file dirname $file]/" } else { set CC [transform gcj] @@ -671,13 +671,13 @@ proc find_g++ {} { if {![isremote host]} { set file [lookfor_file $tool_root_dir xg++] - if { $file == "" } { + if { $file eq "" } { set file [lookfor_file $tool_root_dir gcc/xg++] } - if { $file == "" } { + if { $file eq "" } { set file [lookfor_file $tool_root_dir g++] } - if { $file != "" } { + if { $file ne "" } { set CC "$file -B[file dirname $file]/" } else { set CC [transform g++] @@ -693,10 +693,10 @@ proc find_gdc {} { if {![isremote host]} { set file [lookfor_file $tool_root_dir gdc] - if { $file == "" } { + if { $file eq "" } { set file [lookfor_file $tool_root_dir gcc/gdc] } - if { $file != "" } { + if { $file ne "" } { set CC "$file -B[file dirname $file]/" } else { set CC [transform gdc] @@ -712,10 +712,10 @@ proc find_g77 {} { if {![isremote host]} { set file [lookfor_file $tool_root_dir g77] - if { $file == "" } { + if { $file eq "" } { set file [lookfor_file $tool_root_dir gcc/g77] } - if { $file != "" } { + if { $file ne "" } { set CC "$file -B[file dirname $file]/" } else { set CC [transform g77] @@ -731,10 +731,10 @@ proc find_gfortran {} { if {![isremote host]} { set file [lookfor_file $tool_root_dir gfortran] - if { $file == "" } { + if { $file eq "" } { set file [lookfor_file $tool_root_dir gcc/gfortran] } - if { $file != "" } { + if { $file ne "" } { set CC "$file -B[file dirname $file]/" } else { set CC [transform gfortran] @@ -750,10 +750,10 @@ proc find_gnatmake {} { if {![isremote host]} { set file [lookfor_file $tool_root_dir gnatmake] - if { $file == "" } { + if { $file eq "" } { set file [lookfor_file $tool_root_dir gcc/gnatmake] } - if { $file != "" } { + if { $file ne "" } { set root [file dirname $file] set CC "$file -I$root/ada/rts --GCC=$root/xgcc --GNATBIND=$root/gnatbind --GNATLINK=$root/gnatlink -cargs -B$root -largs --GCC=$root/xgcc -B$root -margs" } else { @@ -771,11 +771,11 @@ proc find_nm {} { set NM "" if {![isremote host]} { set NM [lookfor_file $tool_root_dir nm-new] - if {$NM == ""} { + if {$NM eq ""} { set NM [lookfor_file $tool_root_dir binutils/nm-new] } } - if { $NM == ""} { + if { $NM eq ""} { set NM [transform nm] } return $NM @@ -799,7 +799,7 @@ proc process_multilib_options { args } { regsub -all "^\[ \t\]*" "$x" "" x regsub -all "\[ \t\]*$" "$x" "" x - if { $x == "" } { + if { $x eq "" } { continue } switch -glob -- $x { @@ -869,11 +869,11 @@ proc find_gas { } { if {![isremote host]} { set AS [lookfor_file $tool_root_dir as-new] - if { $AS == "" } { + if { $AS eq "" } { set AS [lookfor_file $tool_root_dir gas/as-new] } } - if { $AS == "" } { + if { $AS eq "" } { set AS [transform as] } return $AS @@ -886,11 +886,11 @@ proc find_ld { } { if {![isremote host]} { set LD [lookfor_file $tool_root_dir ld-new] - if { $LD == "" } { + if { $LD eq "" } { set LD [lookfor_file $tool_root_dir ld/ld-new] } } - if { $LD == "" } { + if { $LD eq "" } { set LD [transform ld] } return $LD @@ -919,7 +919,7 @@ proc build_wrapper { gluefile } { if {[target_info exists wrap_compile_flags]} { lappend flags "additional_flags=[target_info wrap_compile_flags]" } - if { [target_compile ${libdir}/testglue.c ${gluefile} object $flags] == "" } { + if { [target_compile ${libdir}/testglue.c ${gluefile} object $flags] eq "" } { set gluefile [remote_download host ${gluefile} ${tool}_tg.o] return [list $gluefile $result] } else { @@ -945,7 +945,7 @@ proc winsup_include_flags { args } { verbose "Winsup path is $gccpath/winsup" set winsup_dir [lookfor_file ${srcdir} winsup/include/windows.h] - if { ${winsup_dir} != "" } { + if { ${winsup_dir} ne "" } { set winsup_dir [file dirname ${winsup_dir}] # See comment in libio_include_flags about using -I. return " -I${winsup_dir}" diff --git a/lib/remote.exp b/lib/remote.exp index f195341..f703f35 100644 --- a/lib/remote.exp +++ b/lib/remote.exp @@ -60,7 +60,7 @@ proc remote_raw_open { args } { # -1, then the process is killed if it doesn't exit gracefully. # proc close_wait_program { program_id pid {wres_varname ""} } { - if {$wres_varname != "" } { + if {$wres_varname ne "" } { upvar 1 $wres_varname wres } @@ -167,7 +167,7 @@ proc local_exec { commandline inp outp timeout } { } } else { # Use a command pipeline with open. - if { $inp != "" } { + if { $inp ne "" } { set inp "< $inp" set mode "r" } else { @@ -177,12 +177,12 @@ proc local_exec { commandline inp outp timeout } { set use_tee 0 # We add |& cat so that Tcl exec doesn't freak out if the # program writes to stderr. - if { $outp == "" } { + if { $outp eq "" } { set outp "|& cat" } else { set outpf "$outp" set outp "> $outp" - if { $inp != "" } { + if { $inp ne "" } { set use_tee 1 } } @@ -258,7 +258,7 @@ proc local_exec { commandline inp outp timeout } { set res "wait failed" } } - if { $r2 != 0 || $res != "" || ! $got_eof } { + if { $r2 != 0 || $res ne "" || ! $got_eof } { verbose "close result is $res" set status 1 } else { @@ -418,7 +418,7 @@ proc remote_reboot { host } { if {[board_info $host exists name]} { set host [board_info $host name] } - if { [info procs ${host}_init] != "" } { + if { [info procs ${host}_init] ne "" } { ${host}_init $host } return $status @@ -446,7 +446,7 @@ proc remote_download { dest file args } { } if { ![isremote $dest] } { - if { $destfile == "" || $destfile == $file } { + if { $destfile eq "" || $destfile == $file } { return $file } else { verbose -log "Downloading on $dest to $destfile: $file" 2 @@ -459,7 +459,7 @@ proc remote_download { dest file args } { # and write it (in case we copy onto it again) catch {exec chmod u+rw $destfile} } - if { $result != 0 || $output != "" } { + if { $result != 0 || $output ne "" } { perror "remote_download to $dest of $file to $destfile: $output" return "" } else { @@ -495,7 +495,7 @@ proc standard_download {dest file destfile} { set destfile "$destdir/$destfile" } - if { "$dest" != "" } { + if { "$dest" ne "" } { set result [rsh_download $dest $file $destfile] if { $result == $destfile } { return $orig_destfile @@ -513,7 +513,7 @@ proc standard_download {dest file destfile} { # and write it (in case we copy onto it again) catch {exec chmod u+rw $destfile} } - if { $result != 0 || $output != "" } { + if { $result != 0 || $output ne "" } { perror "remote_download to $dest of $file to $destfile: $output" return "" } else { @@ -529,7 +529,7 @@ proc remote_upload {dest srcfile args} { } if { ![isremote $dest] } { - if { $destfile == "" || $srcfile == $destfile } { + if { $destfile eq "" || $srcfile == $destfile } { return $srcfile } set result [catch "exec cp -p $srcfile $destfile" output] @@ -552,7 +552,7 @@ proc standard_upload { dest srcfile destfile } { set srcfile "$destdir/$srcfile" } - if { "$dest" != "" } { + if { "$dest" ne "" } { return [rsh_upload $dest $srcfile $destfile] } @@ -565,7 +565,7 @@ proc standard_upload { dest srcfile destfile } { # and write it (in case we copy onto it again) catch {exec chmod u+rw $destfile} } - if { $result != 0 || $output != "" } { + if { $result != 0 || $output ne "" } { perror "remote_upload to $dest of $srcfile to $destfile: $output" return "" } else { @@ -615,8 +615,8 @@ proc call_remote { type proc dest args } { # Close has to be handled specially. if { $proc eq "close" || $proc eq "open" } { foreach try "$high_prot [board_info $dest connect] telnet standard" { - if { $try != "" } { - if { [info procs "${try}_${proc}"] != "" } { + if { $try ne "" } { + if { [info procs "${try}_${proc}"] ne "" } { verbose "call_remote calling ${try}_${proc}" 3 set result [eval ${try}_${proc} \"$dest\" $args] break @@ -624,7 +624,7 @@ proc call_remote { type proc dest args } { } } set ft "[board_info $dest file_transfer]" - if { [info procs "${ft}_${proc}"] != "" } { + if { [info procs "${ft}_${proc}"] ne "" } { verbose "calling ${ft}_${proc} $dest $args" 3 set result2 [eval ${ft}_${proc} \"$dest\" $args] } @@ -639,8 +639,8 @@ proc call_remote { type proc dest args } { } foreach try "${high_prot} [board_info $dest file_transfer] [board_info $dest connect] telnet standard" { verbose "looking for ${try}_${proc}" 4 - if { $try != "" } { - if { [info procs "${try}_${proc}"] != "" } { + if { $try ne "" } { + if { [info procs "${try}_${proc}"] ne "" } { verbose "call_remote calling ${try}_${proc}" 3 return [eval ${try}_${proc} \"$dest\" $args] } @@ -767,7 +767,7 @@ proc standard_file { dest op args } { set file [remote_file $dest absolute $file] } set result [file dirname $file] - if { $result == "" } { + if { $result eq "" } { return "/" } return $result @@ -960,11 +960,11 @@ proc remote_load { dest prog args } { set dname [board_info $dest name] set cache "[getenv REMOTELOAD_CACHE]/$tool/$dname/[file tail $prog]" set empty [isremote $dest] - if { [board_info $dest exists is_simulator] || [getenv REMOTELOAD_CACHE] == "" } { + if { [board_info $dest exists is_simulator] || [getenv REMOTELOAD_CACHE] eq "" } { set empty 0 } else { for { set x 0 } {$x < [llength $args] } {incr x} { - if { [lindex $args $x] != "" } { + if { [lindex $args $x] ne "" } { set empty 0 break } @@ -1024,7 +1024,7 @@ proc remote_load { dest 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 { [getenv LOAD_REMOTECACHE] != "" } { + if { [getenv LOAD_REMOTECACHE] ne "" } { set dir "[getenv REMOTELOAD_CACHE]/$tool/$dname" if {![file exists $dir]} { file mkdir $dir @@ -1083,7 +1083,7 @@ proc standard_load { dest prog args } { } set remotefile [file tail $prog] set remotefile [remote_download $dest $prog $remotefile] - if { $remotefile == "" } { + if { $remotefile eq "" } { verbose -log "Download of $prog to [board_info $dest name] failed." 3 return "unresolved" } @@ -1211,7 +1211,7 @@ proc check_for_board_status { variable } { # status message, then the absence of it means that the program # crashed, regardless of status found elsewhere (e.g. simulator exit # code). - if { [target_info needs_status_wrapper] != "" } then { + if { [target_info needs_status_wrapper] ne "" } then { set nomatch_return 2 } else { set nomatch_return -1 @@ -1225,7 +1225,7 @@ proc check_for_board_status { variable } { regsub "\[^0-9\]*$" $result "" result verbose "got board status $result" 3 verbose "output is $output" 3 - if { $result == "" } { + if { $result eq "" } { return $nomatch_return } else { return [expr {$result}] @@ -1259,7 +1259,7 @@ proc remote_expect { board timeout args } { set error_sect "" set save_next 0 - if { $spawn_id == "" } { + if { $spawn_id eq "" } { # This should be an invalid spawn id. set spawn_id 1000 } @@ -1305,7 +1305,7 @@ proc remote_expect { board timeout args } { if { ${x} == "eof" } { set save_next 1 } elseif { ${x} eq "default" || ${x} eq "timeout" } { - if { $error_sect == "" } { + if { $error_sect eq "" } { set save_next 1 } } @@ -1330,7 +1330,7 @@ proc remote_expect { board timeout args } { perror "$errorInfo $errorCode $string" } - if { $error_sect != "" } { + if { $error_sect ne "" } { set code [catch {uplevel $error_sect} string] } else { warning "remote_expect statement without a default case" @@ -1352,7 +1352,7 @@ proc remote_push_conn { host } { set name [board_info $host name] - if { $name == "" } { + if { $name eq "" } { return "fail" } @@ -1381,7 +1381,7 @@ proc remote_pop_conn { host } { set name [board_info $host name] - if { $name == "" } { + if { $name eq "" } { return "fail" } if {![info exists board_info($name,fileid_stack)]} { diff --git a/lib/rlogin.exp b/lib/rlogin.exp index b699831..cd1a583 100644 --- a/lib/rlogin.exp +++ b/lib/rlogin.exp @@ -140,7 +140,7 @@ proc rlogin_spawn { dest cmdline } { set ok 0 for { set i 0 } {$i <= 2 && ! $ok} { incr i } { set shell_id [remote_open $dest] - if { $shell_id != "" && $shell_id > 0 } { + if { $shell_id ne "" && $shell_id > 0 } { remote_send $dest "echo k\r" remote_expect $dest 20 { -re "\\(gdb\\)" { diff --git a/lib/rsh.exp b/lib/rsh.exp index 6852661..7cd9064 100644 --- a/lib/rsh.exp +++ b/lib/rsh.exp @@ -256,7 +256,7 @@ proc rsh_exec { boardname program pargs inp outp } { # If CMD sends any output to stderr, exec will think it failed. # More often than not that will be true, but it doesn't catch the # case where there is no output but the exit code is non-zero. - if { $inp == "" } { + if { $inp eq "" } { set inp "/dev/null" } @@ -279,7 +279,7 @@ proc rsh_exec { boardname program pargs inp outp } { set status "" } verbose "rsh_exec: status:$status text:$output" 4 - if { $status == "" } { + if { $status eq "" } { return [list -1 "Couldn't parse $RSH output, $output."] } regsub "XYZ(\[0-9\]*)ZYX\n?" $output "" output diff --git a/lib/ssh.exp b/lib/ssh.exp index c589ca9..91a3903 100644 --- a/lib/ssh.exp +++ b/lib/ssh.exp @@ -165,7 +165,7 @@ proc ssh_exec { boardname program pargs inp outp } { # If CMD sends any output to stderr, exec will think it failed. # More often than not that will be true, but it doesn't catch the # case where there is no output but the exit code is non-zero. - if { $inp == "" } { + if { $inp eq "" } { set inp "/dev/null" } @@ -190,7 +190,7 @@ proc ssh_exec { boardname program pargs inp outp } { set status "" } verbose "ssh_exec: status:$status text:$output" 4 - if { $status == "" } { + if { $status eq "" } { return [list -1 "Couldn't parse $SSH output, $output."] } regsub "XYZ(\[0-9\]*)ZYX\n?" $output "" output diff --git a/lib/target.exp b/lib/target.exp index 9268f4e..2573666 100644 --- a/lib/target.exp +++ b/lib/target.exp @@ -293,7 +293,7 @@ proc prune_warnings { text } { # proc target_compile {source destfile type options} { set target [target_info name] - if { [info procs ${target}_compile] != "" } { + if { [info procs ${target}_compile] ne "" } { return [${target}_compile $source $destfile $type $options] } else { return [default_target_compile $source $destfile $type $options] @@ -307,7 +307,7 @@ proc default_target_compile {source destfile type options} { global LDFLAGS_FOR_TARGET global compiler_flags - if { $destfile == "" && $type != "preprocess" && $type != "none" } { + if { $destfile eq "" && $type != "preprocess" && $type != "none" } { error "Must supply an output filename for the compile to default_target_compile" } @@ -459,7 +459,7 @@ proc default_target_compile {source destfile type options} { } if {[info exists CC_FOR_TARGET]} { - if { $compiler == "" } { + if { $compiler eq "" } { set compiler $CC_FOR_TARGET } } @@ -488,9 +488,9 @@ proc default_target_compile {source destfile type options} { } } - if { $compiler == "" } { + if { $compiler eq "" } { set compiler [board_info $dest compiler] - if { $compiler == "" } { + if { $compiler eq "" } { return "default_target_compile: No compiler to compile with" } } @@ -527,7 +527,7 @@ proc default_target_compile {source destfile type options} { if {[isnative]} { # This is a lose. catch "glob -nocomplain $tool_root_dir/libstdc++/libstdc++.so* $tool_root_dir/libstdc++/libstdc++.sl" tmp - if { ${tmp} != "" } { + if { ${tmp} ne "" } { if {[regexp ".*solaris2.*" $target_triplet]} { # Solaris 2 append add_flags " -R$tool_root_dir/libstdc++" @@ -607,7 +607,7 @@ proc default_target_compile {source destfile type options} { if {[isremote host]} { foreach x $source { set file [remote_download host $x] - if { $file == "" } { + if { $file eq "" } { warning "Unable to download $x to host." return "Unable to download $x to host." } else { @@ -622,7 +622,7 @@ proc default_target_compile {source destfile type options} { append add_flags " -o a.out" remote_file host delete a.out } else { - if { $destfile != "" } { + if { $destfile ne "" } { append add_flags " -o $destfile" } } @@ -670,7 +670,7 @@ proc default_target_compile {source destfile type options} { if { [lindex $status 0] != 0 } { verbose -log "compiler exited with status [lindex $status 0]" } - if { [lindex $status 1] != "" } { + if { [lindex $status 1] ne "" } { verbose "output is:\n[lindex $status 1]" 2 } if { [lindex $status 0] != 0 && "${comp_output}" eq "" } { @@ -726,7 +726,7 @@ proc default_target_assemble { source destfile flags } { if { [lindex $status 0] != 0 } { verbose -log "assembler exited with status [lindex $status 0]" } - if { [lindex $status 1] != "" } { + if { [lindex $status 1] ne "" } { verbose "assembler output is:\n[lindex $status 1]" 2 } return ${comp_output} @@ -818,7 +818,7 @@ proc default_link { board objects destfile flags } { if { [lindex $status 0] != 0 } { verbose -log "linker exited with status [lindex $status 0]" } - if { [lindex $status 1] != "" } { + if { [lindex $status 1] ne "" } { verbose "linker output is:\n[lindex $status 1]" 2 } return ${comp_output} diff --git a/lib/utils.exp b/lib/utils.exp index c0f1ab7..3c00b3f 100644 --- a/lib/utils.exp +++ b/lib/utils.exp @@ -45,7 +45,7 @@ proc getdirs { args } { } verbose "Looking in ${path} for directories that match \"${pattern}\"" 3 catch "glob ${path}/${pattern}" tmp - if { ${tmp} != "" } { + if { ${tmp} ne "" } { foreach i ${tmp} { if {[file isdirectory $i]} { switch -- "[file tail $i]" { |