diff options
Diffstat (limited to 'users/Profpatsch/writers')
-rw-r--r-- | users/Profpatsch/writers/default.nix | 15 | ||||
-rw-r--r-- | users/Profpatsch/writers/tests/default.nix | 5 |
2 files changed, 12 insertions, 8 deletions
diff --git a/users/Profpatsch/writers/default.nix b/users/Profpatsch/writers/default.nix index ee3ac7bda782..3cb105b5ed1f 100644 --- a/users/Profpatsch/writers/default.nix +++ b/users/Profpatsch/writers/default.nix @@ -78,8 +78,11 @@ let rustSimpleBin = { name, dependencies ? [], + doCheck ? true, ... - }@args: src: pkgs.buildRustCrate ({ + }@args: src: + (if doCheck then testRustSimple else pkgs.lib.id) + (pkgs.buildRustCrate ({ pname = name; version = "1.0.0"; crateName = name; @@ -93,13 +96,16 @@ let cp "$srcPath" $out/src/bin/${name}.rs find $out ''; - } // args); + } // args)); rustSimpleLib = { name, dependencies ? [], + doCheck ? true, ... - }@args: src: pkgs.buildRustCrate ({ + }@args: src: + (if doCheck then testRustSimple else pkgs.lib.id) + (pkgs.buildRustCrate ({ pname = name; version = "1.0.0"; crateName = name; @@ -112,7 +118,7 @@ let cp "$srcPath" $out/src/lib.rs find $out ''; - } // args); + } // args)); /* Takes a `buildRustCrate` derivation as an input, * builds it with `{ buildTests = true; }` and runs @@ -146,6 +152,5 @@ in { rustSimple rustSimpleBin rustSimpleLib - testRustSimple ; } diff --git a/users/Profpatsch/writers/tests/default.nix b/users/Profpatsch/writers/tests/default.nix index a16f5fa1f972..4b28792f75a0 100644 --- a/users/Profpatsch/writers/tests/default.nix +++ b/users/Profpatsch/writers/tests/default.nix @@ -4,7 +4,6 @@ let inherit (depot.users.Profpatsch.writers) python3Lib python3 - testRustSimple rustSimple rustSimpleLib rustSimpleBin @@ -46,7 +45,7 @@ let ''); - rustTransitiveLib = testRustSimple (rustSimpleLib { + rustTransitiveLib = rustSimpleLib { name = "transitive"; } '' pub fn transitive(s: &str) -> String { @@ -64,7 +63,7 @@ let assert_eq!(transitive("foo").as_str(), "foo 1 2 3") } } - ''); + ''; rustTestLib = rustSimpleLib { name = "test_lib"; |