Skip to content

Conversation

@DCNick3
Copy link
Contributor

@DCNick3 DCNick3 commented Mar 19, 2025

artifact.target.test seems to only tell if the executable has tests, not whether it is a test executable

This was causing ordinary executables to be named as if they were tests

`artifact.target.test` seems to only tell if the executable _has_ tests, not whether it _is_ a test executable
@DCNick3 DCNick3 requested a review from a team as a code owner March 19, 2025 23:34
// when a single executable is built anyway but maybe not in all cases.
let name = match artifact.target.kind[0].as_ref() {
"bin" | "lib" | "rlib" | "dylib" if artifact.target.test => {
"bin" | "lib" | "rlib" | "dylib" if artifact.profile.test => {
Copy link
Member

@ian-h-chamberlain ian-h-chamberlain Mar 20, 2025

Choose a reason for hiding this comment

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

Looks okay to me; the cargo_metadata docs are a little unclear (to me) about the difference but I guess Whether or not this target is tested by default by cargo test would in fact be true for most lib targets so I'm surprised I never noticed this before... I guess because we don't generally build .3dsx for libs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems to also be true for binaries (or, at least, my binary), so I do wonder how it was never caught before!

@ian-h-chamberlain ian-h-chamberlain merged commit 293f231 into rust3ds:master Mar 20, 2025
3 checks passed
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