Skip to content

compiletest: Print why a test was ignored if it's the only test specified #106659

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
jyn514 opened this issue Jan 10, 2023 · 1 comment · Fixed by #106763 or #106769
Closed

compiletest: Print why a test was ignored if it's the only test specified #106659

jyn514 opened this issue Jan 10, 2023 · 1 comment · Fixed by #106763 or #106769
Assignees
Labels
A-contributor-roadblock Area: Makes things more difficult for new or seasoned contributors to Rust A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

Comments

@jyn514
Copy link
Member

jyn514 commented Jan 10, 2023

cc https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/.E2.9C.94.20bless.20src.2Ftest.2Fui.2Fstats.2Fhir-stats.2Ers.3F, where it took a while to track down why the test was ignored. Doing this for all tests is too much, because there can be many ignored tests in a full x.py test run, but when only a single test is specified with x test src/test/ui/stats/hir-stats.rs it's pretty clear that the user intends to run it.

I think

ignore |= ignore_llvm(config, ln);
ignore |=
config.run_clang_based_tests_with.is_none() && config.parse_needs_matching_clang(ln);
ignore |= !has_asm_support && config.parse_name_directive(ln, "needs-asm-support");
ignore |= !rustc_has_profiler_support && config.parse_needs_profiler_support(ln);
ignore |= !config.run_enabled() && config.parse_name_directive(ln, "needs-run-enabled");
ignore |= !rustc_has_sanitizer_support
&& config.parse_name_directive(ln, "needs-sanitizer-support");
ignore |= !has_asan && config.parse_name_directive(ln, "needs-sanitizer-address");
ignore |= !has_cfi && config.parse_name_directive(ln, "needs-sanitizer-cfi");
ignore |= !has_kcfi && config.parse_name_directive(ln, "needs-sanitizer-kcfi");
ignore |= !has_lsan && config.parse_name_directive(ln, "needs-sanitizer-leak");
ignore |= !has_msan && config.parse_name_directive(ln, "needs-sanitizer-memory");
ignore |= !has_tsan && config.parse_name_directive(ln, "needs-sanitizer-thread");
ignore |= !has_hwasan && config.parse_name_directive(ln, "needs-sanitizer-hwaddress");
ignore |= !has_memtag && config.parse_name_directive(ln, "needs-sanitizer-memtag");
ignore |= !has_shadow_call_stack
&& config.parse_name_directive(ln, "needs-sanitizer-shadow-call-stack");
ignore |= !config.can_unwind() && config.parse_name_directive(ln, "needs-unwind");
ignore |= config.target == "wasm32-unknown-unknown"
&& config.parse_name_directive(ln, directives::CHECK_RUN_RESULTS);
ignore |= config.debugger == Some(Debugger::Cdb) && ignore_cdb(config, ln);
ignore |= config.debugger == Some(Debugger::Gdb) && ignore_gdb(config, ln);
ignore |= config.debugger == Some(Debugger::Lldb) && ignore_lldb(config, ln);
ignore |= !has_rust_lld && config.parse_name_directive(ln, "needs-rust-lld");
is roughly the right part of the code to change.

@jyn514 jyn514 added A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one. A-contributor-roadblock Area: Makes things more difficult for new or seasoned contributors to Rust labels Jan 10, 2023
@lenko-d
Copy link
Contributor

lenko-d commented Jan 10, 2023

@rustbot claim

@jyn514 jyn514 added the E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. label Jan 10, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jan 29, 2023
…s_ignored_if_its_the_only_test_specified, r=Mark-Simulacrum

print why a test was ignored if its the only test specified

Fixes [rust-lang#106659](rust-lang#106659)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jan 29, 2023
…as_ignored_if_its_the_only_test_specified, r=Mark-Simulacrum

libtest: Print why a test was ignored if it's the only test specified.

Fixes [rust-lang#106659](rust-lang#106659)
Needed by [106763](rust-lang#106763)
thomcc pushed a commit to tcdi/postgrestd that referenced this issue May 31, 2023
…d_if_its_the_only_test_specified, r=Mark-Simulacrum

libtest: Print why a test was ignored if it's the only test specified.

Fixes [#106659](rust-lang/rust#106659)
Needed by [106763](rust-lang/rust#106763)
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-contributor-roadblock Area: Makes things more difficult for new or seasoned contributors to Rust A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
Projects
None yet
2 participants