add package tests
This commit is contained in:
36
flake.nix
36
flake.nix
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user