aboutsummaryrefslogtreecommitdiff
path: root/tests/test-bootstrap.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-04-04 13:05:01 -0500
committerCraig Jennings <c@cjennings.net>2026-04-04 13:05:01 -0500
commit6f32d5c8a32f78786a612d0105a32d6856fd87ea (patch)
tree5dd7ce8550fb2beed1a917c69b4bf42a3f84336b /tests/test-bootstrap.el
parentbd71f97afce6503de150c6ac27051cbd5fd3a4ea (diff)
downloadchime-6f32d5c8a32f78786a612d0105a32d6856fd87ea.tar.gz
chime-6f32d5c8a32f78786a612d0105a32d6856fd87ea.zip
Extract test boilerplate into shared test-bootstrap.el
All 50 test files that load chime.el repeated the same 8-line initialization block (package-initialize, ert, dash, alert, async, org-agenda, chime load). Replace with a single require of test-bootstrap.el. Also fix test-make-upcoming-item name collision between test-chime-make-tooltip.el and test-chime--deduplicate-events-by-title.el.
Diffstat (limited to 'tests/test-bootstrap.el')
-rw-r--r--tests/test-bootstrap.el32
1 files changed, 32 insertions, 0 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