Skip to content

Commit

Permalink
test: Add linting and byte-compile checks
Browse files Browse the repository at this point in the history
  • Loading branch information
josegpt committed Mar 6, 2022
1 parent a4f5e47 commit 5e63d3f
Showing 1 changed file with 41 additions and 1 deletion.
42 changes: 41 additions & 1 deletion run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,44 @@

EMACS="${EMACS:=emacs}"

${EMACS} --batch -l display-wttr.el -l display-wttr-test.el -f ert-run-tests-batch-and-exit
NEEDED_PACKAGES="package-lint"

INIT_PACKAGE_EL="(progn \
(require 'package) \
(push '(\"melpa\" . \"https://melpa.org/packages/\") package-archives) \
(package-initialize) \
(unless package-archive-contents \
(package-refresh-contents)) \
(dolist (pkg '(${NEEDED_PACKAGES})) \
(unless (package-installed-p pkg) \
(package-install pkg))))"

# Refresh package archives, because the test suite needs to see at least
# package-lint.
"$EMACS" -Q -batch \
--eval "$INIT_PACKAGE_EL"

# Byte-compile

"$EMACS" -Q -batch \
--eval "$INIT_PACKAGE_EL" \
-l display-wttr.el \
-f batch-byte-compile \
display-wttr.el

# Linting

"$EMACS" -Q -batch \
--eval "$INIT_PACKAGE_EL" \
-L . \
--eval "(require 'package-lint)" \
-f package-lint-batch-and-exit \
display-wttr.el

# Testing

"$EMACS" -Q --batch \
--eval "$INIT_PACKAGE_EL" \
-l display-wttr.elc \
-l display-wttr-test.el \
-f ert-run-tests-batch-and-exit

0 comments on commit 5e63d3f

Please sign in to comment.