crystal
crystal copied to clipboard
Exclude the execution of specific examples in `crystal spec`
crystal spec currently has one option --example STRING (or -e STRING) to only execute examples which contain STRING in their name (it's supposed to cover the entire name, but is currently limited to each name fragment, see #10810).
Another option to target executing only specific examples is the --line NUMBER option (-l NUMBER) which is also populated if a file path contains a line number (e.g. path/file.cr:1).
I would like to have an option to exclude specific examples. When I know that one particular example is broken, I don't need to run it again until I'm able to fix it. Of course I could go into the source code and mark it as pending. But that requires rebuilding the entire spec suite which can be quite resource intensive or not easily available (when cross-compiling, for example).
I'm thinking of basically the inversion of --example and --line options which specify an example that I don't want to execute (but everything else).
Combinations betwen positive and negative filters should be possible.
Another missing feature for example filtering is regex support for the name. Not sure how relevant that is, but it would offer some more flexibility over plain string matching. Anyway it's worth considering this with regards to the inverse filtering feature as well.