diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2021-09-02 03:14:47 -0500 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2021-09-02 03:14:47 -0500 |
| commit | 2af7117891cdb67758219a7075f39c05dc02f3f5 (patch) | |
| tree | 3d19e0fb7398670db419922414145515b4d5e026 /adapters/gtest/config.go | |
| parent | ac43c7f2d44d5f815d16a01d1171835538b4f532 (diff) | |
Make adapters and internals complient with new directory structure
Diffstat (limited to 'adapters/gtest/config.go')
| -rw-r--r-- | adapters/gtest/config.go | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/adapters/gtest/config.go b/adapters/gtest/config.go index 2db1bfb..bf5c9f2 100644 --- a/adapters/gtest/config.go +++ b/adapters/gtest/config.go @@ -5,6 +5,7 @@ import ( "golang.furkistan.com/planr" "strings" "github.com/BurntSushi/toml" + "path" ) type GtestDefaults struct { @@ -42,29 +43,13 @@ func (g GtestConfig) ensureSatisfied(path string) { } } -func (cfg GtestConfig) joinTests(path_ string) string { - if cfg.Test_root == nil { - return planr.JoinConfigDir("tests", path_) - } - - return planr.JoinConfigDir(*cfg.Test_root, path_) -} - -func (cfg GtestConfig) joinSrcs(path_ string) string { - if cfg.Srcs_root == nil { - return planr.JoinConfigDir("../src", path_) - } - - return planr.JoinConfigDir(*cfg.Srcs_root, path_) -} - -func (cfg GtestConfig) srcList() string { +func (cfg GtestConfig) srcList(srcDir string) string { var srcList string if cfg.Srcs != nil { srcs := make([]string, len(*cfg.Srcs)) for i, src := range *cfg.Srcs { - srcs[i] = "\"" + cfg.joinSrcs(src) + "\"" + srcs[i] = "\"" + path.Join(srcDir, src) + "\"" } srcList = strings.Join(srcs, "\n ") |
