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,
hello,
emptyDirectory,
glibc,
zlib,
stdenv,
testers,
}:
let
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.
glibcSrcDrvAttrs = srcOnly glibc.drvAttrs;
# glibcSrcFreeform = # ???;
zlibSrcDrvAttrs = srcOnly zlib.drvAttrs;
# zlibSrcFreeform = # ???;
helloSrc = srcOnly hello;
helloSrcDrvAttrs = srcOnly hello.drvAttrs;
@ -48,11 +48,11 @@ in
runCommand "srcOnly-tests"
{
moreTests = [
(testers.testEqualDerivation "glibcSrcDrvAttrs == glibcSrc" glibcSrcDrvAttrs glibcSrc)
(testers.testEqualDerivation "zlibSrcDrvAttrs == zlibSrc" zlibSrcDrvAttrs zlibSrc)
# (testers.testEqualDerivation
# "glibcSrcFreeform == glibcSrc"
# glibcSrcFreeform
# glibcSrc)
# "zlibSrcFreeform == zlibSrc"
# zlibSrcFreeform
# zlibSrc)
(testers.testEqualDerivation "helloSrcDrvAttrs == helloSrc" helloSrcDrvAttrs helloSrc)
(testers.testEqualDerivation "helloDrvSimpleSrcFreeform == helloDrvSimpleSrc"
helloDrvSimpleSrcFreeform
@ -67,9 +67,9 @@ runCommand "srcOnly-tests"
exit 1
fi
# Test that glibcSrc is not empty
if [ -z "$(ls -A ${glibcSrc})" ]; then
echo "glibcSrc is empty"
# Test that zlibSrc is not empty
if [ -z "$(ls -A ${zlibSrc})" ]; then
echo "zlibSrc is empty"
exit 1
fi