Skip to content
This repository has been archived by the owner on Feb 10, 2025. It is now read-only.

Commit

Permalink
refactor: use ert to assert valid el-patch templates
Browse files Browse the repository at this point in the history
  • Loading branch information
gekoke committed May 16, 2024
1 parent 8d5e508 commit 1586048
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
8 changes: 2 additions & 6 deletions nix/packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,8 @@ _: {
] ++ packageRequires;

checkPhase = ''
output=$(emacs --batch -L . -L test -l magit-file-icons-tests 2> >(grep invalid))
if [[ $output ]]; then
echo "Failed to validate templates. Output:"
echo "$output"
exit 1
fi
git init # need to be in repository for Magit tests to not fail
emacs --batch -l ert -l magit-file-icons.el -l ./test/magit-file-icons-tests.el -f ert-run-tests-batch-and-exit
'';

meta = {
Expand Down
9 changes: 7 additions & 2 deletions test/magit-file-icons-tests.el
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
;; -*- lexical-binding: t; -*-

(require 'ert)
(require 'el-patch)
(require 'magit-file-icons)

(el-patch-validate-all-templates)
(ert-deftest magit-file-icons-should-have-no-invalid-templates ()
(el-patch-validate-all-templates))

;; Local Variables:
;; flycheck-disabled-checkers: (emacs-lisp emacs-lisp-checkdoc)
;; flycheck-disabled-checkers: (emacs-lisp-checkdoc)
;; End:

0 comments on commit 1586048

Please sign in to comment.