2022-12-23 21:04:14 +01:00
|
|
|
{
|
|
|
|
nixpkgs ? ../../..,
|
|
|
|
system ? builtins.currentSystem,
|
|
|
|
pkgs ? import nixpkgs {
|
|
|
|
config = {};
|
|
|
|
overlays = [];
|
|
|
|
inherit system;
|
|
|
|
},
|
|
|
|
libpath ? ../..,
|
2022-12-23 21:08:09 +01:00
|
|
|
# Random seed
|
|
|
|
seed ? null,
|
2022-12-23 21:04:14 +01:00
|
|
|
}:
|
|
|
|
pkgs.runCommand "lib-path-tests" {
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
|
|
nix
|
2022-12-23 21:08:09 +01:00
|
|
|
jq
|
|
|
|
bc
|
2022-12-23 21:04:14 +01:00
|
|
|
];
|
|
|
|
} ''
|
|
|
|
# Needed to make Nix evaluation work
|
|
|
|
export NIX_STATE_DIR=$(mktemp -d)
|
|
|
|
|
|
|
|
cp -r ${libpath} lib
|
|
|
|
export TEST_LIB=$PWD/lib
|
|
|
|
|
|
|
|
echo "Running unit tests lib/path/tests/unit.nix"
|
|
|
|
nix-instantiate --eval lib/path/tests/unit.nix \
|
|
|
|
--argstr libpath "$TEST_LIB"
|
|
|
|
|
2022-12-23 21:08:09 +01:00
|
|
|
echo "Running property tests lib/path/tests/prop.sh"
|
|
|
|
bash lib/path/tests/prop.sh ${toString seed}
|
|
|
|
|
2022-12-23 21:04:14 +01:00
|
|
|
touch $out
|
|
|
|
''
|