fortrangoingonforty/armfortas / f7d4d9e

Browse files

Run module tests in temp workdirs

Authored by espadonne
SHA
f7d4d9e22687fd64d13bfdb2e493b934d545402a
Parents
2823a78
Tree
bf27664

2 changed files

StatusFile+-
M tests/incremental.rs 1 0
M tests/multifile.rs 4 1
tests/incremental.rsmodified
@@ -35,6 +35,7 @@ fn find_compiler() -> PathBuf {
3535
 
3636
 fn compile(compiler: &Path, source: &Path, obj: &Path, search: &Path) {
3737
     let result = Command::new(compiler)
38
+        .current_dir(search)
3839
         .args([
3940
             source.to_str().unwrap(),
4041
             "-c",
tests/multifile.rsmodified
@@ -21,7 +21,7 @@ fn find_compiler() -> PathBuf {
2121
     for c in &["target/release/armfortas", "target/debug/armfortas"] {
2222
         let p = PathBuf::from(c);
2323
         if p.exists() {
24
-            return p;
24
+            return std::fs::canonicalize(&p).unwrap();
2525
         }
2626
     }
2727
     panic!("armfortas binary not found");
@@ -48,6 +48,9 @@ fn sdk_path() -> String {
4848
 /// Compile a .f90 file with -c, producing .o and optionally .amod.
4949
 fn compile_file(compiler: &Path, source: &Path, output: &Path, search_dir: Option<&Path>) {
5050
     let mut cmd = Command::new(compiler);
51
+    if let Some(parent) = source.parent() {
52
+        cmd.current_dir(parent);
53
+    }
5154
     cmd.args([
5255
         source.to_str().unwrap(),
5356
         "-c",