Changeset 2055


Ignore:
Timestamp:
Jan 19, 2011, 7:49:28 PM (14 years ago)
Author:
braffert
Message:

Regression tester: cleaning up and adding comments

Location:
trunk/tester
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/tester/test.tcl

    r2053 r2055  
    115115# USAGE: getInputs
    116116#
    117 # TODO
     117# Returns a list of key value pairs for all inputs given in the test xml.
     118# Each key is the path to the input element, and each key is its current
     119# value.
    118120# -----------------------------------------------------------------------
    119121itcl::body Rappture::Tester::Test::getInputs {{path input}} {
     
    149151# USAGE: getOutputs
    150152#
    151 # TODO
     153# Returns a list of key value pairs for all outputs in the runfile
     154# generated by the last run of the test.  Each key is the path to the
     155# element, and each value is its status (ok, diff, added, or missing).
     156# Throws an error if the test has not been ran.
    152157# ----------------------------------------------------------------------
    153158itcl::body Rappture::Tester::Test::getOutputs {{path output}} {
     
    158163    foreach child [$_runobj children $path] {
    159164        set fullpath $path.$child
    160         if {$fullpath != "output.time" && $fullpath != "output.user" && $fullpath != "output.status"} {
     165        if {$fullpath != "output.time" && $fullpath != "output.user" \
     166            && $fullpath != "output.status"} {
    161167            if {[lsearch $fullpath [getDiffs]] != -1} {
    162168                set status diff
    163169            } elseif {[lsearch $fullpath [getAdded]] != -1} {
    164170                set status added
    165             #} elseif {[lsearch $fullpath [getMissing]] != -1} {
    166             #    set status missing
    167171            } else {
    168172                if {[$_runobj get $fullpath] != ""} {
  • trunk/tester/testtree.tcl

    r2053 r2055  
    3838
    3939    constructor {args} { #defined later }
     40    destructor { #defined later }
    4041
    4142    public method getTest {args}
     
    117118}
    118119
    119 # TODO: destructor
    120 
    121 # ----------------------------------------------------------------------
    122 # Repopulate tree if test directory or toolxml have been changed.
     120# ----------------------------------------------------------------------
     121# DESTRUCTOR
     122# ----------------------------------------------------------------------
     123itcl::body Rappture::Tester::TestTree::destructor {} {
     124    foreach id [getLeaves] {
     125        itcl::delete object [getTest $id]
     126    }
     127}
     128
     129# ----------------------------------------------------------------------
     130# CONFIGURATION OPTION: -testdir
     131#
     132# Location of the directory containing a set of test xml files.
     133# Repopulate the tree if -testdir option is changed, but only if
     134# -toolxml has already been defined.
    123135# ----------------------------------------------------------------------
    124136itcl::configbody Rappture::Tester::TestTree::testdir {
     
    128140}
    129141
     142# ----------------------------------------------------------------------
     143# CONFIGURATION OPTION: -toolxml
     144#
     145# Location of the tool.xml for the tool being tested.  Repopulate the
     146# tree if -toolxml is changed, but only if -testdir has already been
     147# defined.
    130148itcl::configbody Rappture::Tester::TestTree::toolxml {
    131149    if {$itk_option(-testdir) != ""} {
     
    135153
    136154# ----------------------------------------------------------------------
     155# CONFIGURATION OPTION: -selectcommand
     156#
    137157# Forward the TestTree's selectcommand to the treeview, but tack on the
    138158# updateLabel method to keep the label refreshed when selection is
     
    256276# ----------------------------------------------------------------------
    257277itcl::body Rappture::Tester::TestTree::populate {} {
    258     # TODO: Delete existing test objects
     278    foreach id [getLeaves] {
     279        itcl::delete object [getTest $id]
     280    }
    259281    $itk_component(treeview) delete 0
    260282    # TODO: add an appropriate icon
  • trunk/tester/testview.tcl

    r2054 r2055  
    44#  Entire right hand side of the regression tester.  Displays the
    55#  golden test results, and compares them to the new results if the test
    6 #  has been ran.  The -test configuration option is used to provide a
    7 #  Test object to display.
     6#  has been ran.  Also show tree representation of all inputs and
     7#  outputs.  The -test configuration option is used to provide a Test
     8#  object to display.
    89# ======================================================================
    910#  AUTHOR:  Ben Rafferty, Purdue University
     
    122123
    123124# ----------------------------------------------------------------------
     125# CONFIGURATION OPTION: -test
     126#
    124127# When the -test configuration option is modified, update the display
    125128# accordingly.  The data passed in should be a Test object, or an empty
     
    202205# ----------------------------------------------------------------------
    203206# USAGE: updateResults
     207
     208# Used internally to update the results tab according to the test
     209# currently specified by the -test configuration option.  Show the
     210# golden results contained in the test xml, and if the the test has been
     211# ran, show the new results as well.
    204212# ----------------------------------------------------------------------
    205213itcl::body Rappture::Tester::TestView::updateResults {} {
     
    218226}
    219227
     228# ----------------------------------------------------------------------
     229# USAGE: updateInputs
     230#
     231# Used internally to update the inputs tab according to the test
     232# currently specified by the -test configuration option.  Shows a tree
     233# representation of all inputs given in the test xml and their given
     234# values.
     235# ----------------------------------------------------------------------
    220236itcl::body Rappture::Tester::TestView::updateInputs {} {
    221237    $itk_component(inputs) delete 0
     
    230246}
    231247
     248# ----------------------------------------------------------------------
     249# USAGE: updateOutputs
     250#
     251# Used internally to update the outputs tab according to the test
     252# currently specified by the -test configuration option.  Shows a tree
     253# representation of all outputs in the runfile generated by the last run
     254# of the test, along with their status (ok, diff, added, or missing).
     255# Disable the outputs tab if test has not been ran, or resulted in an
     256# error.
     257# ----------------------------------------------------------------------
    232258itcl::body Rappture::Tester::TestView::updateOutputs {} {
    233259    $itk_component(outputs) delete 0
Note: See TracChangeset for help on using the changeset viewer.