Skip to content

Commit

Permalink
Merge pull request #134 from rust-secure-code/disable-flaky-test
Browse files Browse the repository at this point in the history
Use a separate project for the custom rustc path tests
  • Loading branch information
Shnatsel authored Feb 18, 2024
2 parents da85607 + a088f82 commit a5aafd4
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 1 deletion.
7 changes: 7 additions & 0 deletions cargo-auditable/tests/fixtures/custom_rustc_path/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[workspace]

members = [
"top_level_crate",
"runtime_dep",
"build_dep_of_runtime_dep",
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "build_dep_of_runtime_dep"
version = "0.1.0"
edition = "2021"

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

[dependencies]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#[cfg(test)]
mod tests {
#[test]
fn it_works() {
let result = 2 + 2;
assert_eq!(result, 4);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[package]
name = "runtime_dep"
version = "0.1.0"
edition = "2021"

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

[build-dependencies]
build_dep_of_runtime_dep = {path = "../build_dep_of_runtime_dep"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#[cfg(test)]
mod tests {
#[test]
fn it_works() {
let result = 2 + 2;
assert_eq!(result, 4);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[package]
name = "top_level_crate"
version = "0.1.0"
edition = "2021"

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

[dependencies]
runtime_dep = {path = "../runtime_dep"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}
2 changes: 1 addition & 1 deletion cargo-auditable/tests/it.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ fn test_runtime_then_build_dep() {
fn test_custom_rustc_path() {
// 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/runtime_then_build_dep/Cargo.toml");
.join("tests/fixtures/custom_rustc_path/Cargo.toml");
// locate rustc
let rustc_path = which::which("rustc").unwrap();
// Run in workspace root with a custom path to rustc
Expand Down

0 comments on commit a5aafd4

Please sign in to comment.