Skip to content

Conversation

@kkysen
Copy link
Contributor

@kkysen kkysen commented Dec 7, 2025

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:

❯ 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.

@kkysen kkysen force-pushed the kkysen/rename-main-snapshot branch from 38b9c42 to 9116173 Compare December 7, 2025 21:47
Copy link
Contributor Author

@kkysen kkysen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Rua, does this rename look good enough? main was a fine name, but it just conflicts.

@Rua
Copy link
Contributor

Rua commented Dec 7, 2025

main_fn might be more descriptive of what it contains/is testing?

@kkysen
Copy link
Contributor Author

kkysen commented Dec 7, 2025

main_fn might be more descriptive of what it contains/is testing?

Sure I can switch to that.

…generated is detected as a test

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.
@kkysen kkysen force-pushed the kkysen/rename-main-snapshot branch from 9116173 to 2132f1b Compare December 8, 2025 01:58
@kkysen kkysen changed the title transpile: tests: rename main.c to main_args.c since the main.rs generated is detected as a test transpile: tests: rename main.c to main_fn.c since the main.rs generated is detected as a test Dec 8, 2025
@kkysen
Copy link
Contributor Author

kkysen commented Dec 8, 2025

main_fn might be more descriptive of what it contains/is testing?

Switched to main_fn now.

@kkysen kkysen merged commit 31dcd11 into master Dec 8, 2025
5 checks passed
@kkysen kkysen deleted the kkysen/rename-main-snapshot branch December 8, 2025 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants