Run module tests in temp workdirs
- SHA
f7d4d9e22687fd64d13bfdb2e493b934d545402a- Parents
-
2823a78 - Tree
bf27664
f7d4d9e
f7d4d9e22687fd64d13bfdb2e493b934d545402a2823a78
bf27664| Status | File | + | - |
|---|---|---|---|
| M |
tests/incremental.rs
|
1 | 0 |
| M |
tests/multifile.rs
|
4 | 1 |
tests/incremental.rsmodified@@ -35,6 +35,7 @@ fn find_compiler() -> PathBuf { | ||
| 35 | 35 | |
| 36 | 36 | fn compile(compiler: &Path, source: &Path, obj: &Path, search: &Path) { |
| 37 | 37 | let result = Command::new(compiler) |
| 38 | + .current_dir(search) | |
| 38 | 39 | .args([ |
| 39 | 40 | source.to_str().unwrap(), |
| 40 | 41 | "-c", |
tests/multifile.rsmodified@@ -21,7 +21,7 @@ fn find_compiler() -> PathBuf { | ||
| 21 | 21 | for c in &["target/release/armfortas", "target/debug/armfortas"] { |
| 22 | 22 | let p = PathBuf::from(c); |
| 23 | 23 | if p.exists() { |
| 24 | - return p; | |
| 24 | + return std::fs::canonicalize(&p).unwrap(); | |
| 25 | 25 | } |
| 26 | 26 | } |
| 27 | 27 | panic!("armfortas binary not found"); |
@@ -48,6 +48,9 @@ fn sdk_path() -> String { | ||
| 48 | 48 | /// Compile a .f90 file with -c, producing .o and optionally .amod. |
| 49 | 49 | fn compile_file(compiler: &Path, source: &Path, output: &Path, search_dir: Option<&Path>) { |
| 50 | 50 | let mut cmd = Command::new(compiler); |
| 51 | + if let Some(parent) = source.parent() { | |
| 52 | + cmd.current_dir(parent); | |
| 53 | + } | |
| 51 | 54 | cmd.args([ |
| 52 | 55 | source.to_str().unwrap(), |
| 53 | 56 | "-c", |