How to run package tests using different versions of its prerequisites?

Suppose I wrote a Haskell package that I would like to release in Hackage.

Suppose I wrote automated tests for this, so I know that it works on my machine, with the version of GHC installed by me, as well as with the versions of other packages that I installed.

Is there an automated way to run my package tests using other versions of the packages on which it depends, and other versions of GHC (and versions of Hugs, etc.)?

The goal is not only to verify that it works with prerequisites, I think it should work, but to confirm that it does not work with versions, I expect it to not work.

+4
source share
2 answers

I think now your best bet is cabal-dev or capri and some homegrown scripts.

+2
source

Use cabal configure --preference=DEPENDENCY as described in cabal configure --help . I don’t know how it works, maybe just try it. For example, to test with the old base package, try

  cabal configure "--preference = base == 3.0.0" 

You can put the dependency combinations you want to test in some kind of shell script as you like.

+1
source

Source: https://habr.com/ru/post/1336295/


All Articles