Skip to content

Commit

Permalink
chore: fallback to cwd if CARGO_MANIFEST_DIR env var is not set
Browse files Browse the repository at this point in the history
Needed when running `cargo flamegraph --root` for #317
  • Loading branch information
greenhat committed Sep 11, 2024
1 parent e1c3e88 commit 173c48b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/integration/src/compiler_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,8 @@ pub fn sdk_crate_path() -> PathBuf {
/// Get the directory for the top-level workspace
fn get_workspace_dir() -> String {
// Get the directory for the integration test suite project
let cargo_manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();
let cargo_manifest_dir = std::env::var("CARGO_MANIFEST_DIR")
.unwrap_or(std::env::current_dir().unwrap().to_str().unwrap().to_string());
let cargo_manifest_dir_path = Path::new(&cargo_manifest_dir);
// "Exit" the integration test suite project directory to the compiler workspace directory
// i.e. out of the `tests/integration` directory
Expand Down

0 comments on commit 173c48b

Please sign in to comment.