Skip to content

compiletest interprets subdirectory for tests as filter instead #120300

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

Open
klensy opened this issue Jan 24, 2024 · 4 comments
Open

compiletest interprets subdirectory for tests as filter instead #120300

klensy opened this issue Jan 24, 2024 · 4 comments
Labels
A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@klensy
Copy link
Contributor

klensy commented Jan 24, 2024

While working on #120273, i used python x.py --stage=1 t tests/ui/borrowck/ --force-rerun to run some subset of tests instead of full suite, as described in https://rustc-dev-guide.rust-lang.org/tests/running.html#running-a-subset-of-the-test-suites:

If you only need to test a specific subdirectory of tests for any given test suite,
 you can pass that directory to ./x test:

./x test tests/ui/const-generics

and expected to run test only in tests/ui/borrowck/ folder,
but instead noticed that this actually tested not subdirectory tests/ui/borrowck/, but any test with borrowck in path, like

tests/ui/borrowck/borrowck-mut-addr-of-imm-var.rs
tests/ui/pattern/bindings-after-at/borrowck-pat-by-copy-bindings-in-at.rs
tests/ui/span/borrowck-ref-into-rvalue.rs

Or maybe bootstrap parses input for compiletest wrong?

@rustbot label +A-testsuite

@klensy klensy added the C-bug Category: This is a bug. label Jan 24, 2024
@rustbot rustbot added needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. A-testsuite Area: The testsuite used to check the correctness of rustc labels Jan 24, 2024
@Teapot4195
Copy link
Contributor

@rustbot label +T-bootstrap -A-testsuite -needs-triage

@rustbot rustbot added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) and removed A-testsuite Area: The testsuite used to check the correctness of rustc needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jan 24, 2024
@ehuss
Copy link
Contributor

ehuss commented Jan 24, 2024

I believe this is a limitation of libtest, which is only capable of filtering tests based on "contains" or "exact", but not "startswith".

@onur-ozkan
Copy link
Member

AFAIK unless you provide the --exact flag, all values will be filtered because libtest is not capable of determining whether the value is part of any path or if it is just the value you want to filter.

@klensy
Copy link
Contributor Author

klensy commented Jan 24, 2024

I believe this is a limitation of libtest, which is only capable of filtering tests based on "contains" or "exact", but not "startswith".

Yes, but compiletest can filter/mark as ignored tests before passing to test::run_tests_console

@jieyouxu jieyouxu added the A-testsuite Area: The testsuite used to check the correctness of rustc label May 20, 2024
@jieyouxu jieyouxu moved this from Needs Triage / Backlog to Ready in compiletest maintenance and improvements May 29, 2024
@jieyouxu jieyouxu added the A-compiletest Area: The compiletest test runner label May 29, 2024
@jieyouxu jieyouxu added the E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot. label Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
Development

No branches or pull requests

6 participants