compress-drv-tests
parent
934467dfb8
commit
c0d6d22169
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
#lib,
|
||||
gzip,
|
||||
stdenv,
|
||||
compressDrv,
|
||||
}: let
|
||||
#example = stdenv.runCommandNoCC "sample-drv" {} ''
|
||||
# mkdir $out
|
||||
# echo 1 > $out/1.txt
|
||||
# touch $out/2.png
|
||||
#'';
|
||||
drv = compressDrv {
|
||||
formats = ["txt"];
|
||||
compressors = ["gz"];
|
||||
compressor-gz = "${gzip}/bin/gzip --fast {}";
|
||||
};
|
||||
in
|
||||
stdenv.runCommandNoCC "test-compressDrv" {} ''
|
||||
set -ex
|
||||
find .
|
||||
find ${drv}
|
||||
test -h ${drv}/1.txt
|
||||
test -f ${drv}/1.txt.gz
|
||||
test cmp ${drv}/1.txt <(${gzip}/bin/zcat ${drv}/1.txt.gz)
|
||||
|
||||
test -h ${drv}/2.png
|
||||
test ! -a ${drv}/2.png.gz
|
||||
|
||||
exit 1
|
||||
''
|
Loading…
Reference in New Issue