cargo-benchcmp: init at 0.4.4

https://github.com/BurntSushi/cargo-benchcmp

figsoda ab2095c8 4916216d

+72
+41
pkgs/development/tools/rust/cargo-benchcmp/default.nix
···
··· 1 + { lib 2 + , rustPlatform 3 + , fetchFromGitHub 4 + , substituteAll 5 + , rust 6 + , stdenv 7 + }: 8 + 9 + rustPlatform.buildRustPackage rec { 10 + pname = "cargo-benchcmp"; 11 + version = "0.4.4"; 12 + 13 + src = fetchFromGitHub { 14 + owner = "BurntSushi"; 15 + repo = "cargo-benchcmp"; 16 + rev = version; 17 + hash = "sha256-pg3/VUC1DQ7GbSQDfVZ0WNisXvzXy0O0pr2ik2ar2h0="; 18 + }; 19 + 20 + cargoHash = "sha256-vxy9Ym3Twx034I1E5fWNnbP1ttfLolMbO1IgRiPfhRw="; 21 + 22 + patches = [ 23 + # patch the binary path so tests can find the binary when `--target` is present 24 + (substituteAll { 25 + src = ./fix-test-binary-path.patch; 26 + shortTarget = rust.toRustTarget stdenv.hostPlatform; 27 + }) 28 + ]; 29 + 30 + checkFlags = [ 31 + # thread 'different_input_colored' panicked at 'assertion failed: `(left == right)` 32 + "--skip=different_input_colored" 33 + ]; 34 + 35 + meta = with lib; { 36 + description = "A small utility to compare Rust micro-benchmarks"; 37 + homepage = "https://github.com/BurntSushi/cargo-benchcmp"; 38 + license = with licenses; [ mit unlicense ]; 39 + maintainers = with maintainers; [ figsoda ]; 40 + }; 41 + }
+30
pkgs/development/tools/rust/cargo-benchcmp/fix-test-binary-path.patch
···
··· 1 + --- a/tests/integration.rs 2 + +++ b/tests/integration.rs 3 + @@ -16,20 +16,13 @@ impl CommandUnderTest { 4 + fn new() -> CommandUnderTest { 5 + // To find the directory where the built binary is, we walk up the directory tree of the test binary until the 6 + // parent is "target/". 7 + - let mut binary_path = env::current_exe().expect("need current binary path to find binary to test"); 8 + - loop { 9 + - { 10 + - let parent = binary_path.parent(); 11 + - if parent.is_none() { 12 + - panic!("Failed to locate binary path from original path: {:?}", env::current_exe()); 13 + - } 14 + - let parent = parent.unwrap(); 15 + - if parent.is_dir() && parent.file_name().unwrap() == "target" { 16 + - break; 17 + - } 18 + - } 19 + - binary_path.pop(); 20 + - } 21 + + let mut binary_path = PathBuf::from( 22 + + env::current_dir() 23 + + .unwrap() 24 + + .join("target") 25 + + .join("@shortTarget@") 26 + + .join(env!("cargoBuildType")), 27 + + ); 28 + 29 + binary_path.push( 30 + if cfg!(target_os = "windows") {
+1
pkgs/top-level/all-packages.nix
··· 16273 cargo-audit = callPackage ../development/tools/rust/cargo-audit { 16274 inherit (darwin.apple_sdk.frameworks) Security; 16275 }; 16276 cargo-binstall = callPackage ../development/tools/rust/cargo-binstall { }; 16277 cargo-bisect-rustc = callPackage ../development/tools/rust/cargo-bisect-rustc { 16278 inherit (darwin.apple_sdk.frameworks) Security;
··· 16273 cargo-audit = callPackage ../development/tools/rust/cargo-audit { 16274 inherit (darwin.apple_sdk.frameworks) Security; 16275 }; 16276 + cargo-benchcmp = callPackage ../development/tools/rust/cargo-benchcmp { }; 16277 cargo-binstall = callPackage ../development/tools/rust/cargo-binstall { }; 16278 cargo-bisect-rustc = callPackage ../development/tools/rust/cargo-bisect-rustc { 16279 inherit (darwin.apple_sdk.frameworks) Security;