From 788ae3e0266bdb12bdff6c260dda2e3bcbdfc79c Mon Sep 17 00:00:00 2001 From: Flu0r1ne Date: Mon, 6 Sep 2021 01:58:42 -0500 Subject: Add directives for compiler options and shared linking --- adapters/gtest/config.go | 42 +++++++++++++++++++----------------------- 1 file changed, 19 insertions(+), 23 deletions(-) (limited to 'adapters/gtest/config.go') 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) -- cgit v1.2.3