Changeset 2086 for trunk


Ignore:
Timestamp:
Feb 7, 2011, 3:04:42 PM (14 years ago)
Author:
braffert
Message:

tester: fixing regoldenize feature

Location:
trunk/tester/scripts
Files:
2 edited

Legend:

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

    r2085 r2086  
    147147pack $win.testview.bbar.viewoutputs -side right
    148148Rappture::Tooltip::for $win.testview.bbar.viewoutputs \
    149     "Display the outputs for this test case as they would be seen when running the tool normally.  If the test has completed with no error, the new results can be compated against the set of golden results."
     149    "Display the outputs for this test case as they would be seen when running the tool normally.  If the test has completed with no error, the new results can be compared against the set of golden results."
    150150
    151151pack $win.testview.bbar -side bottom -fill x
     
    388388proc tester_regoldenize {} {
    389389    set testtree [.pw pane 0].tree
    390 
    391     set test [$testtree getTest]
     390    set tests [$testtree curselection]
     391
     392    if {[llength $tests] != 1} {
     393        error "Cannot regoldenize. One test must be selected"
     394    }
     395
     396    set test [lindex $tests 0]
    392397    set testxml [$test getTestxml]
    393398    if {[tk_messageBox -type yesno -icon warning -message "Are you sure you want to regoldenize?\n$testxml will be overwritten."]} {
     
    402407# USAGE: tester_view_outputs
    403408#
    404 # TODO
    405 # ----------------------------------------------------------------------
    406 proc tester_view_outputs {args} {
     409# Displays the outputs of the currently selected test case as they would
     410# be seen when running the tool normally.  If the test has completed
     411# with no error, then show the new outputs alongside the golden results.
     412# ----------------------------------------------------------------------
     413proc tester_view_outputs {} {
    407414    set testtree [.pw pane 0].tree
    408415    set rhs [.pw pane 1]
  • trunk/tester/scripts/test.tcl

    r2085 r2086  
    2828    public method getRunobj {}
    2929    public method getTestobj {}
     30    public method getTestxml {}
    3031
    3132    public method run {args}
     
    7475# ----------------------------------------------------------------------
    7576itcl::body Rappture::Tester::Test::destructor {} {
    76     # TODO: toolobj is created in main.tcl and passed into all tests
    77     #  when they are created.  Should we really delete it here whenever
    78     #  a test is destroyed?
    79     itcl::delete object $_toolobj
    8077    itcl::delete object $_testobj
    81     if {$_runobj ne ""} {
     78    # runobj can point to testobj if the test has just been
     79    # regoldenized.  Don't try to delete twice.
     80    if {$_runobj ne "" && $_runobj ne $_testobj} {
    8281        itcl::delete object $_runobj
    8382    }
     
    178177# result attributes to reflect the changes. Throws an error if the test
    179178# has not been run.
     179#
     180# After regoldenizing, _testobj and _runobj will both refer to the same
     181# library object, and the previous _runobj will be discarded.
    180182# ----------------------------------------------------------------------
    181183itcl::body Rappture::Tester::Test::regoldenize {} {
     
    194196    set _testobj $_runobj
    195197
    196     set _runobj ""
    197198    set _diffs ""
    198199    _setResult Pass
     
    230231itcl::body Rappture::Tester::Test::getTestobj {} {
    231232    return $_testobj
     233}
     234
     235# ----------------------------------------------------------------------
     236# USAGE: getTestxml
     237#
     238# Returns the name of the xml file representing the test case.
     239# ----------------------------------------------------------------------
     240itcl::body Rappture::Tester::Test::getTestxml {} {
     241    return $_testxml
    232242}
    233243
Note: See TracChangeset for help on using the changeset viewer.