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

The config "test" is always ignored in [target.<cfg>] in config.toml. #126933

Closed
heipiao233 opened this issue Jun 25, 2024 · 1 comment
Closed
Labels
C-bug Category: This is a bug. T-cargo Relevant to the cargo team, which will review and decide on the PR/issue.

Comments

@heipiao233
Copy link

I tried this code:

[target.'cfg(test)']
runner = "./run_test.sh"

[target.'cfg(not(test))']
runner = "./run.sh"

I expected to see this happen: When I run cargo test, it uses ./run_test.sh as the runner, and when I run cargo run, it uses ./run.sh

Instead, this happened: It always uses ./run.sh

Meta

rustc --version --verbose:

rustc 1.81.0-nightly (6b0f4b5ec 2024-06-24)
binary: rustc
commit-hash: 6b0f4b5ec3aa707ecaa78230722117324a4ce23c
commit-date: 2024-06-24
host: x86_64-unknown-linux-gnu
release: 1.81.0-nightly
LLVM version: 18.1.7
@heipiao233 heipiao233 added the C-bug Category: This is a bug. label Jun 25, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jun 25, 2024
@heipiao233
Copy link
Author

Duplicate of rust-lang/cargo#8170

@saethlin saethlin added T-cargo Relevant to the cargo team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-cargo Relevant to the cargo team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants