Files
nixpkgs/pkgs/by-name/fr/freecad/tests/modules.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

43 lines
910 B
Nix

{
freecad,
runCommand,
writeTextFile,
}:
let
mkModule =
n:
writeTextFile {
name = "module-${n}";
destination = "/Init.py";
text = ''
import sys
import os
out = os.environ['out']
f = open(out + "/module-${n}.touch", "w")
f.write("module-${n}");
f.close()
'';
};
module-1 = mkModule "1";
module-2 = mkModule "2";
freecad-customized = freecad.customize {
modules = [
module-1
module-2
];
};
in
runCommand "freecad-test-modules"
{
nativeBuildInputs = [ freecad-customized ];
}
''
mkdir $out
HOME="$(mktemp -d)" FreeCADCmd --log-file $out/freecad.log -c "sys.exit(0)" </dev/null
test -f $out/module-1.touch
test -f $out/module-2.touch
grep -q 'Initializing ${module-1}... done' $out/freecad.log
grep -q 'Initializing ${module-2}... done' $out/freecad.log
''