Changeset 2027 for trunk/tester


Ignore:
Timestamp:
Jan 12, 2011 2:51:29 PM (9 years ago)
Author:
braffert
Message:
 
Location:
trunk/tester
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/tester/resultspage.tcl

    r2026 r2027  
    1818    itk_option define -textfont textFont Font ""
    1919    itk_option define -boldtextfont boldTextFont Font ""
     20    itk_option define -clearcommand clearCommand ClearCommand ""
     21    itk_option define -appname appName AppName ""
    2022
    2123    constructor {args} { # defined below }
     
    2527    public method clear {}
    2628    public method download {option args}
     29    public method resultset {}
    2730
    2831    protected method _plot {args}
     
    9093
    9194    if {[Rappture::filexfer::enabled]} {
    92         Rappture::Tooltop::for $itk_component(download) "Downloads the current result to a new web browser window on your desktop.  From there, you can easily print or save results.
     95        Rappture::Tooltip::for $itk_component(download) "Downloads the current result to a new web browser window on your desktop.  From there, you can easily print or save results.
    9396
    9497NOTE:  Your web browser must allow pop-ups from this site.  If your output does not appear, look for a 'pop-up blocked' message and enable pop-ups."
     
    114117            -clearcommand [itcl::code $this clear] \
    115118            -settingscommand [itcl::code $this _plot]
    116     } {
    117         usual
    118         keep -promptcommand
    119119    }
    120120    pack $itk_component(resultset) -expand yes -fill both
     
    129129        itcl::delete object $obj
    130130    }
    131     # TODO: after cancel [itcl::code $this simulate] ???
    132131}
    133132 
     
    228227                set f [$itk_component(resultpages) page $page]
    229228                set item [$itk_component(resultselector) value]
    230                 set result [$f.rviewer download now $widget $_appName $item]
     229                set result [$f.rviewer download now $widget \
     230                    $itk_option(-appname) $item]
    231231                if { $result == "" } {
    232232                    return;                # User cancelled the download.
     
    260260
    261261itcl::body Rappture::ResultsPage::load {xmlobj} {
    262     # TODO: only show the last result? then clear first
    263 
    264262    # look for all output.load children and load them first
    265263    # each run.xml is loaded as a previous simulation.
     
    439437    #set _pages 0
    440438
    441     # TODO: _simState on
    442     # TODO: _fixSimControl
    443     # TODO: _reset
     439    # Invoke -clearcommand option
     440    if {[string length $itk_option(-clearcommand)] > 0} {
     441        uplevel #0 $itk_option(-clearcommand)
     442    }
     443
    444444}
    445445
     
    539539}
    540540
     541itcl::body Rappture::ResultsPage::resultset {} {
     542    return $itk_component(resultset)
     543}
     544
  • trunk/tester/tester.tcl

    r2019 r2027  
    7272    -selectcommand Rappture::Tester::selectionHandler]
    7373.pw add [frame .right]
    74 Rappture::Tester::TestView .right.view -toolxml $params(-tool)
     74Rappture::Tester::TestView .right.view
    7575button .right.regoldenize -text "Regoldenize" -state disabled \
    7676    -command Rappture::Tester::regoldenize
     
    7878pack .right.view -side bottom -expand yes -fill both
    7979pack .pw -expand yes -fill both
     80set lastsel ""
    8081
    8182# TODO: Handle resizing better
     
    9192# ----------------------------------------------------------------------
    9293proc Rappture::Tester::selectionHandler {args} {
     94    global lastsel
    9395    set test [.tree getTest]
    94     .right.view configure -test $test
    95     if {$test != "" && [$test hasRan] && [$test getResult] != "Error"} {
    96         .right.regoldenize configure -state normal
    97     } else {
    98         .right.regoldenize configure -state disabled
     96    if {$test != $lastsel} {
     97        .right.view configure -test $test
     98        if {$test != "" && [$test hasRan] && [$test getResult] != "Error"} {
     99            .right.regoldenize configure -state normal
     100        } else {
     101            .right.regoldenize configure -state disabled
     102        }
     103        set lastsel $test
    99104    }
    100105}
  • trunk/tester/testview.tcl

    r2026 r2027  
    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 new version's tool.xml must be provided through the
    7 #  -toolxml configuration option, and the -test configuration option is
    8 #  used to provide a Test object to display.
     6#  has been ran.  The -test configuration option is used to provide a
     7#  Test object to display.
    98# ======================================================================
    109#  AUTHOR:  Ben Rafferty, Purdue University
     
    3231
    3332    public variable test
    34     public variable toolxml
    35 
    36     constructor {toolxml args} { #defined later }
     33
     34    constructor {args} { #defined later }
    3735
    3836    protected method reset
     
    9088    eval itk_initialize $args
    9189
    92     if {$toolxml == "" } {
    93         error "no -toolxml configuration option given."
    94     }
    95 }
    96 
    97 # --------------------------------------------------------------------
    98 # Create a new Tool object if -toolxml option is changed.  Also
    99 # refresh the display by calling the configbody for the -test option.
    100 # ----------------------------------------------------------------------
    101 itcl::configbody Rappture::Tester::TestView::toolxml {
    102     #set _tool [Rappture::Tool ::#auto [Rappture::library $toolxml] \
    103     #     [file dirname $toolxml]]
    104     $this configure -test [$this cget -test]
    10590}
    10691
Note: See TracChangeset for help on using the changeset viewer.