Skip to content

Commit

Permalink
Run tests within Emacs.
Browse files Browse the repository at this point in the history
  • Loading branch information
magnars committed Jun 16, 2012
1 parent f5af5d3 commit 714872b
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ All keybindings in buster-mode start with `C-c C-b` and then a two-letter mnemon

* `td`: toggle-deferred will toggle // in the name of the current test.
* `tf`: toggle-focus-rocket will toggle => in the name of the current test.
* `ra`: run-all-tests

## Development

Expand Down
7 changes: 7 additions & 0 deletions buster-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,20 @@
(interactive)
(buster-toggle-test-name-prefix "=>"))

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

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

(define-key buster-mode-map
(kbd "C-c C-b td") 'buster-toggle-deffered)
(define-key buster-mode-map
(kbd "C-c C-b tf") 'buster-toggle-focus-rocket)
(define-key buster-mode-map
(kbd "C-c C-b ra") 'buster-run-all-tests)

(define-minor-mode buster-mode
"Buster mode"
Expand Down
14 changes: 14 additions & 0 deletions buster-test
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
echo "Configuration: .......
cleanReporter: .....
lintScanner: .....................
growlReporter: ........
jslint-linter: .............
lintReporter: ...
watchForLint: ..
newFileReporter: .....
pluralize: ..
print: ......
summaryReporter: ........A.
repository: .................
checkedFile: ............
13 test cases, 110 tests, 148 assertions, 0 failures, 0 errors, 0 timeouts"
7 changes: 7 additions & 0 deletions features/run-all-tests.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Feature: Run all tests

Scenario: Opens a buffer with test results
When I turn on buster-mode
And I press "C-c C-b ra"
And I switch to buffer "*buster-test*"
Then I should see "0 timeouts"
4 changes: 2 additions & 2 deletions run-tests.watchr
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ end

def run_all_tests
system('clear')
result = run "./util/ecukes/ecukes"
result = run "env PATH=.:$PATH ./util/ecukes/ecukes"
puts result
end

def run_test(file)
system('clear')
result = run "./util/ecukes/ecukes #{file}"
result = run "env PATH=.:$PATH ./util/ecukes/ecukes #{file}"
puts result
end

Expand Down

0 comments on commit 714872b

Please sign in to comment.