Skip to content

Instantly share code, notes, and snippets.

@joeheyming
Created November 12, 2015 17:56
Show Gist options
  • Save joeheyming/a3490f2b52c0108b5e15 to your computer and use it in GitHub Desktop.
Save joeheyming/a3490f2b52c0108b5e15 to your computer and use it in GitHub Desktop.
How to write an ert test that makes sure your project has no byte-compile warnings.
(require 'ert)
(require '<<<YOUR EMACS LISP PACKAGE UNDER TEST>>>)
(ert-deftest no-byte-compile-warnings ()
"Byte-compile should not emit warnings"
(byte-compile-file "<<<YOUR EMACS PACKAGE.el>>>")
(switch-to-buffer "*Compile-Log*")
(let ((lines (buffer-substring (point-min) (point-max))))
(should (not (string-match "Warning:" lines)) )
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment