Permalink
Browse files

Use compile+comint with configurable command

  • Loading branch information...
magnars committed Dec 19, 2012
1 parent b7dcabb commit 54f06810a8ca394d74d51d128163e3d5042b76b9
Showing with 25 additions and 3 deletions.
  1. +4 −2 buster-mode.el
  2. +3 −1 features/run-all-tests.feature
  3. +18 −0 features/step-definitions/basic-steps.el
View
@@ -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")
@@ -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"
@@ -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.