- Timestamp:
- Jan 13, 2011 12:14:50 PM (13 years ago)
- Location:
- trunk/tester
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tester/tester.tcl
r2027 r2030 42 42 # If tool.xml and test directory locations are not given, try to find them. 43 43 if {$params(-tool) == ""} { 44 if {[file existstool.xml]} {44 if {[file isfile tool.xml]} { 45 45 set params(-tool) tool.xml 46 } elseif {[file exists[file join rappture tool.xml]]} {46 } elseif {[file isfile [file join rappture tool.xml]]} { 47 47 set params(-tool) [file join rappture tool.xml] 48 48 } else { 49 error "Cannot find tool.xml" 49 puts "Cannot find tool.xml" 50 exit 1 50 51 } 52 } elseif {![file isfile $params(-tool)]} { 53 puts "Tool \"$params(-tool)\" does not exist" 54 exit 1 51 55 } 52 56 … … 58 62 set params(-testdir) [file join [file dirname $tooldir] tests] 59 63 } else { 60 error "Cannot find test directory." 64 puts "Cannot find test directory" 65 exit 1 61 66 } 67 } elseif {![file isdirectory $params(-testdir)]} { 68 puts "Test directory \"$params(-testdir)\" does not exist" 69 exit 1 62 70 } 63 71 … … 67 75 wm title . "Rappture Regression Tester" 68 76 panedwindow .pw 77 69 78 .pw add [Rappture::Tester::TestTree .tree \ 70 79 -testdir $params(-testdir) \ 71 80 -toolxml $params(-tool) \ 72 81 -selectcommand Rappture::Tester::selectionHandler] 82 73 83 .pw add [frame .right] 74 84 Rappture::Tester::TestView .right.view … … 77 87 pack .right.regoldenize -side bottom -anchor e 78 88 pack .right.view -side bottom -expand yes -fill both 89 79 90 pack .pw -expand yes -fill both 91 80 92 set lastsel "" 81 93 82 94 # TODO: Handle resizing better 83 95 # 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. 85 102 86 103 # ---------------------------------------------------------------------- 87 # USAGE: selectionHandler 104 # USAGE: selectionHandler ?-refresh? 88 105 # 89 106 # Used internally to communicate between the test tree and the right 90 107 # 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. 92 110 # ---------------------------------------------------------------------- 93 111 proc Rappture::Tester::selectionHandler {args} { 94 112 global lastsel 95 113 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 98 116 if {$test != "" && [$test hasRan] && [$test getResult] != "Error"} { 99 117 .right.regoldenize configure -state normal -
trunk/tester/testtree.tcl
r2020 r2030 135 135 itcl::configbody Rappture::Tester::TestTree::selectcommand { 136 136 $itk_component(treeview) configure -selectcommand \ 137 "[itcl::code $ itk_interiorupdateLabel]; $selectcommand"137 "[itcl::code $this updateLabel]; $selectcommand" 138 138 } 139 139 … … 279 279 runTest $id 280 280 } 281 eval $selectcommand 281 eval $selectcommand -refresh 282 282 } 283 283 -
trunk/tester/testview.tcl
r2027 r2030 70 70 } { 71 71 } 72 $itk_component(tabs) insert end " Analyzer" -ipady 25 -fill both72 $itk_component(tabs) insert end "Results" -ipady 25 -fill both 73 73 $itk_component(tabs) insert end "Info" -ipady 25 -fill both \ 74 74 -state disabled … … 77 77 # Rappture::ResultsPage $itk_component(tabs).analyzer 78 78 #} 79 #$itk_component(tabs) tab configure " Analyzer" \79 #$itk_component(tabs) tab configure "Results" \ 80 80 # -window $itk_component(tabs).analyzer 81 81 … … 200 200 Rappture::ResultsPage $itk_component(tabs).analyzer 201 201 } 202 $itk_component(tabs) tab configure " Analyzer" \202 $itk_component(tabs) tab configure "Results" \ 203 203 -window $itk_component(analyzer) 204 204 foreach lib $args { … … 217 217 if {[llength $args] == 0} { 218 218 $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 222 223 $itk_component(tabs) tab configure "Info" -state disabled 223 224 return
Note: See TracChangeset
for help on using the changeset viewer.