Let's say I have three of my own packages, AB and C, with dependencies on many additional packages in Hackage. I am using cabal 1.18.
- C depends on A and B.
- B depends on A.
- A and B have test suites.
I installed the sandbox as follows:
cd /path/to/sandbox cabal sandbox init cabal sandbox add-source /path/to/A cabal sandbox add-source /path/to/B cabal sandbox add-source /path/to/C
I want to create all the packages, run all the test packages on my packages, but not the dependency packages, showing the full test result. What is the best way to do this?
Option 1
cd /path/to/sandbox cabal install --enable-tests ABC
Problems:
- Unable to pass
--show-details=always to cabal install . - Test output is hidden in the log file and is not displayed.
- If the user previously performed
cabal install A , A will not be restored and tests will not run.
Option 2
cd /path/to/A cabal sandbox init --sandbox=/path/to/sandbox/.cabal-sandbox cd /path/to/B cabal sandbox init --sandbox=/path/to/sandbox/.cabal-sandbox cd /path/to/A cabal configure --enable-tests cabal test --show-details=always cd /path/to/B cabal configure --enable-tests cabal test --show-details=always cabal install C
Problems:
- This leads to the need for excessive restructuring of libraries A and B.
Option 3
In the cabal.config sandbox cabal.config add the string tests: True .
Problems:
- This will cause the tests to run for all dependent packages from Hackage, which is very slow and in some cases fails.
source share