aboutsummaryrefslogtreecommitdiff
path: root/runner_builder.go
diff options
context:
space:
mode:
authorFlu0r1ne <flur01ne@flu0r1ne.net>2021-09-03 21:14:28 -0500
committerFlu0r1ne <flur01ne@flu0r1ne.net>2021-09-03 21:14:28 -0500
commit2d197f1ce3eac8cecb5a655fcb5343cbe562ab1a (patch)
tree3b24b0cdd0ddf6456b8bac5fafcf6a1503aaa6aa /runner_builder.go
parent8fa0c34eac027c69a0fce8b5a8251e394cd4d888 (diff)
downloadplanr-2d197f1ce3eac8cecb5a655fcb5343cbe562ab1a.tar.xz
planr-2d197f1ce3eac8cecb5a655fcb5343cbe562ab1a.zip
Add new test runner API
Diffstat (limited to 'runner_builder.go')
-rw-r--r--runner_builder.go42
1 files changed, 42 insertions, 0 deletions
diff --git a/runner_builder.go b/runner_builder.go
new file mode 100644
index 0000000..848d09b
--- /dev/null
+++ b/runner_builder.go
@@ -0,0 +1,42 @@
+package planr
+
+type RunnerBuilder struct {
+ adapters [] Adapter
+ dirs DirConfig
+}
+
+func ConfigureRunner() RunnerBuilder {
+ return RunnerBuilder {}
+}
+
+func RegisterAdapter(b RunnerBuilder, a Adapter) RunnerBuilder {
+ b.adapters = append(b.adapters, a)
+ return b
+}
+
+func SetConfigDirFromTree(b RunnerBuilder, childPath string) RunnerBuilder {
+ b.dirs.SetConfigFromTree(childPath)
+ return b
+}
+
+func SetConfigDir(b RunnerBuilder, dir string) RunnerBuilder {
+ b.dirs.SetConfig(dir)
+ return b
+}
+
+func SetBuildDir(b RunnerBuilder, dir string) RunnerBuilder {
+ b.dirs.SetBuild(dir)
+ return b
+}
+
+func SetSrcDir(b RunnerBuilder, dir string) RunnerBuilder {
+ b.dirs.SetSrc(dir)
+ return b
+}
+
+func (b RunnerBuilder) New() Runner {
+ return Runner {
+ dirs: b.dirs,
+ adapters: b.adapters,
+ }
+}