Skip to content

Commit

Permalink
Make the loading test not depend on any external packages
Browse files Browse the repository at this point in the history
  • Loading branch information
davidshepherd7 committed Feb 13, 2024
1 parent 53b17d7 commit 4c63fdb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ test-unit:
cask exec ert-runner

test-load:
cask ${EMACS} -Q --script "load-test/loading-test.el"
cask ${EMACS} -Q --chdir . --script "load-test/loading-test.el"

install:
${CASK} install
Expand Down
10 changes: 5 additions & 5 deletions load-test/loading-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

(require 'ert)

(require 'f)

;; Don't accidentally load old .elc files
(setq load-prefer-newer t)

Expand All @@ -32,16 +30,18 @@ running the espuds tests."
(should-not (featurep 'frames-only-mode))

;; For these tests we need to make sure we don't have these things loaded initially
(-each test-features (lambda (f) (should-not (featurep f))))
(dolist (elt test-features)
(should-not (featurep elt)))

(require 'frames-only-mode (f-expand "frames-only-mode.el" (f-parent (f-dirname (f-this-file)))))
(require 'frames-only-mode (concat default-directory "frames-only-mode.el"))
(frames-only-mode t)
(should frames-only-mode)
;; Appropriate vars should have been set anyway
(should (equal flycheck-display-errors-function 'frames-only-mode-flycheck-display-errors))
(frames-only-mode 0)

;; And we still should not have loaded them
(-each test-features (lambda (f) (should-not (featurep f)))))
(dolist (elt test-features)
(should-not (featurep elt))))

(ert-run-tests-batch-and-exit)

0 comments on commit 4c63fdb

Please sign in to comment.