2020-11-30 22:50:55 +01:00
|
|
|
{ pkgs ? import ./nixpkgs.nix {} }:
|
2020-11-06 11:47:26 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
lib = pkgs.lib;
|
|
|
|
|
|
|
|
executables = lib.concatLists
|
|
|
|
(lib.mapAttrsToList
|
|
|
|
# every package puts its binNames into passthru
|
|
|
|
(_: v: map (bin: "${v}/bin/${bin}") v.passthru.binNames)
|
|
|
|
(import ./default.nix { inherit pkgs; }));
|
|
|
|
|
|
|
|
testExeLocation = pkgs.writers.writeDash "test-exe-location" ''
|
|
|
|
set -e
|
|
|
|
ERRORS=0;
|
|
|
|
|
|
|
|
test_exe () {
|
|
|
|
EXE=$1;
|
2020-11-06 11:52:42 +01:00
|
|
|
echo "$EXE --version:"
|
|
|
|
if $EXE --version; then
|
|
|
|
return 0
|
2020-11-06 11:47:26 +01:00
|
|
|
else
|
2020-11-06 11:52:42 +01:00
|
|
|
echo "$EXE --version failed!"
|
|
|
|
ERRORS=1
|
2020-11-06 11:47:26 +01:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
for exe in ${lib.escapeShellArgs executables}; do
|
|
|
|
test_exe "$exe"
|
|
|
|
done
|
|
|
|
|
|
|
|
exit "$ERRORS"
|
|
|
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
in {
|
|
|
|
inherit
|
|
|
|
testExeLocation;
|
|
|
|
}
|