简体   繁体   中英

How do I run my package's tests using different versions of its prerequisites?

Suppose I've written a Haskell package that I'd like to release to Hackage.

Suppose I've written automated tests for it, so I know it works on my machine, with the version of GHC I have installed, and the versions of other packages it depends on that I have installed.

Is there an automated way of running my package's tests using other versions of packages it depends on, and other versions of GHC (and versions of Hugs, etc)?

The objective is not only to check that it works with the prerequisites I think it should work with, but also to confirm it doesn't work with versions I expect it not to work with.

我想现在你最好的选择是cabal-devcapri以及一些本土脚本。

Use cabal configure --preference=DEPENDENCY , as described by cabal configure --help . I don't know, how it work, maybe just try it out. For instance, to test with the old base package, try

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

You may put the combinations of dependecies you want to test into some shell script, however you like.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM