Closed
Description
Currently, the process for package tests in Cabal is something like:
- Create a new Haskell file and write a lot of boilerplate to call a bunch of Cabal/ghc-pkg commands
- Wire it up to the main test caller
- Call 'cabal test' and wait for the test suite to build
- Actually run the test suite
This really sucks, for a few reasons:
- It takes a lot of boilerplate to write the actual package test, way more than an equivalent shell script plus expected output to diff against would
- Under the most normal workflow, we have to rebuild the test suite every time we make a change (e.g. tweak a command). This makes for a pretty annoying compile-run cycles
- It's opaque: it's much harder to reverse engineer what the source level commands are being run
The way GHC does these tests is that it just has a test runner which runs some shell scripts (really a Makefile) which runs a test, and the diffs it against some expected output. There's a bit of fuzz to make it all work out, but it is quite nice. Cabal should grow something similar; maybe that would encourage more tests! (Maybe there is a good out-of-the-box thing we can use here.)
Metadata
Metadata
Assignees
Labels
No labels