Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test if packages are loadable with the wrapper #170

Merged
merged 4 commits into from
Jun 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
cd tests && HOME=$(mktemp -d) ../result/bin/emacs -Q --batch \
--eval "(setq debug-on-error t)" --load init.el
name: Test if package.el works inside Emacs
- run: nix-build --argstr emacsAttr emacs-${{ matrix.attr }} tests
- run: |
nix-build --argstr emacsAttr emacs-${{ matrix.attr }} tests \
&& result/bin/test
if: ${{ ! contains( fromJson('[ "23-4", "24-1", "24-2", "24-3", "24-4", "24-5" ]'), matrix.attr ) }}
name: Test low-level Nix usage
name: Test if the wrapper builds a configuration
6 changes: 6 additions & 0 deletions emacs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ stdenv.mkDerivation rec {

installTargets = "tags install";

# Create site-start.el which is needed by the wrapper
postInstall = ''
mkdir -p $out/share/emacs/site-lisp
touch $out/share/emacs/site-lisp/site-start.el
'';

meta = with lib; {
description = "The extensible, customizable GNU text editor";
homepage = https://www.gnu.org/software/emacs/;
Expand Down
38 changes: 27 additions & 11 deletions tests/default.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
{ emacsAttr
}:
let
pkgs = import (import ../nix/sources.nix).nixpkgs { overlays = [ (import ../overlay.nix) ]; };
emacs = (import ../default.nix).${emacsAttr};
{emacsAttr ? null}: let
pkgs = import (import ../nix/sources.nix).nixpkgs {
overlays = [(import ../overlay.nix)];
};
emacs =
if emacsAttr == null
then pkgs.emacs
else (import ../default.nix).${emacsAttr};
in
(pkgs.emacsPackagesFor emacs).emacsWithPackages (
epkgs: [
epkgs.seq
epkgs.dash
]
)
pkgs.writeShellApplication {
name = "test";
runtimeInputs = [
((pkgs.emacs.pkgs.overrideScope' (_: _: {
inherit emacs;
}))
.withPackages (
epkgs: [
epkgs.seq
epkgs.dash
]
))
];
text = ''
emacs --version
emacs -batch -q -l seq -l dash
echo "Successfully loaded."
'';
}