Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions cargo-auditable/tests/fixtures/lto_stripped_binary/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "lto_stripped_binary"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]

[workspace]

[profile.release]
lto=true
strip=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}
20 changes: 20 additions & 0 deletions cargo-auditable/tests/it.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,26 @@ fn test_lto() {
.any(|p| p.name == "lto_binary_crate"));
}

#[test]
fn test_lto_stripped() {
// Path to workspace fixture Cargo.toml. See that file for overview of workspace members and their dependencies.
let workspace_cargo_toml = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("tests/fixtures/lto_stripped_binary/Cargo.toml");
// Run in workspace root with default features
let bins = run_cargo_auditable(workspace_cargo_toml, &[], &[]);
eprintln!("Stripped binary map: {bins:?}");

// lto_stripped_binary should only depend on itself
let lto_stripped_binary_bin = &bins.get("lto_stripped_binary").unwrap()[0];
let dep_info = get_dependency_info(lto_stripped_binary_bin);
eprintln!("{lto_stripped_binary_bin} dependency info: {dep_info:?}");
assert!(dep_info.packages.len() == 1);
assert!(dep_info
.packages
.iter()
.any(|p| p.name == "lto_stripped_binary"));
}

#[test]
fn test_bin_and_lib_in_one_crate() {
// Path to workspace fixture Cargo.toml. See that file for overview of workspace members and their dependencies.
Expand Down
Loading