From 77279f789456568fe47e6d9d72936eb7fec4080e Mon Sep 17 00:00:00 2001 From: dprotaso Date: Thu, 27 May 2021 21:57:43 -0400 Subject: [PATCH] enable running all tests when watching by pressing 'a' --- internal/filewatcher/term_unix.go | 3 +++ internal/filewatcher/watch.go | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/filewatcher/term_unix.go b/internal/filewatcher/term_unix.go index a277b9a4..303d6bcc 100644 --- a/internal/filewatcher/term_unix.go +++ b/internal/filewatcher/term_unix.go @@ -80,6 +80,9 @@ func (r *redoHandler) Run(ctx context.Context) { case 'd': chResume = make(chan struct{}) r.ch <- RunOptions{Debug: true, resume: chResume} + case 'a': + chResume = make(chan struct{}) + r.ch <- RunOptions{resume: chResume, PkgPath: "./..."} case '\n': fmt.Println() continue diff --git a/internal/filewatcher/watch.go b/internal/filewatcher/watch.go index a24bcf5b..447c6894 100644 --- a/internal/filewatcher/watch.go +++ b/internal/filewatcher/watch.go @@ -56,7 +56,9 @@ func Watch(dirs []string, run func(opts RunOptions) error) error { resetTimer(timer) redo.ResetTerm() - opts.PkgPath = h.lastPath + if opts.PkgPath == "" { + opts.PkgPath = h.lastPath + } if err := h.runTests(opts); err != nil { return fmt.Errorf("failed to rerun tests for %v: %v", opts.PkgPath, err) }