aboutsummaryrefslogtreecommitdiff
path: root/adapters/gtest/config.go
diff options
context:
space:
mode:
authorFlu0r1ne <flur01ne@flu0r1ne.net>2021-09-06 01:58:42 -0500
committerFlu0r1ne <flur01ne@flu0r1ne.net>2021-09-06 01:58:42 -0500
commit788ae3e0266bdb12bdff6c260dda2e3bcbdfc79c (patch)
tree22f2dab21e0c6b56085f88fb0047945edc735e23 /adapters/gtest/config.go
parentccb11dfb1e539b4e5732442a7a1f701996b608c5 (diff)
downloadplanr-788ae3e0266bdb12bdff6c260dda2e3bcbdfc79c.tar.xz
planr-788ae3e0266bdb12bdff6c260dda2e3bcbdfc79c.zip
Add directives for compiler options and shared linking
Diffstat (limited to 'adapters/gtest/config.go')
-rw-r--r--adapters/gtest/config.go42
1 files changed, 19 insertions, 23 deletions
diff --git a/adapters/gtest/config.go b/adapters/gtest/config.go
index 533f266..71b5cca 100644
--- a/adapters/gtest/config.go
+++ b/adapters/gtest/config.go
@@ -13,21 +13,25 @@ const (
)
type Defaults struct {
- Name string
- Suite string
- Testfile string
- Srcs []string
- Timeout uint
+ Name string
+ Suite string
+ Testfile string
+ Srcs []string
+ Timeout uint
+ Include_src *bool
+ Compiler_options string
}
func (child *Defaults) Inherit(p interface{}) {
parent := p.(*Defaults)
- if(child.Name == "") { child.Name = parent.Name }
- if(child.Suite == "") { child.Suite = parent.Suite }
- if(child.Testfile == "") { child.Testfile = parent.Testfile }
- if(len(child.Srcs) == 0) { child.Srcs = parent.Srcs }
- if(child.Timeout == 0) { child.Timeout = parent.Timeout }
+ if(child.Name == "") { child.Name = parent.Name }
+ if(child.Suite == "") { child.Suite = parent.Suite }
+ if(child.Testfile == "") { child.Testfile = parent.Testfile }
+ if(len(child.Srcs) == 0) { child.Srcs = parent.Srcs }
+ if(child.Timeout == 0) { child.Timeout = parent.Timeout }
+ if(child.Compiler_options == "") { child.Compiler_options = parent.Compiler_options }
+ if(child.Include_src == nil) { child.Include_src = parent.Include_src}
}
@@ -47,6 +51,11 @@ func (c * Config) finalize(path string) {
if c.Timeout == 0 {
c.Timeout = DEFAULT_TIMEOUT;
}
+
+ if c.Include_src == nil {
+ c.Include_src = new(bool)
+ *c.Include_src = true
+ }
}
func srcList(srcdir string, srcs []string) string {
@@ -61,19 +70,6 @@ func srcList(srcdir string, srcs []string) string {
return builder.String()
}
-func cmakeUnits(e []executable, dirs planr.DirConfig) []cmakeUnit {
-
- units := make([]cmakeUnit, len(e))
- for i, exe := range e {
- testpath := path.Join(dirs.Tests(), exe.testpath)
- srclist := srcList(dirs.Src(), exe.srcs)
-
- units[i] = cmakeUnit { exe.exeNm, testpath, srclist }
- }
-
- return units
-}
-
func finalizeConfigs(tcs []planr.TestCase) {
for i := range tcs {
cfg := tcs[i].AdapterConfig().(*Config)