summaryrefslogtreecommitdiff
path: root/adapters/gtest/results.go
diff options
context:
space:
mode:
Diffstat (limited to 'adapters/gtest/results.go')
-rw-r--r--adapters/gtest/results.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/adapters/gtest/results.go b/adapters/gtest/results.go
index 2991823..14f5d1d 100644
--- a/adapters/gtest/results.go
+++ b/adapters/gtest/results.go
@@ -4,7 +4,6 @@ import (
"bytes"
"encoding/json"
"io"
- "log"
"time"
)
@@ -62,19 +61,20 @@ func failureMsg(failures []gFailure) string {
return failure_msg
}
-func decodeResults(r io.Reader) []Result {
+func decodeResults(r io.Reader) ([]Result, error) {
+ decoded := make([]Result, 0)
+
var results gResults
buf := bytes.Buffer{}
if _, err := buf.ReadFrom(r); err != nil {
- log.Fatal(err)
+ return decoded, err
}
if err := json.Unmarshal(buf.Bytes(), &results); err != nil {
- log.Fatal(err)
+ return decoded, err
}
- decoded := make([]Result, 0)
for _, suite := range results.Testsuites {
for _, test := range suite.Testsuite {
n := len(test.Failures)
@@ -91,5 +91,5 @@ func decodeResults(r io.Reader) []Result {
}
}
- return decoded
+ return decoded, nil
}