Comments (13)
It seems quite ad-hoc to me to do something different in cabal run
because something happens to be a test executable.
from cabal.
#9923 may be related, closed in anticipation of the imminent cabal-install-3.12.*
release that will be able to cabal run
from the Cabal-tests
subdirectory without a workaround.
@jasagredo is there a change in behaviour between cabal-install-3.10.3.0
and cabal-install
built from HEAD
, #9923 (comment)?
from cabal.
@philderbeast No change with a cabal from master
as of this Sunday (e1f73a4).
@mpickering Fair point. What if I propose that cabal run
also moves to the directory of the package in the project in which the executable was defined, be it a executable
, a benchmark
or a test-suite
, so not only for test-suites?
from cabal.
That's likely to be fairly user-visible, and I'd want to hear input from cabal-install users before making that change.
from cabal.
What if I propose that cabal run also moves to the directory of the package in the project in which the executable was defined, be it a executable, a benchmark or a test-suite, so not only for test-suites?
What about executable
s? There it would be quite odd to change directory, and quite probably not what the user wants at all. Consider, e.g. an executable that defines a code generator - you are quiet plausibly going to want to run that somewhere else, not in it's own package!
I wonder if we could ask a different question: why do people cabal run
their test suites? I can think of a couple of reasons why I've done this in the past:
- Cabal won't intercept the executable output in the way it does for test suites, which can be annoying
- It's much easier to pass a bunch of arguments to the test executable using
cabal run
's---
trailing arguments syntax, versuscabal test
's--test-options
option (quoting!)- This is maybe a pretty easy fix: we could just add the trailing argument syntax to
cabal test
andcabal bench
(but what about testing multiple components?)
- This is maybe a pretty easy fix: we could just add the trailing argument syntax to
- More?
Perhaps if we can just fix those issues we can leave cabal run
doing the straightforward thing.
from cabal.
Your 1 and 2 are the only reasons I've heard for cabal run
-ing tests.
from cabal.
I think test-show-details: direct
already fixes 1, anyway?
from cabal.
It does, but apparently people are annoyed by needing to say cabal test someTest --test-show-details=direct
. I gather they don't want to put it in cabal.project
because for most things, e.g. CI, they want the normal behavior; it's when trying to figure out why a test is failing that they need the extra noise.
Maybe a short option for specifically that option is the way to go. (I haven't checked; maybe -D
is available?)
from cabal.
It's the default these days anyway: #8942
from cabal.
Indeed I use cabal run
precisely because of the test arguments and how annoying is to get the quoting right. If cabal test
would have the trailing slashes arguments, that would be awesome
from cabal.
I agree with @michaelpj that I expect benchmarks and test to support --
like cabal run
.
from cabal.
I'm fine with that. Let's close this issue and open a proper one that explicitly requests that feature.
from cabal.
FTR #10131
from cabal.
Related Issues (20)
- Normalizing output doesn't work properly in Windows
- Loading multiple component with reexported module
- Cabal clean fails on Windows when there are s-r-p because of read-only git internal files
- cabal-install-solver package description synopsis is a copypasto from cabal-install
- Support `store-dir` and `package-env` in `cabal.project` HOT 1
- `cabal-install/tests/IntegrationTests2.hs` is sensitive to local configuration HOT 3
- Produce a cabal.project file upon `cabal init` to pin the GHC version explicitly HOT 4
- [CI] Silent test-suite fails on Windows
- Figure out why `MAX_PATH` is still a problem in Cabal HOT 1
- Timeline for next Cabal release (support for profiled dynamic way) HOT 6
- "Magic" behavior when `cabal exec` is used with `with-compiler:` HOT 3
- `cabal path` writes purely informational output to `stdout` instead of `stderr` HOT 1
- Dependency License Audit and Automatic In/Exclusion Lists HOT 2
- Migration guide for SetupHooks, especially hookedPreProcessors HOT 2
- `--repl-multi-file` doesn't seem to play nice with older versions of GHC
- Deploying Cabal on RISC-V Architecture HOT 12
- Parsing of `extra-lib-dirs` fails if trailing comma
- Cabal repl confusing error message for non-exposed module
- Convenient way of loading specific module in repl
- convert cabal-install/changelog to markdown HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cabal.