Skip to content

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

@jyn514

Description

@jyn514

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.

Metadata

Metadata

Assignees

Labels

A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustA-testsuiteArea: The testsuite used to check the correctness of rustcC-enhancementCategory: An issue proposing an enhancement or a PR with one.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions