mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-12 23:23:36 +00:00
79a7186f1c
Runtime tests (derivations asking for a relaxed sandbox) are now expected at p.gpuCheck, p.gpuChecks.<name>, or at p.tests.<name>.gpuCheck.
30 lines
550 B
Nix
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'
|