diff options
author | Flu0r1ne <flur01ne@flu0r1ne.net> | 2021-09-03 21:14:28 -0500 |
---|---|---|
committer | Flu0r1ne <flur01ne@flu0r1ne.net> | 2021-09-03 21:14:28 -0500 |
commit | 2d197f1ce3eac8cecb5a655fcb5343cbe562ab1a (patch) | |
tree | 3b24b0cdd0ddf6456b8bac5fafcf6a1503aaa6aa /cmd | |
parent | 8fa0c34eac027c69a0fce8b5a8251e394cd4d888 (diff) | |
download | deb-planr-2d197f1ce3eac8cecb5a655fcb5343cbe562ab1a.tar.xz deb-planr-2d197f1ce3eac8cecb5a655fcb5343cbe562ab1a.zip |
Add new test runner API
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/planr/main.go | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/cmd/planr/main.go b/cmd/planr/main.go index 277ffc8..b2a0975 100644 --- a/cmd/planr/main.go +++ b/cmd/planr/main.go @@ -27,15 +27,14 @@ func dieUsage() { os.Exit(1) } -func NewRunner() planr.Runner { - r := planr.Runner {} - - r.RegisterAdapter(>est.GtestAdapter{}) +func getConfiguredRunner() planr.Runner { + r := planr.ConfigureRunner() + r = planr.RegisterAdapter(r, gtest.New()) if wd, err := os.Getwd(); err == nil { - r.SetConfigDirFromTree(wd) + r = planr.SetConfigDirFromTree(r, wd) } - + src := flag.String("srcdir", "", "source directory") config := flag.String("configdir", "", "config directory") build := flag.String("builddir", "", "build directory") @@ -43,18 +42,18 @@ func NewRunner() planr.Runner { flag.Parse() if src != nil && *src != "" { - r.SetSrcDir(*src) + r = planr.SetSrcDir(r, *src) } if config != nil && *config != "" { - r.SetConfigDir(*config) + r = planr.SetConfigDir(r, *config) } if build != nil && *build != "" { - r.SetBuildDir(*build) + r = planr.SetBuildDir(r, *build) } - return r + return r.New() } func main() { @@ -66,7 +65,7 @@ func main() { dieUsage() } - runner := NewRunner() + runner := getConfiguredRunner() subcommand := flag.Arg(0) subargs := flag.Args()[1:] |