-
Notifications
You must be signed in to change notification settings - Fork 2.6k
tests: refactor testsuite cargo build --target
#14843
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,8 +53,13 @@ fn custom_target_minimal() { | |
.file("custom-target.json", SIMPLE_SPEC) | ||
.build(); | ||
|
||
p.cargo("build --lib --target custom-target.json -v").run(); | ||
p.cargo("build --lib --target src/../custom-target.json -v") | ||
p.cargo("build --lib") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So does this one. The original one is more readable IMO. |
||
.target("custom-target.json") | ||
.arg("-v") | ||
.run(); | ||
p.cargo("build --lib") | ||
.target("src/../custom-target.json") | ||
.arg("-v") | ||
.run(); | ||
|
||
// Ensure that the correct style of flag is passed to --target with doc tests. | ||
|
@@ -140,7 +145,10 @@ fn custom_bin_target() { | |
.file("custom-bin-target.json", SIMPLE_SPEC) | ||
.build(); | ||
|
||
p.cargo("build --target custom-bin-target.json -v").run(); | ||
p.cargo("build") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One drawback of it is that the argument list is spliited into multiple lines of indirection, making it harder to read at first glance. |
||
.target("custom-bin-target.json") | ||
.arg("-v") | ||
.run(); | ||
} | ||
|
||
#[cargo_test(nightly, reason = "requires features no_core, lang_items")] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This kind of dynamic one is something in my mind could benefit from this change, though I haven't seen other 100+ occurrences changed in this pull request.
Upon this point, maybe this refactor might not be worthy with this scale of churn on your side?
(updating 100+ occurrences of
--target
sounds tedious)