summaryrefslogtreecommitdiff
path: root/adapters/gtest/results.go
diff options
context:
space:
mode:
authorFlu0r1ne <flur01ne@flu0r1ne.net>2021-08-22 23:27:53 -0500
committerFlu0r1ne <flur01ne@flu0r1ne.net>2021-08-22 23:27:53 -0500
commit24548e87decbdfea38bbf692cecad6d4eefc3ec0 (patch)
tree4f5d1432d1e22a1f19ceabbc92dcdd86bed98017 /adapters/gtest/results.go
parent5d33040ab80b5cce7883b2e5965aa17db2e6515a (diff)
downloaddeb-planr-24548e87decbdfea38bbf692cecad6d4eefc3ec0.tar.xz
deb-planr-24548e87decbdfea38bbf692cecad6d4eefc3ec0.zip
Refactoring & Enhanced logging
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
}