(c2rust-analyze/tests
) Add tests for string literals and casts
#838
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add tests for string literals and casts.
They are currently unsupported:
c2rust-analyze
) Handle transpiled string literals (b"...\0" as *const u8 as *const libc::c_char
) #833c2rust-analyze
) Handle string literals #837so 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 existinglighttpd-minimal
test. For theFileCheck
tests,FileCheck
requires at least oneCHECK:
command, which we don't want. Thus, I've renamedlighttpd.rs
toanalyze.rs
and it'll be forc2rust-analyze
-only tests, as opposed tofilecheck.rs
forc2rust-analyze
+FileCheck
tests.Furthermore, running
cargo
concurrently (due to multiple tests) forc2rust-analyze
crashes in macOS CI, so now thec2rust-analyze
binary is found to run directly, rather than going throughcargo
again.Skipping going through
cargo
makes the tests run much faster, but more importantly, prevents them from competing for thetarget/
lock, which caused issues in CI on macOS sometimes. It's also a bit simpler now, not needing to go throughcargo
.