Changeset 2030 for trunk/tester


Ignore:
Timestamp:
Jan 13, 2011 12:14:50 PM (9 years ago)
Author:
braffert
Message:
 
Location:
trunk/tester
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/tester/tester.tcl

    r2027 r2030  
    4242# If tool.xml and test directory locations are not given, try to find them.
    4343if {$params(-tool) == ""} {
    44     if {[file exists tool.xml]} {
     44    if {[file isfile tool.xml]} {
    4545        set params(-tool) tool.xml
    46     } elseif {[file exists [file join rappture tool.xml]]} {
     46    } elseif {[file isfile [file join rappture tool.xml]]} {
    4747        set params(-tool) [file join rappture tool.xml]
    4848    } else {
    49         error "Cannot find tool.xml"
     49        puts "Cannot find tool.xml"
     50        exit 1
    5051    }
     52} elseif {![file isfile $params(-tool)]} {
     53    puts "Tool \"$params(-tool)\" does not exist"
     54    exit 1
    5155}
    5256
     
    5862        set params(-testdir) [file join [file dirname $tooldir] tests]
    5963    } else {
    60         error "Cannot find test directory."
     64        puts "Cannot find test directory"
     65        exit 1
    6166    }
     67} elseif {![file isdirectory $params(-testdir)]} {
     68    puts "Test directory \"$params(-testdir)\" does not exist"
     69    exit 1
    6270}
    6371
     
    6775wm title . "Rappture Regression Tester"
    6876panedwindow .pw
     77
    6978.pw add [Rappture::Tester::TestTree .tree \
    7079    -testdir $params(-testdir) \
    7180    -toolxml $params(-tool) \
    7281    -selectcommand Rappture::Tester::selectionHandler]
     82
    7383.pw add [frame .right]
    7484Rappture::Tester::TestView .right.view
     
    7787pack .right.regoldenize -side bottom -anchor e
    7888pack .right.view -side bottom -expand yes -fill both
     89
    7990pack .pw -expand yes -fill both
     91
    8092set lastsel ""
    8193
    8294# TODO: Handle resizing better
    8395# TODO: Fix error that occurs only when you click and hold on a test
    84 #       while the right hand side is empty
     96#       while the right hand side is empty.  Adding lastsel check
     97#       removed the error, but tree selection still acts strange when
     98#       holding down the mouse button.  selectionHandler actually gets
     99#       invoked twice, somehow leading to an event dispatch error.
     100#       If selectionHandler does NOT reconfigure the right side with the
     101#       selected test, then no error occurs.
    85102
    86103# ----------------------------------------------------------------------
    87 # USAGE: selectionHandler
     104# USAGE: selectionHandler ?-refresh?
    88105#
    89106# Used internally to communicate between the test tree and the right
    90107# hand side viewer.  Upon selecting a new tree node, pass the focused
    91 # node's data to the right hand side.
     108# node's data to the right hand side.  Use the -refresh option to force
     109# the selected test to be re-displayed on the right side.
    92110# ----------------------------------------------------------------------
    93111proc Rappture::Tester::selectionHandler {args} {
    94112    global lastsel
    95113    set test [.tree getTest]
    96     if {$test != $lastsel} {
    97         .right.view configure -test $test 
     114    if {$test != $lastsel || [lsearch $args "-refresh"] != -1} {
     115        .right.view configure -test $test
    98116        if {$test != "" && [$test hasRan] && [$test getResult] != "Error"} {
    99117            .right.regoldenize configure -state normal
  • trunk/tester/testtree.tcl

    r2020 r2030  
    135135itcl::configbody Rappture::Tester::TestTree::selectcommand {
    136136    $itk_component(treeview) configure -selectcommand \
    137         "[itcl::code $itk_interior updateLabel]; $selectcommand"
     137        "[itcl::code $this updateLabel]; $selectcommand"
    138138}
    139139
     
    279279        runTest $id
    280280    }
    281     eval $selectcommand
     281    eval $selectcommand -refresh
    282282}
    283283
  • trunk/tester/testview.tcl

    r2027 r2030  
    7070    } {
    7171    }
    72     $itk_component(tabs) insert end "Analyzer" -ipady 25 -fill both
     72    $itk_component(tabs) insert end "Results" -ipady 25 -fill both
    7373    $itk_component(tabs) insert end "Info" -ipady 25 -fill both \
    7474        -state disabled
     
    7777    #    Rappture::ResultsPage $itk_component(tabs).analyzer
    7878    #}
    79     #$itk_component(tabs) tab configure "Analyzer" \
     79    #$itk_component(tabs) tab configure "Results" \
    8080    #    -window $itk_component(tabs).analyzer
    8181
     
    200200        Rappture::ResultsPage $itk_component(tabs).analyzer
    201201    }
    202     $itk_component(tabs) tab configure "Analyzer" \
     202    $itk_component(tabs) tab configure "Results" \
    203203        -window $itk_component(analyzer)
    204204    foreach lib $args {
     
    217217    if {[llength $args] == 0} {
    218218        $itk_component(info) delete 0.0 end
    219         # TODO: Switch back to analyzer tab.  Why doesn't this work?
    220         $itk_component(tabs) invoke \
    221             [$itk_component(tabs) index -name "Analyzer"]
     219        # TODO: Switch back to results tab.  Why doesn't this work?
     220        set index [$itk_component(tabs) index -name "Results"]
     221        $itk_component(tabs) select $index
     222        $itk_component(tabs) focus $index
    222223        $itk_component(tabs) tab configure "Info" -state disabled
    223224        return
Note: See TracChangeset for help on using the changeset viewer.