aboutsummaryrefslogtreecommitdiff
path: root/adapters
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2021-09-03 00:51:47 -0500
committerFurkan Sahin <furkan-dev@proton.me>2021-09-03 00:51:47 -0500
commitadccaeb36de036904c735ca5face1c929a4ba0b2 (patch)
treec15e11fddd71ec24f0f9b52adf4119aa4038543b /adapters
parent571abf917bb3a6aa7ac7dd40969ed59ce84d78db (diff)
BUG: Fix decoding when no defaults is present
Diffstat (limited to 'adapters')
-rw-r--r--adapters/gtest/config.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/adapters/gtest/config.go b/adapters/gtest/config.go
index 173809d..ba7efb1 100644
--- a/adapters/gtest/config.go
+++ b/adapters/gtest/config.go
@@ -8,11 +8,16 @@ import (
"path"
)
+const (
+ DEFAULT_TIMEOUT = 1000
+)
+
type GtestDefaults struct {
Name *string
Suite *string
Testfile *string
Srcs *[]string
+ Timeout *uint
}
func (child *GtestDefaults) Inherit(p interface{}) {
@@ -22,6 +27,7 @@ func (child *GtestDefaults) Inherit(p interface{}) {
if(child.Suite == nil) { child.Suite = parent.Suite }
if(child.Testfile == nil) { child.Testfile = parent.Testfile }
if(child.Srcs == nil) { child.Srcs = parent.Srcs }
+ if(child.Timeout == nil) { child.Timeout = parent.Timeout }
}
@@ -37,6 +43,11 @@ func (g GtestConfig) ensureSatisfied(path string) {
} else if g.Testfile == nil {
log.Fatalf("\"testfile\" is not defined for unit: %s\n", path)
}
+
+ if g.Timeout == nil {
+ g.Timeout = new(uint)
+ *g.Timeout = DEFAULT_TIMEOUT;
+ }
}
func (cfg GtestConfig) srcList(srcDir string) string {