Skip to content
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

cabal bench and cabal test should allow passing arguments via trailing -- #10131

Closed
jasagredo opened this issue Jun 21, 2024 · 3 comments
Closed

Comments

@jasagredo
Copy link
Collaborator

Only cabal run allows to pass arguments with:

cabal run <some-exe> -- <some args to the exe>

Not having this in cabal test is usually why users run the test-suites via cabal run. For passing options to cabal test one has to specify them in --test-options which can be complicated with quoting.

$ cabal test --help | grep option
...
 --test-options=TEMPLATES       give extra options to test executables (name
 --test-option=TEMPLATE         give extra option to test executables (no need
                                to quote options containing spaces, name
 --benchmark-options=TEMPLATES  give extra options to benchmark executables
 --benchmark-option=TEMPLATE    give extra option to benchmark executables (no
                                need to quote options containing spaces, name

It should be doable to make cabal test (and while we are at it also cabal bench) support trailing -- arguments. And perhaps those other flags could be removed/deprecated/hidden.

@michaelpj
Copy link
Collaborator

My immediate concern was "what about multiple test suites?", but --test-option has exactly the same problem, and I think cabal just feeds all the options to all the test suites, which would also be a perfectly reasonable behaviour for --.

@ulysses4ever
Copy link
Collaborator

This has been requested many times. The main ticket is #6198 Better keep the discussion in one place perhaps. There's also a POC PR referenced there.

@jasagredo
Copy link
Collaborator Author

Aha it is indeed a duplicate. Sorry for the noise.

@ulysses4ever ulysses4ever closed this as not planned Won't fix, can't repro, duplicate, stale Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants