This adds the nix feature to specify tests only to be run in the sandbox. Signed-off-by: Christina Sørensen <christina@cafkafk.com>
@@ -78,6 +78,8 @@ default = [ "git" ]
git = [ "git2" ]
vendored-openssl = ["git2/vendored-openssl"]
vendored-libgit2 = ["git2/vendored-libgit2"]
+# Should only be used inside of flake.nix
+nix = []
# make dev builds faster by excluding debug symbols
@@ -114,6 +114,7 @@
src = ./.;
mode = "test";
# cargoTestOptions = opts: opts ++ [ "--test cli_tests" ];
+ cargoTestOptions = opts: opts ++ [ "--features nix" ];
inherit buildInputs;
};
@@ -122,6 +123,7 @@
TRYCMD="dump";
postInstall = ''
cp dump $out -r
@@ -17,3 +17,10 @@ fn cli_windows_tests() {
trycmd::TestCases::new()
.case("tests/cmd/*_windows.toml");
}
+
+#[test]
+#[cfg(feature="nix")]
+fn cli_nix_tests() {
+ trycmd::TestCases::new()
+ .case("tests/cmd/*_nix.toml");
+}