Changeset 2163 for trunk/tester/scripts


Ignore:
Timestamp:
Mar 28, 2011 8:35:13 PM (9 years ago)
Author:
mmc
Message:

Fix for the tester to work better with the various language bindings
that return "0" instead of "ok" and "1" instead of "failure". The
tester now treats anything other than 0/ok as failure.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tester/scripts/test.tcl

    r2142 r2163  
    5050    public proc queue {op args}
    5151
     52    # useful helper function -- looks for val among choices
     53    public proc oneof {choices val} {
     54        return [expr {[lsearch -exact $choices $val] >= 0}]
     55    }
     56
    5257    private common _queue       ;# queue of objects waiting to run
    5358    set _queue(tests) ""        ;# list of tests in the queue
     
    162167            set _runobj $result
    163168
    164             if {[$_testobj get output.status] ne "ok"} {
     169            if {![oneof {0 ok} [$_testobj get output.status]]} {
    165170                # expected test to fail, but it didn't
    166171                set idiffs [_computeDiffs [$_toolobj xml object] $_runobj -in input]
     
    183188        } else {
    184189            set _runobj [_buildFailure $result]
    185             if {[$_testobj get output.status] eq "failed"
     190            if {![oneof {0 ok} [$_testobj get output.status]]
    186191                  && [$_testobj get output.log] eq $result} {
    187192                _setResult "Pass"
     
    196201    } else {
    197202        set _runobj [_buildFailure $result]
    198         if {[$_testobj get output.status] eq "failed"
     203        if {![oneof {0 ok} [$_testobj get output.status]]
    199204              && [$_testobj get output.log] eq $result} {
    200205            _setResult "Pass"
Note: See TracChangeset for help on using the changeset viewer.