class: RegressionTests::DebuggerTest
changed:
#testBlockVars_01
#testBlockVars_02
check automatically, without user interaction
--- a/RegressionTests__DebuggerTest.st Thu Jun 26 13:24:25 2014 +0200
+++ b/RegressionTests__DebuggerTest.st Thu Jul 17 15:08:01 2014 +0200
@@ -40,7 +40,9 @@
!DebuggerTest methodsFor:'tests'!
testBlockVars_01
- |a b|
+ |a b me contextInspectorOK|
+
+ contextInspectorOK := true.
a := #( 1 2 3 4 ).
b := #( 9 8 7 6 ).
@@ -50,7 +52,45 @@
" eachA must be 1
eachB must be 9
"
- self halt:'check variables in the debugger'
+
+ "/ cg: wait for the debugger to come up,
+ "/ take a look at its local-variables inspector...
+
+ me := Processor activeProcess.
+
+ [
+ |debuggers theDebugger fieldList idx|
+
+ Delay waitForSeconds:0.5.
+
+ debuggers := DebugView allInstances select:[:dbg | dbg inspectedProcess == me].
+ self assert:(debuggers size == 1).
+ theDebugger := debuggers first.
+ fieldList := theDebugger contextInspector fieldList.
+ idx := fieldList findFirst:[:e | e string startsWith:'eachB '].
+ idx == 0 ifTrue:[
+ contextInspectorOK := false
+ ] ifFalse:[
+ (theDebugger contextInspector valueAtLine:idx) == eachB ifFalse:[
+ contextInspectorOK := false
+ ].
+ ].
+ idx := fieldList findFirst:[:e | e string startsWith:'eachA '].
+ idx == 0 ifTrue:[
+ contextInspectorOK := false
+ ] ifFalse:[
+ (theDebugger contextInspector valueAtLine:idx) == eachA ifFalse:[
+ contextInspectorOK := false
+ ].
+ ].
+ me interruptWith:[theDebugger doAbort "AbortOperationRequest raise"].
+ ] fork.
+
+ AbortOperationRequest handle:[:ex |
+ ] do:[
+ self halt:'checking variables in the debugger...'.
+ ].
+ self assert:contextInspectorOK.
]
]
@@ -61,7 +101,9 @@
!
testBlockVars_02
- |a b|
+ |a b contextInspectorOK me|
+
+ contextInspectorOK := true.
a := #( 1 2 3 4 ).
b := #( 9 8 7 6 ).
@@ -78,7 +120,44 @@
" eachA must be 1 ; outer must be 2
eachB must be 9 ; inner must be 10.
"
- self halt:'check variables in the debugger'
+ "/ cg: wait for the debugger to come up,
+ "/ take a look at its local-variables inspector...
+
+ me := Processor activeProcess.
+
+ [
+ |debuggers theDebugger fieldList idx|
+
+ Delay waitForSeconds:0.5.
+
+ debuggers := DebugView allInstances select:[:dbg | dbg inspectedProcess == me].
+ self assert:(debuggers size == 1).
+ theDebugger := debuggers first.
+ fieldList := theDebugger contextInspector fieldList.
+ idx := fieldList findFirst:[:e | e string startsWith:'eachB '].
+ idx == 0 ifTrue:[
+ contextInspectorOK := false
+ ] ifFalse:[
+ (theDebugger contextInspector valueAtLine:idx) == eachB ifFalse:[
+ contextInspectorOK := false
+ ].
+ ].
+ idx := fieldList findFirst:[:e | e string startsWith:'eachA '].
+ idx == 0 ifTrue:[
+ contextInspectorOK := false
+ ] ifFalse:[
+ (theDebugger contextInspector valueAtLine:idx) == eachA ifFalse:[
+ contextInspectorOK := false
+ ].
+ ].
+ me interruptWith:[theDebugger doAbort "AbortOperationRequest raise"].
+ ] fork.
+
+ AbortOperationRequest handle:[:ex |
+ ] do:[
+ self halt:'checking variables in the debugger...'.
+ ].
+ self assert:contextInspectorOK.
]
]
@@ -113,3 +192,4 @@
version
^ '$Header$'
! !
+