Changeset 116515 for trunk/base/tests


Ignore:
Timestamp:
Jan 27, 2014, 3:27:21 PM (6 years ago)
Author:
cal@…
Message:

base/tests: Tcl cleanup, patch by Gustaf Neumann, Tcl8.4-clean

Location:
trunk/base/tests
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/tests/test.tcl

    r112077 r116515  
    3737
    3838proc print_help {arg} {
    39     if { $arg == "tests" } {
     39    if { $arg eq "tests" } {
    4040        puts "The list of available tests is:"
    4141        foreach test $::test_suite {
     
    5454# Process args
    5555foreach arg $argv {
    56     if { $arg == "-h" || $arg == "-help" } {
     56    if { $arg eq "-h" || $arg eq "-help" } {
    5757        print_help ""
    5858        exit 0
    59     } elseif { $arg == "-debug" } {
    60         set index [expr [lsearch $argv $arg] + 1]
     59    } elseif { $arg eq "-debug" } {
     60        set index [expr {[lsearch $argv $arg] + 1}]
    6161        set level [lindex $argv $index]
    6262        if { $level >= 0 && $level <= 3 } {
     
    6666            exit 1
    6767        }
    68     } elseif { $arg == "-t" } {
    69         set index [expr [lsearch $argv $arg] + 1]
     68    } elseif { $arg eq "-t" } {
     69        set index [expr {[lsearch $argv $arg] + 1}]
    7070        set test_name [lindex $argv $index]
    7171        set no 0
    7272        foreach test $test_suite {
    7373            if { $test_name != $test } {
    74                 set no [expr $no + 1]
     74                set no [expr {$no + 1}]
    7575            }
    7676        }
     
    7979            exit 1
    8080        }
    81     } elseif { $arg == "-l" } {
     81    } elseif { $arg eq "-l" } {
    8282        print_help tests
    8383        exit 0
    84     } elseif { $arg == "-nocolor" } {
     84    } elseif { $arg eq "-nocolor" } {
    8585        set color_out "no"
    8686    }
     
    8989
    9090# Run tests
    91 if { $test_name != ""} {
     91if {$test_name ne ""} {
    9292    cd test/$test_name
    9393
     
    117117
    118118        set out ""
    119         if { ($fail != 0 || $skip != 0) && $color_out == "" } {
     119        if { ($fail != 0 || $skip != 0) && $color_out eq "" } {
    120120            # Color failed tests.
    121121            append out "\x1b\[1;31mTotal:" $total " Passed:" $pass " Failed:" $fail " Skipped:" $skip "  \x1b\[0m" $test
     
    137137
    138138# Return 1 if errors were found.
    139 if {$err != ""} {
     139if {$err ne ""} {
    140140    exit 1
    141141}
  • trunk/base/tests/test/statefile-unknown-version/test.tcl

    r112079 r116515  
    1818    global path output_file
    1919
    20     if {[string compare $warn "no"]} {
     20    if {$warn ne "no"} {
    2121        set msg "warning*"
    2222    } else {
  • trunk/base/tests/test/statefile-version1-outdated/test.tcl

    r112079 r116515  
    2020    global path output_file
    2121
    22     if {[string compare $warn "no"]} {
     22    if {$warn ne "no"} {
    2323        set msg "*discarding previous state*"
    2424    } else {
  • trunk/base/tests/test/statefile-version1/test.tcl

    r112079 r116515  
    2020    global path output_file
    2121
    22     if {[string compare $warn "no"]} {
     22    if {$warn ne "no"} {
    2323        set msg "*discarding previous state*"
    2424    } else {
  • trunk/base/tests/test/statefile-version2-invalid/test.tcl

    r112079 r116515  
    1919    global path output_file
    2020
    21     if {[string compare $warn "no"]} {
     21    if {$warn ne "no"} {
    2222        set msg "*warning*checksum*"
    2323    } else {
  • trunk/base/tests/test/statefile-version2-outdated/test.tcl

    r112079 r116515  
    1919    global path output_file
    2020
    21     if {[string compare $warn "no"]} {
     21    if {$warn ne "no" } {
    2222        set msg "*discarding previous state*"
    2323    } else {
  • trunk/base/tests/test/statefile-version2/test.tcl

    r112079 r116515  
    2323    global path output_file
    2424
    25     if {[string compare $arg "no"]} {
     25    if {$arg ne "no"} {
    2626        set msg "*discarding previous state*"
    2727    } else {
  • trunk/base/tests/test/universal/test.tcl

    r112079 r116515  
    1818
    1919    # Modify Porfile.in for variants.
    20     if {[string compare $opt "yes"]} {
     20    if {$opt ne "yes"} {
    2121        # No universal variant
    2222        exec sed "s/@option@/universal_variant\ no/" $path/Portfile.in > Portfile
Note: See TracChangeset for help on using the changeset viewer.