summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorRicardo M. Correia <rcorreia@wizy.org>2015-04-21 20:34:26 +0200
committerRicardo M. Correia <rcorreia@wizy.org>2015-04-21 20:45:05 +0200
commitd648be67246e771126defb34989ecb9f88292c64 (patch)
treea58bc6065d44bd6ee76e7d450b5d94aee2c38e37 /pkgs/build-support
parent5e8a4477390332e4315397a21a919d63af94595a (diff)
downloadnixlib-d648be67246e771126defb34989ecb9f88292c64.tar
nixlib-d648be67246e771126defb34989ecb9f88292c64.tar.gz
nixlib-d648be67246e771126defb34989ecb9f88292c64.tar.bz2
nixlib-d648be67246e771126defb34989ecb9f88292c64.tar.lz
nixlib-d648be67246e771126defb34989ecb9f88292c64.tar.xz
nixlib-d648be67246e771126defb34989ecb9f88292c64.tar.zst
nixlib-d648be67246e771126defb34989ecb9f88292c64.zip
buildRustPackage: Add check phase and enable it by default
Also disable check phase in cargo as there are lots of failures (some
probably due to trying to access the network).
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/rust/default.nix9
1 files changed, 8 insertions, 1 deletions
diff --git a/pkgs/build-support/rust/default.nix b/pkgs/build-support/rust/default.nix
index a02163f73faf..45d706b8c562 100644
--- a/pkgs/build-support/rust/default.nix
+++ b/pkgs/build-support/rust/default.nix
@@ -39,10 +39,17 @@ in stdenv.mkDerivation (args // {
   '' + (args.prePatch or "");
 
   buildPhase = args.buildPhase or ''
-    echo "Running cargo build"
+    echo "Running cargo build --release"
     cargo build --release
   '';
 
+  checkPhase = args.checkPhase or ''
+    echo "Running cargo test"
+    cargo test
+  '';
+
+  doCheck = args.doCheck or true;
+
   installPhase = args.installPhase or ''
     mkdir -p $out/bin
     for f in $(find target/release -maxdepth 1 -type f); do