tasty
tasty copied to clipboard
How to ignore unrecognized options?
We use tasty with cabal's internal libraries and some of our test suites depend on tasty-golden while others don't, so running cabal test library-test --test-options "--accept" fails with
Running 1 test suites...
Test suite sublibrary-test: RUNNING...
Invalid option `--accept'
which sometimes terminates the other tests and sometimes doesn't.
I guess it would be possible to implement an Ingredient that comes last, accepts any option and ignores it? But at that point it would be simpler to just introduce a dummy dependency on tasty-golden.
Am I missing something? Is there a way to ignore unrecognized options?
Thank you for the great library!
Dunno, but maybe ignoring unrecognized options with a warning rather than failing hard would be a more flexible and forward-compatible approach in a test suite runner like tasty?
Ignoring unrecognized options is dangerous: it is too easy for a typo to remain unnoticed with potentially disastrous effect.
It is easy to introduce a dummy dependency or add a dummy Ingredient or (even better) combine all test suites into a single executable, so I don't find fiddling with command line parsing justified.
I'm inclined to close as won't fix. There is includingOptions ingredient precisely to register additional command-line options if needed.