Skip to content

Commit 31dcd11

Browse files
authored
transpile: tests: rename main.c to main_fn.c since the main.rs generated is detected as a test (#1499)
When testing `main.c`, `main.rs` is generated, and `cargo` thinks `c2rust-transpile/tests/snapshots/main.rs` is a second `snapshots` test, in addition to `c2rust-transpile/tests/snapshots.rs`: ```shell ❯ cargo test -p c2rust-transpile error: failed to load manifest for workspace member `/home/kkysen/work/c2rust/c2rust` Caused by: failed to load manifest for dependency `c2rust-transpile` Caused by: failed to parse manifest at `/home/kkysen/work/c2rust/c2rust-transpile/Cargo.toml` Caused by: found duplicate test name snapshots, but all test targets must have a unique name ``` This was from #1447, but wasn't caught in CI because it only runs `cargo test` a single time.
2 parents 924e703 + 2132f1b commit 31dcd11

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
File renamed without changes.

c2rust-transpile/tests/snapshots/snapshots__transpile@main.c.snap renamed to c2rust-transpile/tests/snapshots/snapshots__transpile@main_fn.c.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
source: c2rust-transpile/tests/snapshots.rs
3-
expression: cat tests/snapshots/main.rs
4-
input_file: c2rust-transpile/tests/snapshots/main.c
3+
expression: cat tests/snapshots/main_fn.rs
4+
input_file: c2rust-transpile/tests/snapshots/main_fn.c
55
---
66
#![allow(
77
dead_code,

0 commit comments

Comments
 (0)