Changeset 2034 for trunk


Ignore:
Timestamp:
Jan 14, 2011 2:34:32 PM (13 years ago)
Author:
braffert
Message:
 
Location:
trunk/tester
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/tester/test.tcl

    r2032 r2034  
    1919
    2020    constructor {toolxml testxml} { #defined later }
     21    destructor { #defined later }
    2122
    2223    private variable _added ""
     
    7273
    7374# ----------------------------------------------------------------------
     75# DESTRUCTOR
     76# ----------------------------------------------------------------------
     77itcl::body Rappture::Tester::Test::destructor {} {
     78    itcl::delete object $_toolobj
     79    itcl::delete object $_testobj
     80    if {$_ran} {
     81        itcl::delete object $_runobj
     82    }
     83}
     84
     85# ----------------------------------------------------------------------
    7486# USAGE: getAdded
    7587#
     
    215227# ----------------------------------------------------------------------
    216228itcl::body Rappture::Tester::Test::run {} {
     229    # Delete existing library if rerun
     230    if {$_ran} {
     231        itcl::delete object $_runobj
     232    }
    217233    set driver [makeDriver]
    218234    set tool [Rappture::Tool ::#auto $driver [file dirname $_toolxml]]
  • trunk/tester/tester.tcl

    r2033 r2034  
    110110# ----------------------------------------------------------------------
    111111proc Rappture::Tester::selectionHandler {args} {
    112     puts sh
    113112    global lastsel
    114113    set test [.tree getTest]
  • trunk/tester/testtree.tcl

    r2031 r2034  
    116116    }
    117117}
     118
     119# TODO: destructor
    118120
    119121# ----------------------------------------------------------------------
     
    254256# ----------------------------------------------------------------------
    255257itcl::body Rappture::Tester::TestTree::populate {} {
     258    # TODO: Delete existing test objects
    256259    $itk_component(treeview) delete 0
    257260    # TODO: add an appropriate icon
  • trunk/tester/testview.tcl

    r2032 r2034  
    3030    inherit itk::Widget
    3131
    32     public variable test
     32    itk_option define -test test Test ""
    3333
    3434    constructor {args} { #defined later }
     
    105105# ----------------------------------------------------------------------
    106106itcl::configbody Rappture::Tester::TestView::test {
     107    set test $itk_option(-test)
    107108    # Data array is empty for branch nodes.
    108109    if {$test != ""} {
     
    116117                Error {showStatus "Error while running test."}
    117118            }
    118             updateInfo $test
    119119        } else {
    120120            showStatus "Test has not yet ran."
    121             updateInfo
    122         }
    123         updateResults $test
    124         updateInputs $test
     121        }
     122        updateResults
     123        updateInfo
     124        updateInputs
    125125        set descr [[$test getTestobj] get test.description]
    126126        if {$descr == ""} {
     
    180180
    181181# ----------------------------------------------------------------------
    182 # USAGE: updateResults ?test?
    183 #
    184 # Clears the analyzer and loads the given library objects.  Used to load
    185 # both the golden result as well as the test result.  Clears the
    186 # analyzer space if no arguments are given.
    187 # ----------------------------------------------------------------------
    188 itcl::body Rappture::Tester::TestView::updateResults {args} {
     182# USAGE: updateResults
     183# ----------------------------------------------------------------------
     184itcl::body Rappture::Tester::TestView::updateResults {} {
    189185    $itk_component(results) clear -nodelete
    190     if {[llength $args] == 0} {
     186    set test $itk_option(-test)
     187    if {$test == ""} {
    191188        # Already cleared, do nothing.
    192189        # TODO: Eventually display some kinds of message here.
    193     } elseif {[llength $args] == 1} {
     190    } else {
     191        set test $itk_option(-test)
    194192        $itk_component(results) load [$test getTestobj]
    195193        if {[$test hasRan]} {
     
    197195        }
    198196    }
    199        
    200 }
    201 
    202 # ----------------------------------------------------------------------
    203 # USAGE: updateInfo ?test?
    204 #
    205 # Given a set of key value pairs from the test tree, update the info
    206 # page of the testview widget.  If no arguments are given, disable the
    207 # info page.
    208 # ----------------------------------------------------------------------
    209 itcl::body Rappture::Tester::TestView::updateInfo {args} {
    210     if {[llength $args] == 0} {
     197}
     198
     199# ----------------------------------------------------------------------
     200# USAGE: updateInfo
     201# ----------------------------------------------------------------------
     202itcl::body Rappture::Tester::TestView::updateInfo {} {
     203    set test $itk_option(-test)
     204    if {$test == "" || ![$test hasRan]} {
    211205        $itk_component(info) delete 0.0 end
    212206        set index [$itk_component(tabs) index -name "Results"]
     
    214208        $itk_component(tabs) focus $index
    215209        $itk_component(tabs) tab configure "Info" -state disabled
    216     } elseif {[llength $args] == 1} {
     210    } else {
     211        set test $itk_option(-test)
    217212        set testxml [$test getTestxml]
    218213        set runfile [$test getRunfile]
     
    229224            $itk_component(info) insert end "Added: $added\n"
    230225        }
    231     } else {
    232         error "wrong # args: should be \"updateInfo ?test?\""
    233     }
    234 }
    235 
    236 itcl::body Rappture::Tester::TestView::updateInputs {args} {
    237     if {[llength $args] == 0} {
     226    }
     227}
     228
     229itcl::body Rappture::Tester::TestView::updateInputs {} {
     230    set test $itk_option(-test)
     231    if {$test == ""} {
    238232        set index [$itk_component(tabs) index -name "Results"]
    239233        $itk_component(tabs) select $index
    240234        $itk_component(tabs) focus $index
    241235        $itk_component(tabs) tab configure "Inputs" -state disabled
    242     } elseif {[llength $args] == 1} {
     236    } else {
     237        set test $itk_option(-test)
    243238        $itk_component(tabs) tab configure "Inputs" -state normal
    244     } else {
    245         error "wrong # args: should be \"updateInfo ?test?\""
    246     }
    247 }
    248 
     239    }
     240}
     241
Note: See TracChangeset for help on using the changeset viewer.