vendredi 23 octobre 2015

How to automatically build test modules with stack?

I have this Spec.hs:

    import qualified OtherSpec

    main :: IO ()
    main = do
        putStrLn "Test..."
        OtherSpec.main

And I am planning to add more test suites from other modules to its main.

When I run tests as:

$ stack test --file-watch

A few things happen:

  • Tests are re-run when OtherSpec.hs is changed, but the test executable is not rebuilt.
  • When I change Spec.hs test executable is rebuilt and changes in OtherSpec.hs is also picked.

Is there a way to trigger a rebuild when OtherSpec.hs changes?

Aucun commentaire:

Enregistrer un commentaire