1 import Test
.Cabal
.Prelude
3 -- Test that setup computes different IPIDs when dependencies change
4 main
= setupAndCabalTest
$ do
6 withDirectory
"P1" $ setup
"configure" ["--disable-deterministic"]
7 withDirectory
"P2" $ setup
"configure" ["--disable-deterministic"]
8 withDirectory
"P1" $ setup
"build" []
9 withDirectory
"P1" $ setup
"build" [] -- rebuild should work
10 recordMode DoNotRecord
$ do
11 r1
<- withDirectory
"P1" $ setup
' "register" ["--print-ipid", "--inplace"]
12 withDirectory
"P2" $ setup
"build" []
13 r2
<- withDirectory
"P2" $ setup
' "register" ["--print-ipid", "--inplace"]
14 let exIPID s
= takeWhile (/= '\n') $
15 head . filter (isPrefixOf $ "UniqueIPID-0.1-") $ (tails s
)
16 assertNotEqual
"ipid match" (exIPID
$ resultOutput r1
) (exIPID
$ resultOutput r2
)