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 /runner_builder.go | |
parent | 8fa0c34eac027c69a0fce8b5a8251e394cd4d888 (diff) | |
download | planr-2d197f1ce3eac8cecb5a655fcb5343cbe562ab1a.tar.xz planr-2d197f1ce3eac8cecb5a655fcb5343cbe562ab1a.zip |
Add new test runner API
Diffstat (limited to 'runner_builder.go')
-rw-r--r-- | runner_builder.go | 42 |
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, + } +} |