changed: stx_6_2_2
authorJan Vrany <jan.vrany@fit.cvut.cz>
Mon, 02 Jul 2012 23:32:29 +0200
changeset 91971a6aa7f424
parent 90 995880ed753c
child 92 545ea8f561b0
changed:
#writeContext:on:
#writeStackTrace:of:on:
reports/Builder__TestReportFormat.st
     1.1 --- a/reports/Builder__TestReportFormat.st	Mon Jul 02 23:32:13 2012 +0200
     1.2 +++ b/reports/Builder__TestReportFormat.st	Mon Jul 02 23:32:29 2012 +0200
     1.3 @@ -108,7 +108,13 @@
     1.4      ].
     1.5      s nextPutAll:'vars: '; cr.
     1.6      context vars keysAndValuesDo:[:idx :eachVar |
     1.7 -        s nextPutAll:'  '. idx printOn: s. s nextPutAll:': '. eachVar printOn: s.s cr.
     1.8 +        s nextPutAll:'  '. idx printOn: s. s nextPutAll:': '. 
     1.9 +        eachVar isString ifTrue:[
    1.10 +            eachVar storeOn: s.
    1.11 +        ] ifFalse:[
    1.12 +            eachVar printOn: s.
    1.13 +        ].
    1.14 +        s cr.
    1.15      ].
    1.16      s nextPutAll:'source: '; cr.    
    1.17  
    1.18 @@ -153,16 +159,22 @@
    1.19  
    1.20  writeStackTrace:err of:aTestCase on: str
    1.21  
    1.22 -    |context|
    1.23 +    | context stop |
    1.24  
    1.25      context := err signalerContext.
    1.26 -    
    1.27 -    [ context isNil 
    1.28 -        or:[ (context receiver == aTestCase and:[ context selector == #runCase ])
    1.29 -            or: [ context receiver == self and:[ context selector == #setUp ] ] ] ] whileFalse:
    1.30 -                [ self writeContext: context on: str.
    1.31 -                str cr; cr.
    1.32 -                context := context sender ]
    1.33 +    stop := false.
    1.34 +
    1.35 +    [ context notNil ] whileTrue:[
    1.36 +        self writeContext: context on: str.
    1.37 +        str cr; cr.
    1.38 +
    1.39 +        context receiver == aTestCase ifTrue:[
    1.40 +            context selector == aTestCase selector ifTrue:[ ^ self ].
    1.41 +            context selector == #setUp ifTrue:[ ^ self ].
    1.42 +        ].
    1.43 +        context := context sender.
    1.44 +
    1.45 +    ].
    1.46  
    1.47      "Created: / 03-08-2011 / 14:53:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    1.48  ! !
    1.49 @@ -269,8 +281,10 @@
    1.50              nextPutAll:(self encode:type);
    1.51              nextPutAll:'" message="';
    1.52              nextPutAll:(self encode: message);
    1.53 -            nextPutAll:'"><!![CDATA['; cr;
    1.54 -            nextPutAll:((stacktrace ? 'stacktrace not available') replaceAll: (Character codePoint:0) with: $?);
    1.55 +            nextPutAll:'"><!![CDATA['; cr.
    1.56 +        stream
    1.57 +            nextPutAll:(stacktrace ? 'stacktrace not available').
    1.58 +        stream
    1.59              nextPutAll:']]></'; nextPutAll: outcome; nextPutAll:'>';
    1.60              nextPut:Character lf
    1.61      ].