@@ -44,6 +44,7 @@ type TestResult struct {
4444 FailedProperty string
4545 Diff string
4646 Error error
47+ Skipped bool
4748}
4849
4950// GetEventHandler create a new runtime.EventHandler
@@ -53,6 +54,12 @@ func (w *OutputWriter) GetEventHandler() *runtime.EventHandler {
5354 tr := convertTestResult (testResult )
5455 w .printResult (tr )
5556 }
57+
58+ handler .TestSkipped = func (testResult runtime.TestResult ) {
59+ tr := convertTestResult (testResult )
60+ w .printSkip (tr )
61+ }
62+
5663 return & handler
5764}
5865
@@ -74,7 +81,7 @@ func (w *OutputWriter) PrintSummary(result runtime.Result) bool {
7481 return result .Failed == 0
7582}
7683
77- // PrintResult prints the simple output form of a TestReault
84+ // printResult prints the simple output form of a TestReault
7885func (w * OutputWriter ) printResult (r TestResult ) {
7986 if ! r .Success {
8087 w .fprintf (w .au .Red (w .template .testResult (r )))
@@ -83,18 +90,27 @@ func (w *OutputWriter) printResult(r TestResult) {
8390 w .fprintf (w .template .testResult (r ))
8491}
8592
93+ func (w * OutputWriter ) printSkip (r TestResult ) {
94+ w .fprintf (fmt .Sprintf ("- [%s] %s, was skipped" , r .Node , r .Title ))
95+ }
96+
8697func (w * OutputWriter ) printFailures (results []runtime.TestResult ) {
8798 w .fprintf ("" )
8899 w .fprintf (w .au .Bold ("Results" ))
89100 w .fprintf (w .au .Bold ("" ))
90101
91102 for _ , tr := range results {
92103 r := convertTestResult (tr )
104+ if r .Skipped {
105+ continue
106+ }
107+
93108 if r .Error != nil {
94109 w .fprintf (w .au .Bold (w .au .Red (w .template .errors (r ))))
95110 w .fprintf (r .Error .Error ())
96111 continue
97112 }
113+
98114 if ! r .Success {
99115 w .fprintf (w .au .Bold (w .au .Red (w .template .failures (r ))))
100116 w .fprintf (r .Diff )
@@ -119,6 +135,7 @@ func convertTestResult(tr runtime.TestResult) TestResult {
119135 FailedProperty : tr .FailedProperty ,
120136 Diff : tr .ValidationResult .Diff ,
121137 Error : tr .TestCase .Result .Error ,
138+ Skipped : tr .Skipped ,
122139 }
123140
124141 return testResult
0 commit comments