lol

python312Packages.raylib-python-cffi: add passthru tests

+35
+6
pkgs/development/python-modules/raylib-python-cffi/default.nix
··· 13 13 raygui, 14 14 darwin, 15 15 lib, 16 + writers, 17 + raylib-python-cffi, 16 18 }: 17 19 18 20 let ··· 73 75 CoreFoundation 74 76 CoreVideo 75 77 ]; 78 + 79 + passthru.tests = import ./passthru-tests.nix { 80 + inherit src raylib-python-cffi writers; 81 + }; 76 82 77 83 meta = { 78 84 description = "Python CFFI bindings for Raylib";
+29
pkgs/development/python-modules/raylib-python-cffi/passthru-tests.nix
··· 1 + { 2 + src, 3 + raylib-python-cffi, 4 + writers, 5 + }: 6 + let 7 + writeTest = 8 + name: path: 9 + writers.writePython3Bin name { 10 + libraries = [ raylib-python-cffi ]; 11 + doCheck = false; 12 + } (builtins.readFile (src + path)); 13 + 14 + in 15 + { 16 + basic_shapes = writeTest "basic_shapes" "/examples/shapes/shapes_basic_shapes.py"; 17 + 18 + cffi_binding = 19 + (writeTest "cffi_binding" "/tests/test_static_with_only_api_from_dynamic.py").overrideAttrs 20 + (prev: { 21 + buildCommand = 22 + prev.buildCommand 23 + + '' 24 + substituteInPlace $out/bin/cffi_binding \ 25 + --replace-fail "examples/models/resources/heightmap.png" \ 26 + "${src}/examples/models/resources/heightmap.png" 27 + ''; 28 + }); 29 + }