tests.srcOnly: Use zlib instead of glibc

This makes the test more portable, as glibc does not evaluate on
all platforms.
Unfortunately the test fails on darwin for an unrelated reason.
__impureHostDeps values were duplicated.
This commit is contained in:
Robert Hensing 2025-04-05 18:45:26 +02:00 committed by Philip Taron
parent af9b49edab
commit d93bb6f46a
No known key found for this signature in database

View File

@ -3,18 +3,18 @@
srcOnly, srcOnly,
hello, hello,
emptyDirectory, emptyDirectory,
glibc, zlib,
stdenv, stdenv,
testers, testers,
}: }:
let let
emptySrc = srcOnly emptyDirectory; emptySrc = srcOnly emptyDirectory;
glibcSrc = srcOnly glibc; zlibSrc = srcOnly zlib;
# It can be invoked in a number of ways. Let's make sure they're equivalent. # It can be invoked in a number of ways. Let's make sure they're equivalent.
glibcSrcDrvAttrs = srcOnly glibc.drvAttrs; zlibSrcDrvAttrs = srcOnly zlib.drvAttrs;
# glibcSrcFreeform = # ???; # zlibSrcFreeform = # ???;
helloSrc = srcOnly hello; helloSrc = srcOnly hello;
helloSrcDrvAttrs = srcOnly hello.drvAttrs; helloSrcDrvAttrs = srcOnly hello.drvAttrs;
@ -48,11 +48,11 @@ in
runCommand "srcOnly-tests" runCommand "srcOnly-tests"
{ {
moreTests = [ moreTests = [
(testers.testEqualDerivation "glibcSrcDrvAttrs == glibcSrc" glibcSrcDrvAttrs glibcSrc) (testers.testEqualDerivation "zlibSrcDrvAttrs == zlibSrc" zlibSrcDrvAttrs zlibSrc)
# (testers.testEqualDerivation # (testers.testEqualDerivation
# "glibcSrcFreeform == glibcSrc" # "zlibSrcFreeform == zlibSrc"
# glibcSrcFreeform # zlibSrcFreeform
# glibcSrc) # zlibSrc)
(testers.testEqualDerivation "helloSrcDrvAttrs == helloSrc" helloSrcDrvAttrs helloSrc) (testers.testEqualDerivation "helloSrcDrvAttrs == helloSrc" helloSrcDrvAttrs helloSrc)
(testers.testEqualDerivation "helloDrvSimpleSrcFreeform == helloDrvSimpleSrc" (testers.testEqualDerivation "helloDrvSimpleSrcFreeform == helloDrvSimpleSrc"
helloDrvSimpleSrcFreeform helloDrvSimpleSrcFreeform
@ -67,9 +67,9 @@ runCommand "srcOnly-tests"
exit 1 exit 1
fi fi
# Test that glibcSrc is not empty # Test that zlibSrc is not empty
if [ -z "$(ls -A ${glibcSrc})" ]; then if [ -z "$(ls -A ${zlibSrc})" ]; then
echo "glibcSrc is empty" echo "zlibSrc is empty"
exit 1 exit 1
fi fi