reports/Builder__TestReportFormat.st
changeset 86 29a8a74674f5
parent 67 73732acacfc1
child 88 56c85ef68928
equal deleted inserted replaced
85:df826a8b762e 86:29a8a74674f5
    98 
    98 
    99     |home mthd src|
    99     |home mthd src|
   100     [
   100     [
   101     context printOn: s.
   101     context printOn: s.
   102     s cr.
   102     s cr.
   103 "
   103     s nextPutAll:'receiver: '. context receiver printOn: s. s cr.
   104     s nextPutAll:'receiver: '. self print: context receiver on: s. s cr.
   104     s nextPutAll:'selector: '. context selector printOn: s. s cr.
   105     s nextPutAll:'selector: '. self print:context selector on: s. s cr.
       
   106     s nextPutAll:'args: '; cr.
   105     s nextPutAll:'args: '; cr.
   107     context args keysAndValuesDo:[:idx :eachArg |
   106     context args keysAndValuesDo:[:idx :eachArg |
   108         s nextPutAll:'  '. idx printOn: s. s nextPutAll:': '. self  print: eachArg on: s.s cr.
   107         s nextPutAll:'  '. idx printOn: s. s nextPutAll:': '. eachArg printOn: s.s cr.
   109     ].
   108     ].
   110     s nextPutAll:'vars: '; cr.
   109     s nextPutAll:'vars: '; cr.
   111     context vars keysAndValuesDo:[:idx :eachVar |
   110     context vars keysAndValuesDo:[:idx :eachVar |
   112         s nextPutAll:'  '. idx printOn: s. s nextPutAll:': '. self print: eachVar on: s.s cr.
   111         s nextPutAll:'  '. idx printOn: s. s nextPutAll:': '. eachVar printOn: s.s cr.
   113     ].
   112     ].
   114     s nextPutAll:'source: '; cr.    
   113     s nextPutAll:'source: '; cr.    
   115 
   114 
   116     [
   115     [
   117     home := context methodHome.
   116     home := context methodHome.
   141             s nextPutAll:'   '.
   140             s nextPutAll:'   '.
   142         ].
   141         ].
   143         s nextPutAll: line; cr.
   142         s nextPutAll: line; cr.
   144     ].
   143     ].
   145     s cr.
   144     s cr.
   146 "
       
   147     ] on: Error do:[:ex|
   145     ] on: Error do:[:ex|
   148         s   cr;
   146         s   cr;
   149             nextPutAll:'!!!!!!ERROR WHEN GETTING STACK TRACE!!!!!!'; cr;
   147             nextPutAll:'!!!!!!ERROR WHEN GETTING STACK TRACE!!!!!!'; cr;
   150             nextPutAll: ex description; cr
   148             nextPutAll: ex description; cr
   151     ]
   149     ]
   152 
   150 
   153     "Modified: / 01-04-2011 / 12:00:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   154     "Created: / 03-08-2011 / 14:53:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   151     "Created: / 03-08-2011 / 14:53:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   155 !
   152 !
   156 
   153 
   157 writeStackTrace:err of:aTestCase on: str
   154 writeStackTrace:err of:aTestCase on: str
   158 
   155 
   162     
   159     
   163     [ context isNil 
   160     [ context isNil 
   164         or:[ (context receiver == aTestCase and:[ context selector == #runCase ])
   161         or:[ (context receiver == aTestCase and:[ context selector == #runCase ])
   165             or: [ context receiver == self and:[ context selector == #setUp ] ] ] ] whileFalse:
   162             or: [ context receiver == self and:[ context selector == #setUp ] ] ] ] whileFalse:
   166                 [ self writeContext: context on: str.
   163                 [ self writeContext: context on: str.
       
   164                 str cr; cr.
   167                 context := context sender ]
   165                 context := context sender ]
   168 
   166 
   169     "Created: / 03-08-2011 / 14:53:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   167     "Created: / 03-08-2011 / 14:53:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   170 ! !
   168 ! !
   171 
   169 
   269             nextPut:$<; nextPutAll: outcome;
   267             nextPut:$<; nextPutAll: outcome;
   270             nextPutAll:' type="';
   268             nextPutAll:' type="';
   271             nextPutAll:(self encode:type);
   269             nextPutAll:(self encode:type);
   272             nextPutAll:'" message="';
   270             nextPutAll:'" message="';
   273             nextPutAll:(self encode: message);
   271             nextPutAll:(self encode: message);
   274             nextPutAll:'">';
   272             nextPutAll:'"><!![CDATA['; cr;
   275             nextPutAll:(self encode:stacktrace ? 'stacktrace not available');
   273             nextPutAll:(stacktrace ? 'stacktrace not available');
   276             nextPutAll:'</'; nextPutAll: outcome; nextPutAll:'>';
   274             nextPutAll:']]></'; nextPutAll: outcome; nextPutAll:'>';
   277             nextPut:Character lf
   275             nextPut:Character lf
   278     ].
   276     ].
   279     stream tab; 
   277     stream tab; 
   280             nextPutAll: '</testcase>'; cr.
   278             nextPutAll: '</testcase>'; cr.
   281 
   279