Skip to content

vermiculus/emake.el

Repository files navigation

Emacs-Make https://travis-ci.org/vermiculus/emake.el.svg?branch=master

Passing tests on Travis

Test Elisp with services like Travis CI without the fuss of Cask – just you, your project, and (Emacs-)Make. Designed to be used with GNU Make, EMake comes with no dependencies other than Emacs 25.

Things EMake does:

  • parses, installs, and runs tests for your package
  • provides all the power of Elisp to extend its capabilities on-demand

EMake will never introduce dependencies beyond Emacs.

Depending on your prefereces, you may find it advantageous to use Cask and EMake concurrently during project development, but I would recommend executing your tests with pure EMake to ensure consistency with CI testing.

See the manual for more information. A practical demonstration is available in the example submodule which is also hosted on GitHub and is hooked up to Travis.

Quick Start

In keeping with recent trends, what follows is a shell script to build the most recent version of EMake with minimal configuration.

bash <(curl -fsSL https://raw.githubusercontent.com/vermiculus/emake.el/master/new)

This does three things:

  1. Read the package’s basename interactively.
  2. Determine and download the latest version of EMake.
  3. Pin your EMake version to a newly-generated Makefile.

The script takes steps not to blow away an existing Makefile. It also avoids running on a CI server – for this use-case, you should pin your EMake version in your CI’s configuration file (see Using EMake).

File Descriptions

emake.el
This is EMake. No other file is necessary to run EMake.
emake.mk
This is a Makefile distributed with EMake that can drive emake.el using a bare minimum of configuration via environment variables. It makes certain assumptions about project setup that should be accurate for most projects. See the section dedicated to this file near the end of this documentation.
build-emacs
This is a shell script that can build a minimal Emacs on Linux and macOS.
example/
This is an example project demonstrating the typical use of EMake.

Why use EMake?

EMake maintains a tight focus on continuous testing – there’s nothing included in the base script deemed unnecessary for this purpose. This focus removes complexity that can cause false failures in your testing (such as interactions with CI images, Python incompatibilities, etc.). This reduction of complexity naturally leads to a more stable build.

Free of dependencies, EMake is faster to install. In my own projects, switching from Cask to EMake reduced build time by 90 seconds down to an average installation time (everything after the container spin-up and before the tests run) to under three minutes. With caching facilities supported by some CI providers, installation is virtually instantaneous. While we surely shouldn’t be too concerned about some faceless VM’s time, we should be good stewards of the resources freely provided to us.

Because it relies only on existing tools, EMake is more pliable than Cask (at least, more obviously so). Want to use an environment variable to test MELPA-Stable separate from MELPA in your testing matrix? Just configure an environment variable in the matrix itself (or use any of Make’s facilities for more complicated logic). Want to use an external testing framework? Just write an Elisp function with a simple declare form to indicate it as a handler.

Anything you want to – do it. Want to change the world? There’s nothing to it.