diff options
Diffstat (limited to 'adapters/gtest/config.go')
| -rw-r--r-- | adapters/gtest/config.go | 42 | 
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)  | 
