Commit 0a86a179 authored by Sebastian Wiesner's avatar Sebastian Wiesner

Add coverage reporting to unit tests

parent 26183f9b
......@@ -8,6 +8,7 @@
"doc/flycheck.texi")
(development
(depends-on "undercover") ; Measure test coverage
(depends-on "shut-up") ; Silence Emacs
;; Make optional dependencies available for development
......
......@@ -95,6 +95,11 @@ Node `(ert)Test Selectors' for information about test selectors."
(kill-emacs 1))))))
(ert-run-tests-batch-and-exit (flycheck-transform-selector selector))))
(defun flycheck-setup-coverage-reporting ()
"Setup test coverage reporting using undercover.el."
(when (fboundp 'undercover)
(undercover "flycheck.el")))
(defun flycheck-runs-this-script-p ()
"Whether this file is executed as script."
t)
......@@ -108,6 +113,9 @@ Node `(ert)Test Selectors' for information about test selectors."
(setq package-user-dir (expand-file-name pkg-rel-dir source-directory))
(package-initialize)
(when (require 'undercover nil 'no-error)
(flycheck-setup-coverage-reporting))
(message "Running tests on Emacs %s, built at %s"
emacs-version (format-time-string "%F" emacs-build-time))
(load (expand-file-name "flycheck" source-directory))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment