Sandbox fortsh graph outputs
Authored by
mfwolffe <wolffemf@dukes.jmu.edu>
- SHA
1f4cb8787aef7fdf4d7d65465ad7f65495fc52bc- Parents
-
bb95ce8 - Tree
37bada4
1f4cb87
1f4cb8787aef7fdf4d7d65465ad7f65495fc52bcbb95ce8
37bada4| Status | File | + | - |
|---|---|---|---|
| M |
.gitignore
|
1 | 0 |
| M |
tests/fortsh_module_graph.rs
|
6 | 1 |
.gitignoremodified@@ -23,4 +23,5 @@ AGENTS.md | ||
| 23 | 23 | /*.ir |
| 24 | 24 | /*.o |
| 25 | 25 | /*.mod |
| 26 | +/*.amod | |
| 26 | 27 | /scratch/ |
tests/fortsh_module_graph.rsmodified@@ -20,6 +20,9 @@ use std::process::Command; | ||
| 20 | 20 | const FORTSH_COMPILED_FLOOR: usize = 14; |
| 21 | 21 | |
| 22 | 22 | fn find_compiler() -> PathBuf { |
| 23 | + if let Some(path) = std::env::var_os("CARGO_BIN_EXE_armfortas") { | |
| 24 | + return PathBuf::from(path); | |
| 25 | + } | |
| 23 | 26 | for c in &["target/debug/armfortas", "target/release/armfortas"] { |
| 24 | 27 | let p = PathBuf::from(c); |
| 25 | 28 | if p.exists() { |
@@ -37,7 +40,7 @@ fn find_fortsh() -> Option<PathBuf> { | ||
| 37 | 40 | ]; |
| 38 | 41 | for c in &candidates { |
| 39 | 42 | if c.is_dir() { |
| 40 | - return Some(c.clone()); | |
| 43 | + return fs::canonicalize(c).ok(); | |
| 41 | 44 | } |
| 42 | 45 | } |
| 43 | 46 | None |
@@ -224,6 +227,7 @@ fn fortsh_module_graph_resolves() { | ||
| 224 | 227 | let obj = build_dir.join(format!("{}.o", stem)); |
| 225 | 228 | |
| 226 | 229 | let result = Command::new(&compiler) |
| 230 | + .current_dir(&build_dir) | |
| 227 | 231 | .args([ |
| 228 | 232 | src.to_str().unwrap(), |
| 229 | 233 | "-c", |
@@ -231,6 +235,7 @@ fn fortsh_module_graph_resolves() { | ||
| 231 | 235 | "-DUSE_C_STRINGS", |
| 232 | 236 | "-o", |
| 233 | 237 | obj.to_str().unwrap(), |
| 238 | + &format!("-J{}", build_dir.display()), | |
| 234 | 239 | &format!("-I{}", build_dir.display()), |
| 235 | 240 | ]) |
| 236 | 241 | .output() |