[116515] trunk/base/tests
cal at macports.org
cal at macports.org
Mon Jan 27 07:27:22 PST 2014
Revision: 116515
https://trac.macports.org/changeset/116515
Author: cal at macports.org
Date: 2014-01-27 07:27:21 -0800 (Mon, 27 Jan 2014)
Log Message:
-----------
base/tests: Tcl cleanup, patch by Gustaf Neumann, Tcl8.4-clean
Modified Paths:
--------------
trunk/base/tests/test/statefile-unknown-version/test.tcl
trunk/base/tests/test/statefile-version1/test.tcl
trunk/base/tests/test/statefile-version1-outdated/test.tcl
trunk/base/tests/test/statefile-version2/test.tcl
trunk/base/tests/test/statefile-version2-invalid/test.tcl
trunk/base/tests/test/statefile-version2-outdated/test.tcl
trunk/base/tests/test/universal/test.tcl
trunk/base/tests/test.tcl
Modified: trunk/base/tests/test/statefile-unknown-version/test.tcl
===================================================================
--- trunk/base/tests/test/statefile-unknown-version/test.tcl 2014-01-27 15:23:40 UTC (rev 116514)
+++ trunk/base/tests/test/statefile-unknown-version/test.tcl 2014-01-27 15:27:21 UTC (rev 116515)
@@ -17,7 +17,7 @@
proc state_unknown {warn} {
global path output_file
- if {[string compare $warn "no"]} {
+ if {$warn ne "no"} {
set msg "warning*"
} else {
set msg "*staging*destroot*"
Modified: trunk/base/tests/test/statefile-version1/test.tcl
===================================================================
--- trunk/base/tests/test/statefile-version1/test.tcl 2014-01-27 15:23:40 UTC (rev 116514)
+++ trunk/base/tests/test/statefile-version1/test.tcl 2014-01-27 15:27:21 UTC (rev 116515)
@@ -19,7 +19,7 @@
proc statefile_v1 {warn} {
global path output_file
- if {[string compare $warn "no"]} {
+ if {$warn ne "no"} {
set msg "*discarding previous state*"
} else {
set msg "*staging*destroot*"
Modified: trunk/base/tests/test/statefile-version1-outdated/test.tcl
===================================================================
--- trunk/base/tests/test/statefile-version1-outdated/test.tcl 2014-01-27 15:23:40 UTC (rev 116514)
+++ trunk/base/tests/test/statefile-version1-outdated/test.tcl 2014-01-27 15:27:21 UTC (rev 116515)
@@ -19,7 +19,7 @@
proc state_v1 {warn} {
global path output_file
- if {[string compare $warn "no"]} {
+ if {$warn ne "no"} {
set msg "*discarding previous state*"
} else {
set msg "*staging*destroot*"
Modified: trunk/base/tests/test/statefile-version2/test.tcl
===================================================================
--- trunk/base/tests/test/statefile-version2/test.tcl 2014-01-27 15:23:40 UTC (rev 116514)
+++ trunk/base/tests/test/statefile-version2/test.tcl 2014-01-27 15:27:21 UTC (rev 116515)
@@ -22,7 +22,7 @@
proc statefile_v2 {arg} {
global path output_file
- if {[string compare $arg "no"]} {
+ if {$arg ne "no"} {
set msg "*discarding previous state*"
} else {
set msg "*staging*destroot*"
Modified: trunk/base/tests/test/statefile-version2-invalid/test.tcl
===================================================================
--- trunk/base/tests/test/statefile-version2-invalid/test.tcl 2014-01-27 15:23:40 UTC (rev 116514)
+++ trunk/base/tests/test/statefile-version2-invalid/test.tcl 2014-01-27 15:27:21 UTC (rev 116515)
@@ -18,7 +18,7 @@
proc state_v2_invalid {warn} {
global path output_file
- if {[string compare $warn "no"]} {
+ if {$warn ne "no"} {
set msg "*warning*checksum*"
} else {
set msg "*staging*destroot*"
Modified: trunk/base/tests/test/statefile-version2-outdated/test.tcl
===================================================================
--- trunk/base/tests/test/statefile-version2-outdated/test.tcl 2014-01-27 15:23:40 UTC (rev 116514)
+++ trunk/base/tests/test/statefile-version2-outdated/test.tcl 2014-01-27 15:27:21 UTC (rev 116515)
@@ -18,7 +18,7 @@
proc state_v2_out {warn} {
global path output_file
- if {[string compare $warn "no"]} {
+ if {$warn ne "no" } {
set msg "*discarding previous state*"
} else {
set msg "*staging*destroot*"
Modified: trunk/base/tests/test/universal/test.tcl
===================================================================
--- trunk/base/tests/test/universal/test.tcl 2014-01-27 15:23:40 UTC (rev 116514)
+++ trunk/base/tests/test/universal/test.tcl 2014-01-27 15:27:21 UTC (rev 116515)
@@ -17,7 +17,7 @@
global output_file path portsrc bindir
# Modify Porfile.in for variants.
- if {[string compare $opt "yes"]} {
+ if {$opt ne "yes"} {
# No universal variant
exec sed "s/@option@/universal_variant\ no/" $path/Portfile.in > Portfile
} else {
Modified: trunk/base/tests/test.tcl
===================================================================
--- trunk/base/tests/test.tcl 2014-01-27 15:23:40 UTC (rev 116514)
+++ trunk/base/tests/test.tcl 2014-01-27 15:27:21 UTC (rev 116515)
@@ -36,7 +36,7 @@
}
proc print_help {arg} {
- if { $arg == "tests" } {
+ if { $arg eq "tests" } {
puts "The list of available tests is:"
foreach test $::test_suite {
puts [puts -nonewline " "]$test
@@ -53,11 +53,11 @@
# Process args
foreach arg $argv {
- if { $arg == "-h" || $arg == "-help" } {
+ if { $arg eq "-h" || $arg eq "-help" } {
print_help ""
exit 0
- } elseif { $arg == "-debug" } {
- set index [expr [lsearch $argv $arg] + 1]
+ } elseif { $arg eq "-debug" } {
+ set index [expr {[lsearch $argv $arg] + 1}]
set level [lindex $argv $index]
if { $level >= 0 && $level <= 3 } {
append arguments "-debug " $level
@@ -65,30 +65,30 @@
puts "Invalid debug level."
exit 1
}
- } elseif { $arg == "-t" } {
- set index [expr [lsearch $argv $arg] + 1]
+ } elseif { $arg eq "-t" } {
+ set index [expr {[lsearch $argv $arg] + 1}]
set test_name [lindex $argv $index]
set no 0
foreach test $test_suite {
if { $test_name != $test } {
- set no [expr $no + 1]
+ set no [expr {$no + 1}]
}
}
if { $no == [llength $test_suite] } {
print_help tests
exit 1
}
- } elseif { $arg == "-l" } {
+ } elseif { $arg eq "-l" } {
print_help tests
exit 0
- } elseif { $arg == "-nocolor" } {
+ } elseif { $arg eq "-nocolor" } {
set color_out "no"
}
}
# Run tests
-if { $test_name != ""} {
+if {$test_name ne ""} {
cd test/$test_name
set result [eval exec $tcl test.tcl $arguments 2>@stderr]
@@ -116,7 +116,7 @@
if { $fail != 0 } { set err "yes" }
set out ""
- if { ($fail != 0 || $skip != 0) && $color_out == "" } {
+ if { ($fail != 0 || $skip != 0) && $color_out eq "" } {
# Color failed tests.
append out "\x1b\[1;31mTotal:" $total " Passed:" $pass " Failed:" $fail " Skipped:" $skip " \x1b\[0m" $test
} else {
@@ -136,7 +136,7 @@
}
# Return 1 if errors were found.
-if {$err != ""} {
+if {$err ne ""} {
exit 1
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140127/a3700c5a/attachment.html>
More information about the macports-changes
mailing list