nixpkgs/pkgs/development/cuda-modules/write-gpu-python-test.nix
Someone Serge 79a7186f1c cudaPackages: updated convention for gpu/runtime checks
Runtime tests (derivations asking for a relaxed sandbox) are now
expected at p.gpuCheck, p.gpuChecks.<name>, or at
p.tests.<name>.gpuCheck.
2024-06-26 16:00:29 +00:00

30 lines
550 B
Nix

{
lib,
writers,
runCommand,
}:
{
feature ? "cuda",
name ? feature,
libraries ? [ ],
}:
content:
let
tester = writers.writePython3Bin "tester-${name}" { inherit libraries; } content;
tester' = tester.overrideAttrs (oldAttrs: {
passthru.gpuCheck =
runCommand "test-${name}"
{
nativeBuildInputs = [ tester' ];
requiredSystemFeatures = [ feature ];
}
''
set -e
${tester.meta.mainProgram or (lib.getName tester')}
touch $out
'';
});
in
tester'