compiletest: `./x test <filter>` is a substring match
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
This is very non-intuitive...
I tried on native x86_64-pc-windows-msvc:
./x test tests/run-make/exp/ --stage 1
This showed me 8 tests were ignored (incl. a local tests/run-make/exp/ test I added for testing) even though I would've expected an exact match for only the local test I added:
[23:37] Joe:rust (return-adjustment-target) | ls -d tests/run-make/*exp*
tests/run-make/export-executable-symbols/ tests/run-make/share-generics-export-again/
tests/run-make/extern-fn-explicit-align/ tests/run-make/wasm-export-all-symbols/
tests/run-make/mingw-export-call-convention/ tests/run-make/wasm-symbols-not-exported/
tests/run-make/rustdoc-scrape-examples-invalid-expr/
I almost never want this substring match behavior, at least not unless I explicitly write some kind of --test-name="exp", for example.
I suspect this is some behavior related to the test name constructed by compiletest, which is fed to libtest which probably handles the test filtering... Ah, it might be the test name constructed from the test path...
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how compiletest constructs test names for ./x test <filter> and how that filter is passed to libtest. Reproduce the tests/run-make/exp/ example, then verify that the default filter selects the intended test path rather than substring matches, while any explicitly supported pattern behavior remains clear.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100