We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c53639c commit 3bdf081Copy full SHA for 3bdf081
1 file changed
e2e/src/tests/common.rs
@@ -3,9 +3,22 @@ use std::process::Command;
3
4
#[allow(dead_code)]
5
pub fn workspace_root() -> PathBuf {
6
- checked_in_runtime_root()
+ PathBuf::from(env!("CARGO_MANIFEST_DIR"))
7
+ .ancestors()
8
+ .find(|path| {
9
+ let manifest_path = path.join("Cargo.toml");
10
+ manifest_path.is_file()
11
+ && std::fs::read_to_string(&manifest_path)
12
+ .map(|contents| {
13
+ contents.contains("[workspace]") && contents.contains("members")
14
+ })
15
+ .unwrap_or(false)
16
17
+ .map(std::path::Path::to_path_buf)
18
+ .expect("failed to locate workspace root containing Cargo workspace manifest")
19
}
20
21
+#[allow(dead_code)]
22
pub fn checked_in_runtime_root() -> PathBuf {
23
PathBuf::from(env!("CARGO_MANIFEST_DIR"))
24
.ancestors()
0 commit comments