haskell / haskell/cabal

cabal v2-install ignores flag --run-tests

Open
#7,267 10 comments 0 reactions 0 assignees View on GitHub
attention: pr-welcome cabal-install: cmd/install
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

(I searched whether this issue is already reported, but couldn't find it. If it exists, please tag it with `cabal-install: cmd/install`.)

It seems like
```
cabal v2-install --run-tests
```
simply ignores the option `--run-tests`. Neither a test-suite is run nor a warning is emitted that this option isn't valid.
Seems like this hasn't been working for 5 years at least, judging from the discussion at https://stackoverflow.com/questions/33040790/how-do-i-run-the-tests-that-are-part-of-an-installed-installing-cabal-package#comment53903271_33041029.

I would find `cabal install --run-tests` useful because it would run the tests with the `sdist`-generated package, ensuring that all files needed by the testsuite are packaged up correctly. (One easily forgets adding test files to `extra-source-files` in the .cabal file.)

I think while this is not working as expected, `cabal` should issue a warning that the flag is ignored.

I am using a recent version of the development branch:
```
$ cabal --version
cabal-install version 3.5.0.0
compiled using version 3.5.0.0 of the Cabal library
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.