-
-
Notifications
You must be signed in to change notification settings - Fork 33.5k
doc: document wildcard supported by tools/test.py #60265
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
Conversation
This seems to be a underdocumented but useful trick that only very few people know about. Also add a pointer to the test running guide in the test writing guide.
Review requested:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW the test/
prefix is optional and can be omitted, e.g.
tools/test.py parallel/test-stream-*
works.
(IIRC originally the prefix-less (no test/
) syntax was the originally supported syntax, and the ability to include the test/
prefix was added later.)
In certain shells, the wildcard should be quoted:
I use this pattern a lot, without |
Yes, that's mentioned in the examples |
Added a few more examples without the prefix (I used the one with the prefix a bit more often because I tend to copy the relative path from vscode) |
Landed in 8096aea |
```bash | ||
tools/test.py test/parallel/test-stream-* | ||
tools/test.py parallel/test-stream-* # The test/ prefix can be omitted | ||
# In some shell environments, you may need to quote the pattern |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW that might be a bit misleading. If you don't quote it (and you use a POSIX-complient shell), the shell is going to expand it (i.e. looking for all files that match and pass each as a separate arg); so arguably quotes are always necessary, otherwise you waste a lot of time for on the shell expansion:
$ time tools/test.py test/parallel/test-debug*
[00:05|% 100|+ 35|- 0]: Done
All tests passed.
tools/test.py test/parallel/test-debug* 15.09s user 1.94s system 92% cpu 18.477 total
$ time tools/test.py 'test/parallel/test-debug*'
[00:05|% 100|+ 35|- 0]: Done
All tests passed.
tools/test.py 'test/parallel/test-debug*' 8.38s user 1.04s system 146% cpu 6.424 total
This seems to be a underdocumented but useful trick that only very few people know about. Also add a pointer to the test running guide in the test writing guide.