Skip to content

Commit 4e7362f

Browse files
committed
transpile: snapshot: don't build tests that use libc
it's hard to link against libc with a direct rustc invocation. since we're testing output itself, transpiling it every time isn't critical.
1 parent fbcf3af commit 4e7362f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

c2rust-transpile/tests/snapshots.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ fn transpile(platform: Option<&str>, c_path: &Path) {
6868

6969
insta::assert_snapshot!(name, &rs, &debug_expr);
7070

71+
// Using rustc itself to build snapshots that reference libc is difficult because we don't know
72+
// the appropriate --extern libc=/path/to/liblibc-XXXXXXXXXXXXXXXX.rlib to pass. Skip for now,
73+
// as we've already compared the literal text.
74+
if rs.contains("libc::") {
75+
return;
76+
}
77+
7178
let status = Command::new("rustc")
7279
.args(&["--crate-type", "lib", "--edition", "2021", "-o", "-"])
7380
.arg(&rs_path)

0 commit comments

Comments
 (0)