Consistent handling of ld chained fixup warning in cli/glue tests

This commit is contained in:
David Smith 2023-05-16 17:12:13 -04:00
parent c072eda598
commit 58cb8352bb
No known key found for this signature in database
GPG key ID: 979D8D09D9570EED
3 changed files with 19 additions and 14 deletions

View file

@ -104,6 +104,18 @@ where
run_roc_with_stdin(&path_to_roc_binary(), args, &[])
}
pub fn has_error(stderr: &str) -> bool {
let is_reporting_runtime = stderr.starts_with("runtime: ") && stderr.ends_with("ms\n");
let is_clean = stderr.is_empty() ||
is_reporting_runtime ||
// macOS ld reports this warning, but if we remove -undefined dynamic_lookup,
// linking stops working properly.
stderr.trim() == "ld: warning: -undefined dynamic_lookup may not work with chained fixups";
!is_clean
}
pub fn path_to_roc_binary() -> PathBuf {
path_to_binary(if cfg!(windows) { "roc.exe" } else { "roc" })
}