Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(c2rust-analyze/tests) Add tests for string literals and casts #838

Merged
merged 3 commits into from
Feb 16, 2023

Conversation

kkysen
Copy link
Contributor

@kkysen kkysen commented Feb 16, 2023

Add tests for string literals and casts.

They are currently unsupported:

so for now the tests are skipped over with #[cfg(any())]. Once those issues are fixed, these tests will be turned back on, but it's easier to start with the tests existing.

These tests just check if c2rust-analyze doesn't crash on them, similar to the existing lighttpd-minimal test. For the FileCheck tests, FileCheck requires at least one CHECK: command, which we don't want. Thus, I've renamed lighttpd.rs to analyze.rs and it'll be for c2rust-analyze-only tests, as opposed to filecheck.rs for c2rust-analyze + FileCheck tests.

Furthermore, running cargo concurrently (due to multiple tests) for c2rust-analyze crashes in macOS CI, so now the c2rust-analyze binary is found to run directly, rather than going through cargo again.

Skipping going through cargo makes the tests run much faster, but more importantly, prevents them from competing for the target/ lock, which caused issues in CI on macOS sometimes. It's also a bit simpler now, not needing to go through cargo.

…filecheck.rs` and in preparation for other analyze-only tests.
…y're `cfg`ed off as they're not yet supported.
@kkysen kkysen changed the title (c2rust-analyze/test) Add tests for string literals and casts (c2rust-analyze/tests) Add tests for string literals and casts Feb 16, 2023
…ctly, rather than going through `cargo` again.

Skipping going through `cargo` makes the tests run much faster,
but more importantly, prevents them from competing for the `target/` lock,
which caused issues in CI on macOS sometimes.
It's also a bit simpler now, not needing to go through `cargo`.
@kkysen kkysen merged commit 327bd57 into master Feb 16, 2023
@kkysen kkysen deleted the kkysen/analyze-strings-casts-tests branch February 16, 2023 22:33
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.

2 participants