55component {
66
77 /**
8- * @print a print buffer to use
98 * @testData test results from TestBox
109 */
11- function render ( print , testData ){
10+ function render ( testData ){
1211 for ( this Bundle in testData .bundleStats ) {
1312 // Check if the bundle threw a global exception
1413 if ( ! isSimpleValue ( this Bundle .globalException ) ) {
1514 var message = escapeLF (
1615 " #this Bundle .globalException .type #:#this Bundle .globalException .message #:#this Bundle .globalException .detail #"
1716 );
18- print . line ( prependLF ( " <ERROR::>#message #" ) );
17+ printLine ( prependLF ( " <ERROR::>#message #" ) );
1918
2019 // ACF has an array for the stack trace
2120 if ( isSimpleValue ( this Bundle .globalException .stacktrace ) ) {
22- print . line ( prependLF ( " <LOG::-Stacktrace>#escapeLF ( this Bundle .globalException .stacktrace ) #" ) );
21+ printLine ( prependLF ( " <LOG::-Stacktrace>#escapeLF ( this Bundle .globalException .stacktrace ) #" ) );
2322 }
2423 }
2524
2625 var debugMap = prepareDebugBuffer ( this Bundle .debugBuffer );
2726
2827 // Generate reports for each suite
2928 for ( var suiteStats in this Bundle .suiteStats ) {
30- genSuiteReport ( suiteStats = suiteStats , bundleStats = this Bundle , print = print , debugMap = debugMap );
29+ genSuiteReport ( suiteStats = suiteStats , bundleStats = this Bundle , debugMap = debugMap );
3130 }
3231 }
3332 }
@@ -36,28 +35,27 @@ component {
3635 * Recursive Output for suites
3736 * @suiteStats Suite stats
3837 * @bundleStats Bundle stats
39- * @print The print Buffer
4038 */
41- function genSuiteReport ( required suiteStats , required bundleStats , required print , debugMap = {}, labelPrefix = ' ' ){
39+ function genSuiteReport ( required suiteStats , required bundleStats , debugMap = {}, labelPrefix = ' ' ){
4240 labelPrefix & = ' /' & arguments .suiteStats .name ;
43- print . line ( prependLF ( " <DESCRIBE::>#arguments .suiteStats .name #" ) );
41+ printLine ( prependLF ( " <DESCRIBE::>#arguments .suiteStats .name #" ) );
4442
4543 for ( local .this Spec in arguments .suiteStats .specStats ) {
4644 var this SpecLabel = labelPrefix & ' /' & local .this Spec .name ;
47- print . line ( prependLF ( " <IT::>#local .this Spec .name #" ) );
45+ printLine ( prependLF ( " <IT::>#local .this Spec .name #" ) );
4846
4947 if ( debugMap .keyExists ( this SpecLabel ) ) {
50- print . line ( debugMap [ this SpecLabel ] )
48+ printLine ( debugMap [ this SpecLabel ] )
5149 }
5250
5351 if ( local .this Spec .status == " passed" ) {
54- print . line ( prependLF ( " <PASSED::>Test Passed" ) );
52+ printLine ( prependLF ( " <PASSED::>Test Passed" ) );
5553 } else if ( local .this Spec .status == " failed" ) {
56- print . line ( prependLF ( " <FAILED::>#escapeLF ( local .this Spec .failMessage ) #" ) );
54+ printLine ( prependLF ( " <FAILED::>#escapeLF ( local .this Spec .failMessage ) #" ) );
5755 } else if ( local .this Spec .status == " skipped" ) {
58- print . line ( prependLF ( " <FAILED::>Test Skipped" ) );
56+ printLine ( prependLF ( " <FAILED::>Test Skipped" ) );
5957 } else if ( local .this Spec .status == " error" ) {
60- print . line ( prependLF ( " <ERROR::>#escapeLF ( local .this Spec .error .message ) #" ) );
58+ printLine ( prependLF ( " <ERROR::>#escapeLF ( local .this Spec .error .message ) #" ) );
6159
6260 var errorStack = [];
6361 // If there's a tag context, show the file name and line number where the error occurred
@@ -78,23 +76,23 @@ component {
7876 return " at #item .template #:#item .line #" ;
7977 } )
8078 .toList ( " <:LF:>" );
81- print . line ( prependLF ( " <LOG::-Stacktrace>#stacktrace #" ) );
79+ printLine ( prependLF ( " <LOG::-Stacktrace>#stacktrace #" ) );
8280 }
8381 } else {
84- print . line ( prependLF ( " <ERROR::>Unknown test status: #local .this Spec .status #" ) );
82+ printLine ( prependLF ( " <ERROR::>Unknown test status: #local .this Spec .status #" ) );
8583 }
8684
87- print . line ( prependLF ( " <COMPLETEDIN::>#local .this Spec .totalDuration #" ) );
85+ printLine ( prependLF ( " <COMPLETEDIN::>#local .this Spec .totalDuration #" ) );
8886 }
8987
9088 // Handle nested Suites
9189 if ( arguments .suiteStats .suiteStats .len () ) {
9290 for ( local .nestedSuite in arguments .suiteStats .suiteStats ) {
93- genSuiteReport ( local .nestedSuite , arguments .bundleStats , print , debugMap , labelPrefix )
91+ genSuiteReport ( local .nestedSuite , arguments .bundleStats , debugMap , labelPrefix )
9492 }
9593 }
9694
97- print . line ( prependLF ( " <COMPLETEDIN::>#arguments .suiteStats .totalDuration #" ) );
95+ printLine ( prependLF ( " <COMPLETEDIN::>#arguments .suiteStats .totalDuration #" ) );
9896 }
9997
10098 private function escapeLF ( required text ){
@@ -115,4 +113,8 @@ component {
115113
116114 }
117115
116+ private function printLine ( string str ) {
117+ systemoutput ( str , 1 );
118+ }
119+
118120}
0 commit comments