add package tests

This commit is contained in:
2025-12-03 20:04:25 -05:00
parent e96fcdbe99
commit fe01277f7b
4 changed files with 376 additions and 6 deletions

View File

@@ -59,8 +59,42 @@
buildInputs = with pkgs; [
openssl
zstd
# Required for running tests with native windowing support
libxkbcommon
libGL
wayland
xorg.libX11
xorg.libXcursor
xorg.libXi
xorg.libXrandr
];
# Run all tests on native target before building wasm
# Note: Tests run without --release because the release profile uses
# panic=abort which is incompatible with the test harness.
checkPhase =
let
libPath = pkgs.lib.makeLibraryPath (
with pkgs;
[
libxkbcommon
libGL
wayland
xorg.libX11
xorg.libXcursor
xorg.libXi
xorg.libXrandr
]
);
in
''
runHook preCheck
export HOME=$TMPDIR
export LD_LIBRARY_PATH="${libPath}:$LD_LIBRARY_PATH"
cargo test --workspace --features native-test
runHook postCheck
'';
buildPhase = ''
runHook preBuild
@@ -81,7 +115,7 @@
runHook postInstall
'';
doCheck = false;
doCheck = true;
};
# Final web package with wasm-bindgen processing