1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-17 19:21:04 +00:00

tests/srcOnly: init (#347548)

This commit is contained in:
Philip Taron 2024-11-01 09:13:09 -07:00 committed by GitHub
commit 8d9fcbc47a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 30 additions and 0 deletions

View file

@ -0,0 +1,28 @@
{
runCommand,
srcOnly,
emptyDirectory,
glibc,
}:
let
emptySrc = srcOnly emptyDirectory;
glibcSrc = srcOnly glibc;
in
runCommand "srcOnly-tests" { } ''
# Test that emptySrc is empty
if [ -n "$(ls -A ${emptySrc})" ]; then
echo "emptySrc is not empty"
exit 1
fi
# Test that glibcSrc is not empty
if [ -z "$(ls -A ${glibcSrc})" ]; then
echo "glibcSrc is empty"
exit 1
fi
# Make $out exist to avoid build failure
mkdir -p $out
''

View file

@ -170,6 +170,8 @@ with pkgs;
auto-patchelf-hook = callPackage ./auto-patchelf-hook { };
srcOnly = callPackage ../build-support/src-only/tests.nix { };
systemd = callPackage ./systemd { };
replaceVars = recurseIntoAttrs (callPackage ./replace-vars { });