Skip to content

Instantly share code, notes, and snippets.

@wpcarro
Created July 29, 2022 00:37
Show Gist options
  • Select an option

  • Save wpcarro/8a6b7055a27b2521effe863b98e270a1 to your computer and use it in GitHub Desktop.

Select an option

Save wpcarro/8a6b7055a27b2521effe863b98e270a1 to your computer and use it in GitHub Desktop.
Run Elisp unit test during nix-build
{ pkgs, depot, ... }:
let
al = pkgs.callPackage
({ emacsPackages }:
emacsPackages.trivialBuild {
pname = "al";
version = "1.0.0";
src = ./al.el;
packageRequires =
(with emacsPackages; [
dash
]) ++
(with depot.users.wpcarro.emacs.pkgs; [
# macros
# tuple
# maybe
]);
})
{ };
emacs = (pkgs.emacsPackagesFor pkgs.emacs28).emacsWithPackages (epkgs: [ al ]);
in
al.overrideAttrs (_old: {
doCheck = true;
checkPhase = ''
${emacs}/bin/emacs -batch \
-l ert -l ${./al-test.el} -f ert-run-tests-batch-and-exit
'';
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment