Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/srcOnly: init #347548

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions pkgs/build-support/src-only/test.nix
Original file line number Diff line number Diff line change
@@ -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
''
2 changes: 2 additions & 0 deletions pkgs/test/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,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 { });
Expand Down