We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fcbcc97 commit 6e467b7Copy full SHA for 6e467b7
src/test/ui/command/command-current-dir.rs
@@ -16,8 +16,14 @@ fn main() {
16
std::process::exit(0);
17
}
18
let exe = me.file_name().unwrap();
19
- let cwd = std::env::current_dir().unwrap();
+ let cwd = me.parent().unwrap();
20
eprintln!("cwd={:?}", cwd);
21
+ // Change directory to where the exectuable is located, since this test
22
+ // fundamentally needs to use relative paths. In some cases (like
23
+ // remote-test-server), the current_dir can be somewhere else, so make
24
+ // sure it is something we can use. We assume we can write to this
25
+ // directory.
26
+ env::set_current_dir(&cwd).unwrap();
27
let foo = cwd.join("foo");
28
let bar = cwd.join("bar");
29
fs::create_dir_all(&foo).unwrap();
0 commit comments