aboutsummaryrefslogtreecommitdiff
path: root/tests/check-deps.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-06 10:31:30 -0500
committerCraig Jennings <c@cjennings.net>2026-06-06 10:31:30 -0500
commit95dbb5abdbb746cf5da9f7926740d17205ac8d55 (patch)
tree0e807d43d8f8ce32b3790efc716c433d35ceca3c /tests/check-deps.el
parent6ecd1e9bf1e3d0cdd3861077318541e193ca4532 (diff)
downloadduet-95dbb5abdbb746cf5da9f7926740d17205ac8d55.tar.gz
duet-95dbb5abdbb746cf5da9f7926740d17205ac8d55.zip
build: add Eask, test harness, and dev tooling
I brought the skeleton up to a working package baseline (Phase 0 in the design spec). Eask defines the package and its dev deps. A root Makefile delegates test targets to tests/Makefile and adds compile, coverage, lint, doctor, and clean, matching the layout the other packages use. deps installs both halves DUET needs: the Emacs Lisp deps via eask, and the transport CLIs (rsync, rclone, lftp, unison) via the system package manager, so a contributor's environment is ready before the code that shells out to them. make complexity runs a small homegrown McCabe branch counter (scripts/duet-complexity.el). No off-the-shelf tool measures Emacs Lisp: lizard doesn't support it and codemetrics is an interactive overlay, so DUET owns one. The counting is pure and covered by Normal/Boundary/Error tests. The budget is soft and the target is advisory. The ERT harness (bootstrap, check-deps, per-file undercover coverage) and a smoke test prove the loop works end to end.
Diffstat (limited to 'tests/check-deps.el')
-rw-r--r--tests/check-deps.el43
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/check-deps.el b/tests/check-deps.el
new file mode 100644
index 0000000..55aaae6
--- /dev/null
+++ b/tests/check-deps.el
@@ -0,0 +1,43 @@
+;;; check-deps.el --- Verify test dependencies are loadable -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2026 Craig Jennings
+
+;;; Commentary:
+
+;; Loaded by tests/Makefile's check-deps target after eask has prepared the
+;; test environment. Keep dependency discovery inside Emacs so package.el,
+;; package-vc, Eask, Nix, and pre-populated load-path setups all work the same
+;; way: a dependency is available if Emacs can require it.
+;;
+;; DUET has no third-party runtime dependencies yet; cl-lib is the one feature
+;; the core leans on (cl-defstruct lands in Phase 2). The dev tooling
+;; (undercover, elisp-lint, package-lint) is verified by the targets that use
+;; it, not here.
+
+;;; Code:
+
+(when noninteractive
+ (package-initialize))
+
+(defconst duet-check-deps-required-features
+ '(cl-lib)
+ "Features required by the duet test suite.")
+
+(defun duet-check-deps--missing-features ()
+ "Return required test features that cannot be loaded."
+ (let (missing)
+ (dolist (feature duet-check-deps-required-features (nreverse missing))
+ (unless (require feature nil t)
+ (push feature missing)))))
+
+(let ((missing (duet-check-deps--missing-features)))
+ (if missing
+ (progn
+ (message "Missing Emacs Lisp test dependencies: %s"
+ (mapconcat #'symbol-name missing ", "))
+ (message "Run `make setup' from the project root, or make these features available on load-path.")
+ (kill-emacs 1))
+ (message "Required Emacs Lisp dependencies are loadable: %s"
+ (mapconcat #'symbol-name duet-check-deps-required-features ", "))))
+
+;;; check-deps.el ends here