foundry-rs / foundry

Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.
https://getfoundry.sh
Apache License 2.0
8.12k stars 1.68k forks source link

Consider accepting globs or multiple patterns for --match-contract and --match-test #1230

Open mattsse opened 2 years ago

mattsse commented 2 years ago

Component

Forge

Describe the feature you would like

consider globs for --match-contract and --match-test, too, but support passing in multiple of them. Right now using --match-test (and because of that also --debug) for fuzz tests is kind of annoying: --match-test "testSomeFuzz(uint256)"

https://github.com/gakonst/foundry/pull/1229#pullrequestreview-935683259

Additional context

No response

jatkz commented 1 year ago

hello, if this feature was implemented in its ideal state, would match-contract/match-test support both regex and globs or only globs?

and would passing multiple globs as a comma separated arg be sufficient?

mattsse commented 1 year ago

and would passing multiple globs as a comma-separated arg be sufficient?

I feel like it should, this should be trivial to add since , is an illegal char in solidity so we can safely combine multiple options.

happy to mentor if anyone wants to pick this up

sakulstra commented 1 year ago

as it's not mentioned here: i guess same feature would be desirable for --match-path as well

I'm currently trying to test two files as different locations (so just two relative paths), but i think there's currently not really a way.