aboutsummaryrefslogtreecommitdiff
path: root/tests/nixos/util.nix
diff options
context:
space:
mode:
authormidnightveil <midnight@trainwit.ch>2024-05-10 15:25:12 +1000
committerJade Lovelace <lix@jade.fyi>2024-05-16 17:11:21 -0700
commit5b7dcb3005ed38d4634f228f01852ae18b2d9cd4 (patch)
treea254515d74a24144865ae37ef468306b2e112a85 /tests/nixos/util.nix
parent9322a1cbe775a32c7019a91236d9e37037b9241a (diff)
Allow enabling core dumps from builds for nix & child processes
Fixes https://git.lix.systems/lix-project/lix/issues/268 Change-Id: I3f1b0ddf064f891cca8b53229c5c31c74cea3d9f
Diffstat (limited to 'tests/nixos/util.nix')
-rw-r--r--tests/nixos/util.nix7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/nixos/util.nix b/tests/nixos/util.nix
index 0c51cc075..1b8b4223c 100644
--- a/tests/nixos/util.nix
+++ b/tests/nixos/util.nix
@@ -1,5 +1,6 @@
{
- mkNixBuildTest = { name, expressionFile, extraMachineConfig ? {} }:
+ mkNixBuildTest =
+ { name, expressionFile, extraMachineConfig ? {}, testScriptPre ? "", testScriptPost ? "" }:
{ lib, pkgs, ... }:
{
inherit name;
@@ -17,7 +18,11 @@
testScript = { nodes }: ''
start_all()
+ ${testScriptPre}
+
machine.succeed('nix-build --expr "let pkgs = import <nixpkgs> {}; in pkgs.callPackage ${expressionFile} {}"')
+
+ ${testScriptPost}
'';
};
}