diff options
author | Flu0r1ne <flur01ne@flu0r1ne.net> | 2021-09-04 15:38:30 -0500 |
---|---|---|
committer | Flu0r1ne <flur01ne@flu0r1ne.net> | 2021-09-04 15:38:30 -0500 |
commit | cc7ba659adbc5ad55e1ce67f76952f2b8392c9c9 (patch) | |
tree | 2df3f62bd4dcda45732b0955f2797596f0ae5743 /adapters/gtest/config.go | |
parent | b3252d2bd488b5b58cf0e46151ff9db0721c5fc6 (diff) | |
download | planr-cc7ba659adbc5ad55e1ce67f76952f2b8392c9c9.tar.xz planr-cc7ba659adbc5ad55e1ce67f76952f2b8392c9c9.zip |
Refactor build/eval pipeline to use clearer IO model and adapter segmentation methods
Diffstat (limited to 'adapters/gtest/config.go')
-rw-r--r-- | adapters/gtest/config.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/adapters/gtest/config.go b/adapters/gtest/config.go index 457eb64..3305977 100644 --- a/adapters/gtest/config.go +++ b/adapters/gtest/config.go @@ -12,7 +12,7 @@ const ( DEFAULT_TIMEOUT = 1000 ) -type GtestDefaults struct { +type Defaults struct { Name *string Suite *string Testfile *string @@ -20,8 +20,8 @@ type GtestDefaults struct { Timeout *uint } -func (child *GtestDefaults) Inherit(p interface{}) { - parent := p.(*GtestDefaults) +func (child *Defaults) Inherit(p interface{}) { + parent := p.(*Defaults) if(child.Name == nil) { child.Name = parent.Name } if(child.Suite == nil) { child.Suite = parent.Suite } @@ -31,11 +31,11 @@ func (child *GtestDefaults) Inherit(p interface{}) { } -type GtestConfig struct { - GtestDefaults +type Config struct { + Defaults } -func (g GtestConfig) ensureSatisfied(path string) { +func (g Config) ensureSatisfied(path string) { if g.Name == nil { log.Fatalf("\"name\" is not defined for unit: %s\n", path) } else if g.Suite == nil { @@ -50,7 +50,7 @@ func (g GtestConfig) ensureSatisfied(path string) { } } -func (cfg GtestConfig) srcList(srcDir string) string { +func (cfg Config) srcList(srcDir string) string { var srcList string if cfg.Srcs != nil { @@ -66,7 +66,7 @@ func (cfg GtestConfig) srcList(srcDir string) string { } func ParseConfig(prim toml.Primitive) (planr.InheritableConfig, error) { - config := GtestConfig{} + config := Config{} if err := toml.PrimitiveDecode(prim, &config); err != nil { return nil, err @@ -76,7 +76,7 @@ func ParseConfig(prim toml.Primitive) (planr.InheritableConfig, error) { } func ParseDefaultConfig(prim toml.Primitive) (planr.InheritableConfig, error) { - config := GtestDefaults{} + config := Defaults{} if err := toml.PrimitiveDecode(prim, &config); err != nil { return nil, err |