reports/Builder__TestReportFormat.st
branchjv
changeset 565 80afdfe990f9
parent 564 089cc2fa6c6c
child 566 030aa8306eda
equal deleted inserted replaced
564:089cc2fa6c6c 565:80afdfe990f9
   117 
   117 
   118     args := context args.
   118     args := context args.
   119     vars := context vars.
   119     vars := context vars.
   120     rcvr := context receiver.
   120     rcvr := context receiver.
   121     argAndVarNames := context argAndVarNames.
   121     argAndVarNames := context argAndVarNames.
       
   122 
   122     s nextPutAll:'args: '; cr.
   123     s nextPutAll:'args: '; cr.
   123 
   124     self writeContextArgs: context on: s.
   124     args keysAndValuesDo:[:idx :eachArg |
   125 
   125         self writeVariable: (argAndVarNames at: idx ifAbsent:['???']) index: idx value: eachArg on: s. 
       
   126     ].
       
   127     s nextPutAll:'vars: '; cr.
   126     s nextPutAll:'vars: '; cr.
   128     vars keysAndValuesDo:[:idx :eachVar |
   127     self writeContextVars: context on: s.
   129         self writeVariable: (argAndVarNames at: idx + args size ifAbsent:['???']) index: idx value: eachVar on: s. 
   128 
   130     ].
       
   131     s nextPutAll:'inst: '; cr.
   129     s nextPutAll:'inst: '; cr.
   132     rcvr class allInstVarNames keysAndValuesDo:[ :idx :eachNam |
   130     rcvr class allInstVarNames keysAndValuesDo:[ :idx :eachNam |
   133         self writeVariable: eachNam index: idx value: (rcvr instVarNamed: eachNam) on: s.         
   131         self writeVariable: eachNam index: idx value: (rcvr instVarNamed: eachNam) on: s.         
   134     ].
   132     ].
   135 
   133 
   191     String streamContents:[ :s | Builder::TestReportFormat new writeContext: thisContext on: s ]
   189     String streamContents:[ :s | Builder::TestReportFormat new writeContext: thisContext on: s ]
   192     "
   190     "
   193 
   191 
   194     "Created: / 03-08-2011 / 14:53:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   192     "Created: / 03-08-2011 / 14:53:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   195     "Modified: / 15-03-2016 / 14:34:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   193     "Modified: / 15-03-2016 / 14:34:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   196     "Modified: / 02-06-2020 / 11:00:29 / Jan Vrany <jan.vrany@labware.com>"
   194     "Modified: / 02-06-2020 / 11:37:16 / Jan Vrany <jan.vrany@labware.com>"
       
   195 !
       
   196 
       
   197 writeContextArgs: context on: s
       
   198     | current |
       
   199 
       
   200     current := context.
       
   201     [ current notNil ] whileTrue:[
       
   202         | args names |
       
   203 
       
   204         args := current args.
       
   205         names := current argAndVarNames.
       
   206 
       
   207         args keysAndValuesDo:[:idx :eachArg |
       
   208             self writeVariable: (names at: idx ifAbsent:['???']) index: idx value: eachArg on: s. 
       
   209         ].
       
   210         current := current home.
       
   211         current notNil ifTrue:[ s cr ].
       
   212     ]
       
   213 
       
   214     "Created: / 02-06-2020 / 11:33:55 / Jan Vrany <jan.vrany@labware.com>"
       
   215 !
       
   216 
       
   217 writeContextVars: context on: s
       
   218     | current |
       
   219 
       
   220     current := context.
       
   221     [ current notNil ] whileTrue:[
       
   222         | vars names nargs |
       
   223 
       
   224         vars := current vars.
       
   225         names := current argAndVarNames.
       
   226         nargs := current numArgs.
       
   227 
       
   228         vars keysAndValuesDo:[:idx :eachArg |
       
   229             self writeVariable: (names at: idx + nargs ifAbsent:['???']) index: idx value: eachArg on: s. 
       
   230         ].
       
   231         current := current home.
       
   232         current notNil ifTrue:[ s cr ].
       
   233     ]
       
   234 
       
   235     "Created: / 02-06-2020 / 11:36:29 / Jan Vrany <jan.vrany@labware.com>"
   197 !
   236 !
   198 
   237 
   199 writeStackTrace:err of:aTestCase on: str
   238 writeStackTrace:err of:aTestCase on: str
   200 
   239 
   201     | context |
   240     | context |