diff options
Diffstat (limited to 'tests')
51 files changed, 96 insertions, 656 deletions
diff --git a/tests/test-bootstrap.el b/tests/test-bootstrap.el new file mode 100644 index 0000000..eb46909 --- /dev/null +++ b/tests/test-bootstrap.el @@ -0,0 +1,32 @@ +;;; test-bootstrap.el --- Common test initialization for chime -*- lexical-binding: t; -*- + +;;; Commentary: + +;; Shared initialization for all chime test files. +;; Handles package setup, dependency loading, and chime initialization. +;; +;; Usage: (require 'test-bootstrap (expand-file-name "test-bootstrap.el")) +;; +;; For debug tests, set chime-debug BEFORE requiring this file: +;; (setq chime-debug t) +;; (require 'test-bootstrap (expand-file-name "test-bootstrap.el")) + +;;; Code: + +;; Initialize package system for batch mode +(when noninteractive + (package-initialize)) + +(require 'ert) + +;; Load dependencies required by chime +(require 'dash) +(require 'alert) +(require 'async) +(require 'org-agenda) + +;; Load chime from parent directory +(load (expand-file-name "../chime.el") nil t) + +(provide 'test-bootstrap) +;;; test-bootstrap.el ends here diff --git a/tests/test-chime--deduplicate-events-by-title.el b/tests/test-chime--deduplicate-events-by-title.el index fb0bd40..69bb632 100644 --- a/tests/test-chime--deduplicate-events-by-title.el +++ b/tests/test-chime--deduplicate-events-by-title.el @@ -27,21 +27,8 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Enable debug mode and load chime (setq chime-debug t) -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-chime--time=.el b/tests/test-chime--time=.el index c413257..ac3d69f 100644 --- a/tests/test-chime--time=.el +++ b/tests/test-chime--time=.el @@ -24,16 +24,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) -(require 'dash) -(require 'alert) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;;; Setup and Teardown diff --git a/tests/test-chime--today.el b/tests/test-chime--today.el index a0f79d0..fef81ea 100644 --- a/tests/test-chime--today.el +++ b/tests/test-chime--today.el @@ -24,16 +24,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) -(require 'dash) -(require 'alert) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;;; Setup and Teardown diff --git a/tests/test-chime--truncate-title.el b/tests/test-chime--truncate-title.el index 7c36cb9..19293ef 100644 --- a/tests/test-chime--truncate-title.el +++ b/tests/test-chime--truncate-title.el @@ -24,16 +24,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) -(require 'dash) -(require 'alert) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;;; Setup and Teardown diff --git a/tests/test-chime-12hour-format.el b/tests/test-chime-12hour-format.el index 98f63dd..0fcb91a 100644 --- a/tests/test-chime-12hour-format.el +++ b/tests/test-chime-12hour-format.el @@ -28,21 +28,8 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Enable debug mode and load chime (setq chime-debug t) -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-chime-all-day-events.el b/tests/test-chime-all-day-events.el index 2dbffd6..c0923e4 100644 --- a/tests/test-chime-all-day-events.el +++ b/tests/test-chime-all-day-events.el @@ -8,13 +8,7 @@ ;;; Code: -(when noninteractive - (package-initialize)) - -(require 'ert) -(require 'dash) -(require 'org-agenda) -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) (require 'testutil-general (expand-file-name "testutil-general.el")) (require 'testutil-time (expand-file-name "testutil-time.el")) diff --git a/tests/test-chime-apply-blacklist.el b/tests/test-chime-apply-blacklist.el index 4b0d270..036f2a4 100644 --- a/tests/test-chime-apply-blacklist.el +++ b/tests/test-chime-apply-blacklist.el @@ -25,20 +25,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-chime-apply-whitelist.el b/tests/test-chime-apply-whitelist.el index c5cdd63..e61f3c3 100644 --- a/tests/test-chime-apply-whitelist.el +++ b/tests/test-chime-apply-whitelist.el @@ -25,20 +25,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-chime-calendar-url.el b/tests/test-chime-calendar-url.el index 34fd1ef..29ebe1e 100644 --- a/tests/test-chime-calendar-url.el +++ b/tests/test-chime-calendar-url.el @@ -2,16 +2,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) -(require 'dash) -(require 'alert) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;;; Tests for chime--open-calendar-url diff --git a/tests/test-chime-check-event.el b/tests/test-chime-check-event.el index d7ba91f..e362504 100644 --- a/tests/test-chime-check-event.el +++ b/tests/test-chime-check-event.el @@ -24,20 +24,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-chime-check-interval.el b/tests/test-chime-check-interval.el index 32ff6f8..74cbe14 100644 --- a/tests/test-chime-check-interval.el +++ b/tests/test-chime-check-interval.el @@ -24,20 +24,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-chime-day-wide-time-matching.el b/tests/test-chime-day-wide-time-matching.el index 0e92093..3025d97 100644 --- a/tests/test-chime-day-wide-time-matching.el +++ b/tests/test-chime-day-wide-time-matching.el @@ -31,20 +31,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-chime-debug-functions.el b/tests/test-chime-debug-functions.el index 811baba..cef9e4c 100644 --- a/tests/test-chime-debug-functions.el +++ b/tests/test-chime-debug-functions.el @@ -25,21 +25,8 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Enable debug mode and load chime (setq chime-debug t) -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) (require 'chime-debug (expand-file-name "../chime-debug.el")) ;; Load test utilities diff --git a/tests/test-chime-event-is-today.el b/tests/test-chime-event-is-today.el index 112512b..ef7bdc6 100644 --- a/tests/test-chime-event-is-today.el +++ b/tests/test-chime-event-is-today.el @@ -29,20 +29,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-chime-extract-time.el b/tests/test-chime-extract-time.el index 679a43b..120c45b 100644 --- a/tests/test-chime-extract-time.el +++ b/tests/test-chime-extract-time.el @@ -26,20 +26,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-chime-extract-title.el b/tests/test-chime-extract-title.el index ad100e0..ea53beb 100644 --- a/tests/test-chime-extract-title.el +++ b/tests/test-chime-extract-title.el @@ -25,20 +25,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-chime-filter-day-wide-events.el b/tests/test-chime-filter-day-wide-events.el index 885a10d..1e74ed2 100644 --- a/tests/test-chime-filter-day-wide-events.el +++ b/tests/test-chime-filter-day-wide-events.el @@ -26,20 +26,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-chime-format-event-for-tooltip.el b/tests/test-chime-format-event-for-tooltip.el index 92f7473..5e2cabb 100644 --- a/tests/test-chime-format-event-for-tooltip.el +++ b/tests/test-chime-format-event-for-tooltip.el @@ -24,20 +24,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-chime-format-refresh.el b/tests/test-chime-format-refresh.el index 9d15bc6..0e2b58b 100644 --- a/tests/test-chime-format-refresh.el +++ b/tests/test-chime-format-refresh.el @@ -24,20 +24,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-chime-gather-info.el b/tests/test-chime-gather-info.el index 7d487f5..132f0ad 100644 --- a/tests/test-chime-gather-info.el +++ b/tests/test-chime-gather-info.el @@ -26,20 +26,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-chime-get-tags.el b/tests/test-chime-get-tags.el index 75cad00..f2fd6c4 100644 --- a/tests/test-chime-get-tags.el +++ b/tests/test-chime-get-tags.el @@ -25,20 +25,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-chime-group-events-by-day.el b/tests/test-chime-group-events-by-day.el index c1038ff..09c7d0e 100644 --- a/tests/test-chime-group-events-by-day.el +++ b/tests/test-chime-group-events-by-day.el @@ -29,20 +29,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-chime-has-timestamp.el b/tests/test-chime-has-timestamp.el index 6accb68..1c79fb7 100644 --- a/tests/test-chime-has-timestamp.el +++ b/tests/test-chime-has-timestamp.el @@ -24,20 +24,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-chime-log-silently.el b/tests/test-chime-log-silently.el index e08987f..74bb77f 100644 --- a/tests/test-chime-log-silently.el +++ b/tests/test-chime-log-silently.el @@ -24,20 +24,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;;; Normal Cases diff --git a/tests/test-chime-make-tooltip.el b/tests/test-chime-make-tooltip.el index f51a3b3..54830d3 100644 --- a/tests/test-chime-make-tooltip.el +++ b/tests/test-chime-make-tooltip.el @@ -25,20 +25,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) @@ -65,7 +52,7 @@ ;;; Each item is (EVENT TIME-INFO MINUTES-UNTIL) where ;;; TIME-INFO is (TIMESTAMP-STR . TIME-OBJECT) -(defun test-make-upcoming-item (title time minutes-until) +(defun test-tooltip--make-upcoming-item (title time minutes-until) "Create an upcoming-events list item for TITLE at TIME, MINUTES-UNTIL from now." (let ((ts (test-timestamp-string time))) (list `((title . ,title) @@ -84,7 +71,7 @@ (unwind-protect (let* ((now (test-time-now)) (event-time (time-add now (seconds-to-time 1800))) ;; 30 min - (upcoming (list (test-make-upcoming-item "Team Meeting" event-time 30)))) + (upcoming (list (test-tooltip--make-upcoming-item "Team Meeting" event-time 30)))) (with-test-time now (let ((result (chime--make-tooltip upcoming))) (should (stringp result)) @@ -102,9 +89,9 @@ (unwind-protect (let* ((now (test-time-now)) (upcoming (list - (test-make-upcoming-item "Event 1" (time-add now (seconds-to-time 600)) 10) - (test-make-upcoming-item "Event 2" (time-add now (seconds-to-time 1200)) 20) - (test-make-upcoming-item "Event 3" (time-add now (seconds-to-time 1800)) 30))) + (test-tooltip--make-upcoming-item "Event 1" (time-add now (seconds-to-time 600)) 10) + (test-tooltip--make-upcoming-item "Event 2" (time-add now (seconds-to-time 1200)) 20) + (test-tooltip--make-upcoming-item "Event 3" (time-add now (seconds-to-time 1800)) 30))) (chime-modeline-tooltip-max-events 2)) (with-test-time now (let ((result (chime--make-tooltip upcoming))) @@ -123,10 +110,10 @@ (unwind-protect (let* ((now (test-time-now)) (upcoming (list - (test-make-upcoming-item "Event 1" (time-add now (seconds-to-time 600)) 10) - (test-make-upcoming-item "Event 2" (time-add now (seconds-to-time 1200)) 20) - (test-make-upcoming-item "Event 3" (time-add now (seconds-to-time 1800)) 30) - (test-make-upcoming-item "Event 4" (time-add now (seconds-to-time 2400)) 40))) + (test-tooltip--make-upcoming-item "Event 1" (time-add now (seconds-to-time 600)) 10) + (test-tooltip--make-upcoming-item "Event 2" (time-add now (seconds-to-time 1200)) 20) + (test-tooltip--make-upcoming-item "Event 3" (time-add now (seconds-to-time 1800)) 30) + (test-tooltip--make-upcoming-item "Event 4" (time-add now (seconds-to-time 2400)) 40))) (chime-modeline-tooltip-max-events 2)) (with-test-time now (let ((result (chime--make-tooltip upcoming))) @@ -140,9 +127,9 @@ (unwind-protect (let* ((now (test-time-now)) (upcoming (list - (test-make-upcoming-item "Event 1" (time-add now (seconds-to-time 600)) 10) - (test-make-upcoming-item "Event 2" (time-add now (seconds-to-time 1200)) 20) - (test-make-upcoming-item "Event 3" (time-add now (seconds-to-time 1800)) 30))) + (test-tooltip--make-upcoming-item "Event 1" (time-add now (seconds-to-time 600)) 10) + (test-tooltip--make-upcoming-item "Event 2" (time-add now (seconds-to-time 1200)) 20) + (test-tooltip--make-upcoming-item "Event 3" (time-add now (seconds-to-time 1800)) 30))) (chime-modeline-tooltip-max-events nil)) (with-test-time now (let ((result (chime--make-tooltip upcoming))) @@ -169,8 +156,8 @@ (unwind-protect (let* ((now (test-time-now)) (upcoming (list - (test-make-upcoming-item "Event 1" (time-add now (seconds-to-time 600)) 10) - (test-make-upcoming-item "Event 2" (time-add now (seconds-to-time 1200)) 20))) + (test-tooltip--make-upcoming-item "Event 1" (time-add now (seconds-to-time 600)) 10) + (test-tooltip--make-upcoming-item "Event 2" (time-add now (seconds-to-time 1200)) 20))) (chime-modeline-tooltip-max-events 2)) (with-test-time now (let ((result (chime--make-tooltip upcoming))) diff --git a/tests/test-chime-modeline-no-events-text.el b/tests/test-chime-modeline-no-events-text.el index 3a5212a..f64c71f 100644 --- a/tests/test-chime-modeline-no-events-text.el +++ b/tests/test-chime-modeline-no-events-text.el @@ -29,20 +29,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-chime-modeline.el b/tests/test-chime-modeline.el index 8d3e24b..cb046b5 100644 --- a/tests/test-chime-modeline.el +++ b/tests/test-chime-modeline.el @@ -27,20 +27,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-chime-notification-boundaries.el b/tests/test-chime-notification-boundaries.el index 585aeda..853dd4d 100644 --- a/tests/test-chime-notification-boundaries.el +++ b/tests/test-chime-notification-boundaries.el @@ -25,20 +25,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-chime-notification-text.el b/tests/test-chime-notification-text.el index 1cc6266..2446004 100644 --- a/tests/test-chime-notification-text.el +++ b/tests/test-chime-notification-text.el @@ -24,20 +24,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-chime-notifications.el b/tests/test-chime-notifications.el index 927c07d..17ce540 100644 --- a/tests/test-chime-notifications.el +++ b/tests/test-chime-notifications.el @@ -24,20 +24,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-chime-notify.el b/tests/test-chime-notify.el index d96b530..61144c0 100644 --- a/tests/test-chime-notify.el +++ b/tests/test-chime-notify.el @@ -24,20 +24,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-chime-overdue-todos.el b/tests/test-chime-overdue-todos.el index d5504fd..919ceeb 100644 --- a/tests/test-chime-overdue-todos.el +++ b/tests/test-chime-overdue-todos.el @@ -29,20 +29,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-chime-process-notifications.el b/tests/test-chime-process-notifications.el index 9a99354..eddec02 100644 --- a/tests/test-chime-process-notifications.el +++ b/tests/test-chime-process-notifications.el @@ -24,20 +24,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-chime-propertize-modeline.el b/tests/test-chime-propertize-modeline.el index fc210b2..d196605 100644 --- a/tests/test-chime-propertize-modeline.el +++ b/tests/test-chime-propertize-modeline.el @@ -24,20 +24,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-chime-sanitize-title.el b/tests/test-chime-sanitize-title.el index 1a337b6..672cf70 100644 --- a/tests/test-chime-sanitize-title.el +++ b/tests/test-chime-sanitize-title.el @@ -30,20 +30,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-chime-time-left.el b/tests/test-chime-time-left.el index 87bdf1d..25b41d9 100644 --- a/tests/test-chime-time-left.el +++ b/tests/test-chime-time-left.el @@ -24,20 +24,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-chime-time-utilities.el b/tests/test-chime-time-utilities.el index 06e1a3b..4e56cc3 100644 --- a/tests/test-chime-time-utilities.el +++ b/tests/test-chime-time-utilities.el @@ -26,20 +26,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-chime-timestamp-parse.el b/tests/test-chime-timestamp-parse.el index a6f76e7..5dc30bf 100644 --- a/tests/test-chime-timestamp-parse.el +++ b/tests/test-chime-timestamp-parse.el @@ -24,20 +24,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-chime-timestamp-within-interval-p.el b/tests/test-chime-timestamp-within-interval-p.el index fd14941..2cb6439 100644 --- a/tests/test-chime-timestamp-within-interval-p.el +++ b/tests/test-chime-timestamp-within-interval-p.el @@ -24,20 +24,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-chime-tooltip-bugs.el b/tests/test-chime-tooltip-bugs.el index dce2fa5..8a11317 100644 --- a/tests/test-chime-tooltip-bugs.el +++ b/tests/test-chime-tooltip-bugs.el @@ -7,15 +7,7 @@ ;;; Code: -(when noninteractive - (package-initialize)) - -(require 'ert) -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) (require 'testutil-general (expand-file-name "testutil-general.el")) (require 'testutil-time (expand-file-name "testutil-time.el")) diff --git a/tests/test-chime-tooltip-day-calculation.el b/tests/test-chime-tooltip-day-calculation.el index 5d0901d..1a25767 100644 --- a/tests/test-chime-tooltip-day-calculation.el +++ b/tests/test-chime-tooltip-day-calculation.el @@ -12,11 +12,7 @@ ;;; Code: -(require 'ert) -(require 'package) -(setq package-user-dir (expand-file-name "~/.emacs.d/elpa")) -(package-initialize) -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) (require 'testutil-time (expand-file-name "testutil-time.el")) (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-chime-update-modeline-helpers.el b/tests/test-chime-update-modeline-helpers.el index 106a7e2..6de1ba0 100644 --- a/tests/test-chime-update-modeline-helpers.el +++ b/tests/test-chime-update-modeline-helpers.el @@ -8,11 +8,7 @@ ;;; Code: -(require 'ert) -(require 'package) -(setq package-user-dir (expand-file-name "~/.emacs.d/elpa")) -(package-initialize) -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) (require 'testutil-time (expand-file-name "testutil-time.el")) (require 'testutil-general (expand-file-name "testutil-general.el")) (require 'testutil-events (expand-file-name "testutil-events.el")) diff --git a/tests/test-chime-update-modeline.el b/tests/test-chime-update-modeline.el index 21660c5..525e39e 100644 --- a/tests/test-chime-update-modeline.el +++ b/tests/test-chime-update-modeline.el @@ -24,20 +24,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-chime-validate-configuration.el b/tests/test-chime-validate-configuration.el index 896ac0f..8bcc16e 100644 --- a/tests/test-chime-validate-configuration.el +++ b/tests/test-chime-validate-configuration.el @@ -23,13 +23,7 @@ ;;; Code: -(when noninteractive - (package-initialize)) - -(require 'ert) -(require 'dash) -(require 'org-agenda) -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) (require 'cl-lib) ;;; Setup and Teardown diff --git a/tests/test-chime-validation-retry.el b/tests/test-chime-validation-retry.el index b35fd29..b4e886c 100644 --- a/tests/test-chime-validation-retry.el +++ b/tests/test-chime-validation-retry.el @@ -19,15 +19,7 @@ ;;; Code: -(require 'ert) - -;; Initialize package system to make installed packages available in batch mode -(require 'package) -(setq package-user-dir (expand-file-name "~/.emacs.d/elpa")) -(package-initialize) - -;; Load chime from parent directory (which will load its dependencies) -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;;; Setup and Teardown diff --git a/tests/test-chime-warn-persistent-failures.el b/tests/test-chime-warn-persistent-failures.el index e24132a..ef66fc2 100644 --- a/tests/test-chime-warn-persistent-failures.el +++ b/tests/test-chime-warn-persistent-failures.el @@ -25,20 +25,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;;; Setup and Teardown diff --git a/tests/test-chime-whitelist-blacklist-conflicts.el b/tests/test-chime-whitelist-blacklist-conflicts.el index bc4a5a8..f79bffd 100644 --- a/tests/test-chime-whitelist-blacklist-conflicts.el +++ b/tests/test-chime-whitelist-blacklist-conflicts.el @@ -28,20 +28,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-integration-chime-mode.el b/tests/test-integration-chime-mode.el index b2ecafa..9e4acc3 100644 --- a/tests/test-integration-chime-mode.el +++ b/tests/test-integration-chime-mode.el @@ -25,20 +25,7 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-integration-recurring-events-tooltip.el b/tests/test-integration-recurring-events-tooltip.el index 96a5cc5..b612755 100644 --- a/tests/test-integration-recurring-events-tooltip.el +++ b/tests/test-integration-recurring-events-tooltip.el @@ -39,21 +39,8 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory (setq chime-debug t) -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) diff --git a/tests/test-integration-startup.el b/tests/test-integration-startup.el index f292b4e..c755d7e 100644 --- a/tests/test-integration-startup.el +++ b/tests/test-integration-startup.el @@ -41,21 +41,8 @@ ;;; Code: -;; Initialize package system for batch mode -(when noninteractive - (package-initialize)) - -(require 'ert) - -;; Load dependencies required by chime -(require 'dash) -(require 'alert) -(require 'async) -(require 'org-agenda) - -;; Load chime from parent directory (setq chime-debug t) -(load (expand-file-name "../chime.el") nil t) +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) ;; Load test utilities (require 'testutil-general (expand-file-name "testutil-general.el")) |
