Skip to content

Commit

Permalink
Use compile+comint with configurable command
Browse files Browse the repository at this point in the history
  • Loading branch information
magnars committed Dec 19, 2012
1 parent b7dcabb commit 54f0681
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
6 changes: 4 additions & 2 deletions buster-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@
(interactive)
(buster-toggle-test-name-prefix "=>"))

(defvar buster-compile-command "buster-test"
"Command used to run Buster tests")

(defun buster-run-all-tests ()
(interactive)
(switch-to-buffer-other-window "*buster-test*")
(call-process "buster-test" nil "*buster-test*" t))
(compile buster-compile-command t))

(defvar buster-mode-map (make-sparse-keymap)
"buster-mode keymap")
Expand Down
4 changes: 3 additions & 1 deletion features/run-all-tests.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ Feature: Run all tests

Scenario: Opens a buffer with test results
When I turn on buster-mode
And I have passing tests
And I press "C-c C-b ra"
And I switch to buffer "*buster-test*"
And I wait for the compilation to finish
And I switch to buffer "*compilation*"
Then I should see "0 timeouts"
18 changes: 18 additions & 0 deletions features/step-definitions/basic-steps.el
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,21 @@
(message "Can not go to character '%s' since it does not exist in the current buffer: %s"))
(assert search nil message word (espuds-buffer-contents))
(if (string-equal "front" pos) (backward-word)))))

(When "^I wait for the compilation to finish$"
(lambda ()
(setq ecukes--waiting-for-compilation t)

(defun ecukes--compilation-finished (&rest ignore)
(setq ecukes--waiting-for-compilation nil)
(remove-hook 'compilation-finish-functions 'ecukes--compilation-finished))

(add-hook 'compilation-finish-functions 'ecukes--compilation-finished)

(while ecukes--waiting-for-compilation
(accept-process-output nil 0.005))
))

(And "^I have passing tests$"
(lambda ()
(setq buster-compile-command "./buster-test")))

0 comments on commit 54f0681

Please sign in to comment.