]> git.notmuchmail.org Git - notmuch/commitdiff
test: cleanup test_emacs
authorDmitry Kurochkin <dmitry.kurochkin@gmail.com>
Tue, 28 Jun 2011 04:45:04 +0000 (08:45 +0400)
committerCarl Worth <cworth@cworth.org>
Tue, 28 Jun 2011 22:06:47 +0000 (15:06 -0700)
Move auxiliary function definition and configuration from command
line to test-lib.el.

test/test-lib.el
test/test-lib.sh

index 943999622d927265357a984efce409e5a883b3ba..344a02e8bf809e731528de3211517d2eec63adec 100644 (file)
 ;;
 ;; Authors: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
 
+;; avoid crazy 10-column default of --batch
+(set-frame-width (window-frame (get-buffer-window)) 80)
+
+(defun notmuch-test-wait ()
+  "Wait for process completion."
+  (while (get-buffer-process (current-buffer))
+    (sleep-for 0.1)))
+
 (defun visible-buffer-string ()
   "Same as `buffer-string', but excludes invisible text."
   (visible-buffer-substring (point-min) (point-max)))
index 3ec388c81c83e031621582664f3274002f681d2b..5f6196036a967b5866aef48dfc1928e199f5623f 100755 (executable)
@@ -852,18 +852,11 @@ fi
 # --directory          Ensure that the local elisp sources are found
 #
 # --load               Force loading of notmuch.el and test-lib.el
-#
-# notmuch-test-wait    Function for tests to use to wait for process completion
-#
-# set-frame-width      80 columns (avoids crazy 10-column default of --batch)
 
 emacs \$BATCH --no-init-file --no-site-file \
        --directory ../../emacs --load notmuch.el \
        --directory .. --load test-lib.el \
-       --eval "(defun notmuch-test-wait ()
-                       (while (get-buffer-process (current-buffer))
-                               (sleep-for 0.1)))" \
-       --eval "(progn (set-frame-width (window-frame (get-buffer-window)) 80) \$@)"
+       --eval "(progn \$@)"
 EOF
        chmod a+x ./run_emacs
        ./run_emacs "$@"