diff options
| author | dickmao <dick.r.chiang@gmail.com> | 2018-08-27 17:00:35 -0400 |
|---|---|---|
| committer | dickmao <dick.r.chiang@gmail.com> | 2018-09-06 09:24:10 -0400 |
| commit | 3222b53d942daa404852e5148ba9d3ebb8fe96d0 (patch) | |
| tree | 37e2af6242423e57adbbc1238433f58c92ac9bd0 /features/support | |
| parent | 67339d896aa65d75272b80134a8128276c8c6a0f (diff) | |
Pre-moves
To activate, look for Chess Display Allow Pre Moves in:
M-x customize-group
chess-display
Tested via:
make test
make test24 (requires evim)
Diffstat (limited to 'features/support')
| -rw-r--r-- | features/support/env.el | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/features/support/env.el b/features/support/env.el index 58ed42f..3429e34 100644 --- a/features/support/env.el +++ b/features/support/env.el @@ -9,9 +9,17 @@ (defvar emacs-chess-root-path (f-parent emacs-chess-features-path)) +;; Nikolaj Schumacher +(defmacro measure-time (&rest body) + "Measure the time it takes to evaluate BODY." + `(let ((time (current-time))) + ,@body + (float-time (time-since time)))) + (add-to-list 'load-path emacs-chess-root-path) (require 'chess-ics) +(require 'chess) (require 'espuds) (require 'ert) (require 'cl) @@ -19,6 +27,18 @@ (Setup (defvar test-display nil) (defvar test-fifo nil) + (defvar test-port nil) + (setq test-port (catch 'loop + (dolist (cand (list "5678" "5413" "5142" "5308" "5987")) + (when (= 1 (call-process "nc" nil nil nil "-z" "localhost" cand)) + (throw 'loop cand))))) + (setq noninteractive t) + (custom-set-variables '(chess-sound-moves nil) + '(chess-display-highlight-last-move t) + '(chess-display-highlight-legal t) + '(chess-display-popup nil) + '(chess-display-allow-pre-moves t) + '(chess-images-separate-frame nil)) ) (Before @@ -30,12 +50,13 @@ (when test-display (chess-module-destroy test-display) (setq test-display nil)) - (when (process-status "*chess-ics*") - (delete-process "*chess-ics*")) - (when test-fifo - (process-send-eof test-fifo) - (delete-process test-fifo) - (setq test-fifo nil)) + (dolist (p (process-list)) + (delete-process p)) + (setq test-fifo nil) + (let ((buf (get-buffer "*Chessboard*")) + (buf2 (get-buffer "*Chessboard*<2>"))) + (if buf (kill-buffer buf)) + (if buf2 (kill-buffer buf2))) ) (Teardown |
