mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-04-12 02:07:18 +00:00
bao: fix tests (#353130)
This commit is contained in:
commit
0df157c0bf
@ -13,7 +13,12 @@ rustPlatform.buildRustPackage rec {
|
|||||||
hash = "sha256-+MjfqIg/aKPWhzxbPJ0dnS4egCj50Ib7ob3zXUSBXRg=";
|
hash = "sha256-+MjfqIg/aKPWhzxbPJ0dnS4egCj50Ib7ob3zXUSBXRg=";
|
||||||
};
|
};
|
||||||
|
|
||||||
cargoHash = "sha256-SNsRN5XgchZq6/BZnMeahIqnkP4Jq6bZxbE5cDVpsQA=";
|
cargoPatches = [
|
||||||
|
# https://github.com/oconnor663/bao/pull/55
|
||||||
|
./test-exe.patch
|
||||||
|
];
|
||||||
|
|
||||||
|
cargoHash = "sha256-mmhTG3WXVjIKtaz2xP9aYI9GQNTbx4l3c6UgKSMgQJU=";
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "Implementation of BLAKE3 verified streaming";
|
description = "Implementation of BLAKE3 verified streaming";
|
||||||
|
40
pkgs/tools/security/bao/test-exe.patch
Normal file
40
pkgs/tools/security/bao/test-exe.patch
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
diff --git a/Cargo.toml b/Cargo.toml
|
||||||
|
index 2f66e42..34240e8 100644
|
||||||
|
--- a/Cargo.toml
|
||||||
|
+++ b/Cargo.toml
|
||||||
|
@@ -26,6 +26,9 @@ path = "src/main.rs"
|
||||||
|
[dependencies.arrayref]
|
||||||
|
version = "0.3.5"
|
||||||
|
|
||||||
|
+[dependencies.assert_cmd]
|
||||||
|
+version = "2.0.16"
|
||||||
|
+
|
||||||
|
[dependencies.bao]
|
||||||
|
version = "0.12"
|
||||||
|
|
||||||
|
diff --git a/tests/test.rs b/tests/test.rs
|
||||||
|
index f9427bd..48aabca 100644
|
||||||
|
--- a/tests/test.rs
|
||||||
|
+++ b/tests/test.rs
|
||||||
|
@@ -1,8 +1,7 @@
|
||||||
|
use duct::cmd;
|
||||||
|
use rand::prelude::*;
|
||||||
|
-use std::env::consts::EXE_EXTENSION;
|
||||||
|
use std::fs;
|
||||||
|
-use std::path::{Path, PathBuf};
|
||||||
|
+use std::path::PathBuf;
|
||||||
|
use std::sync::Once;
|
||||||
|
use tempfile::tempdir;
|
||||||
|
|
||||||
|
@@ -15,10 +14,7 @@ pub fn bao_exe() -> PathBuf {
|
||||||
|
.expect("build failed");
|
||||||
|
});
|
||||||
|
|
||||||
|
- Path::new("target")
|
||||||
|
- .join("debug")
|
||||||
|
- .join("bao")
|
||||||
|
- .with_extension(EXE_EXTENSION)
|
||||||
|
+ assert_cmd::cargo::cargo_bin("bao")
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
Loading…
Reference in New Issue
Block a user