Skip to content

Commit 54f0681

Browse files
committed
Use compile+comint with configurable command
1 parent b7dcabb commit 54f0681

3 files changed

Lines changed: 25 additions & 3 deletions

File tree

buster-mode.el

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,12 @@
5151
(interactive)
5252
(buster-toggle-test-name-prefix "=>"))
5353

54+
(defvar buster-compile-command "buster-test"
55+
"Command used to run Buster tests")
56+
5457
(defun buster-run-all-tests ()
5558
(interactive)
56-
(switch-to-buffer-other-window "*buster-test*")
57-
(call-process "buster-test" nil "*buster-test*" t))
59+
(compile buster-compile-command t))
5860

5961
(defvar buster-mode-map (make-sparse-keymap)
6062
"buster-mode keymap")

features/run-all-tests.feature

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ Feature: Run all tests
22

33
Scenario: Opens a buffer with test results
44
When I turn on buster-mode
5+
And I have passing tests
56
And I press "C-c C-b ra"
6-
And I switch to buffer "*buster-test*"
7+
And I wait for the compilation to finish
8+
And I switch to buffer "*compilation*"
79
Then I should see "0 timeouts"

features/step-definitions/basic-steps.el

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,21 @@
1212
(message "Can not go to character '%s' since it does not exist in the current buffer: %s"))
1313
(assert search nil message word (espuds-buffer-contents))
1414
(if (string-equal "front" pos) (backward-word)))))
15+
16+
(When "^I wait for the compilation to finish$"
17+
(lambda ()
18+
(setq ecukes--waiting-for-compilation t)
19+
20+
(defun ecukes--compilation-finished (&rest ignore)
21+
(setq ecukes--waiting-for-compilation nil)
22+
(remove-hook 'compilation-finish-functions 'ecukes--compilation-finished))
23+
24+
(add-hook 'compilation-finish-functions 'ecukes--compilation-finished)
25+
26+
(while ecukes--waiting-for-compilation
27+
(accept-process-output nil 0.005))
28+
))
29+
30+
(And "^I have passing tests$"
31+
(lambda ()
32+
(setq buster-compile-command "./buster-test")))

0 commit comments

Comments
 (0)