aboutsummaryrefslogtreecommitdiff
path: root/runner.go
diff options
context:
space:
mode:
authorFlu0r1ne <flur01ne@flu0r1ne.net>2021-09-19 00:27:55 -0500
committerFlu0r1ne <flur01ne@flu0r1ne.net>2021-09-19 00:27:55 -0500
commit1d479733bcbeb630557cd07f721d4510e989934c (patch)
tree42422bd0c2ecc51869eceb8bbead8f5c3e58855f /runner.go
parent86d8789f065636779d3cecded363743b2a39bb47 (diff)
downloadplanr-master.tar.xz
planr-master.zip
Add list command, copy for bash command, and ability to run non-directory commands anywhereHEADv0.1.6master
Diffstat (limited to 'runner.go')
-rw-r--r--runner.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/runner.go b/runner.go
index 2f86d2e..11fceab 100644
--- a/runner.go
+++ b/runner.go
@@ -92,6 +92,10 @@ func (r Runner) CollectCases() []TestCase {
}
func (r Runner) Build(tcs []TestCase) {
+ wd, err := os.Getwd()
+ if err != nil {
+ log.Fatal(err)
+ }
if !directoryExists(r.dirs.Build()) {
r.dirs.MkBuild()
@@ -107,9 +111,16 @@ func (r Runner) Build(tcs []TestCase) {
adapter.Build(cases)
}
+
+ safeCd(wd)
}
func (r Runner) Evaluate(tcs []TestCase) []TestResult {
+ wd, err := os.Getwd()
+ if err != nil {
+ log.Fatal(err)
+ }
+
testSets := r.groupByAdapter(tcs)
results := make([]TestResult, 0)
@@ -131,7 +142,7 @@ func (r Runner) Evaluate(tcs []TestCase) []TestResult {
sort.Sort(ByReadIdx(results))
- safeCd(r.dirs.Config())
+ safeCd(wd)
return results
}