transpile: tests: Run test_translator.py from cargo nextest with the currently built transpiler path#1731
Open
chiragdhawan24 wants to merge 5 commits intoimmunant:masterfrom
Open
Conversation
…rust-transpile's debug build.
ahomescu
reviewed
Apr 7, 2026
kkysen
reviewed
Apr 7, 2026
Comment on lines
+17
to
+18
| "test_translator.py failed with status: {}", | ||
| status |
Contributor
There was a problem hiding this comment.
Suggested change
| "test_translator.py failed with status: {}", | |
| status | |
| "test_translator.py failed with status: {status}" |
Contributor
There was a problem hiding this comment.
Could you also print the whole command that failed? Like this
let mut cmd = Command::new("../scripts/test_translator.py");
cmd.args(["../tests/unit", "--transpiler"]);
cmd.arg(transpile_path);
let status = cmd.status().unwrap_or_else(|e| panic!("{cmd:?} failed: {e}");
assert!(status.success(), "{cmd:?} failed with {status}");
Author
There was a problem hiding this comment.
I have addressed this in the latest commit.
kkysen
reviewed
Apr 7, 2026
test_translator.py from cargo nextest with the currently built transpiler path
kkysen
requested changes
Apr 7, 2026
Contributor
kkysen
left a comment
There was a problem hiding this comment.
Thanks for this! A few other things:
We use cargo nextest run instead of cargo test, so run that locally instead.
Can you update the README and anywhere else that references test_translator.py to say you can also just run cargo nextest run?
kkysen
reviewed
Apr 9, 2026
kkysen
reviewed
Apr 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When running the tests,
test_translator.pycould end up using a stalec2rust/c2rust-transpilebinary unlesscargo build --releasehad been run manually beforehand.This change updates the test flow so repo tests use the latest version of
c2rust-transpilebinary built bycargo test, by passing the current transpiler path intotest_translator.pyand overriding the configured transpiler path for that test run.This removes the manual pre-build requirement and makes local test execution less error-prone.
Testing:
cargo test -- --nocapturetest_translator.pywas invoked, and it received the expectedc2rust-transpilepathcargo build --release