mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-04 21:03:15 +00:00
050e7e29aa
This should help troubleshoot errors. Fyi --eval is just a flag, not an option with a value.
36 lines
703 B
Nix
36 lines
703 B
Nix
{
|
|
nixpkgs ? ../../..,
|
|
system ? builtins.currentSystem,
|
|
pkgs ? import nixpkgs {
|
|
config = {};
|
|
overlays = [];
|
|
inherit system;
|
|
},
|
|
libpath ? ../..,
|
|
# Random seed
|
|
seed ? null,
|
|
}:
|
|
pkgs.runCommand "lib-path-tests" {
|
|
nativeBuildInputs = with pkgs; [
|
|
nix
|
|
jq
|
|
bc
|
|
];
|
|
} ''
|
|
# 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 --show-trace \
|
|
--argstr libpath "$TEST_LIB" \
|
|
lib/path/tests/unit.nix
|
|
|
|
echo "Running property tests lib/path/tests/prop.sh"
|
|
bash lib/path/tests/prop.sh ${toString seed}
|
|
|
|
touch $out
|
|
''
|