Update setupMinCabalVersionConstraint
[cabal.git] / cabal-install / tests / LongTests.hs
blob0c315046780b72260e392d9d1185cdfe605dd1ea
1 module Main (main) where
3 import Test.Tasty
5 import Distribution.Compat.Time
6 import Distribution.Simple.Utils
7 import Distribution.Verbosity
9 import qualified UnitTests.Distribution.Client.Described
10 import qualified UnitTests.Distribution.Client.FileMonitor
11 import qualified UnitTests.Distribution.Client.VCS
12 import qualified UnitTests.Distribution.Solver.Modular.QuickCheck
13 import UnitTests.Options
15 main :: IO ()
16 main = do
17 (mtimeChange, mtimeChange') <- calibrateMtimeChangeDelay
18 let toMillis :: Int -> Double
19 toMillis x = fromIntegral x / 1000.0
20 notice normal $
21 "File modification time resolution calibration completed, "
22 ++ "maximum delay observed: "
23 ++ (show . toMillis $ mtimeChange)
24 ++ " ms. "
25 ++ "Will be using delay of "
26 ++ (show . toMillis $ mtimeChange')
27 ++ " for test runs."
28 defaultMainWithIngredients
29 (includingOptions extraOptions : defaultIngredients)
30 (tests mtimeChange')
32 tests :: Int -> TestTree
33 tests mtimeChangeCalibrated =
34 askOption $ \(OptionMtimeChangeDelay mtimeChangeProvided) ->
35 let mtimeChange =
36 if mtimeChangeProvided /= 0
37 then mtimeChangeProvided
38 else mtimeChangeCalibrated
39 in testGroup
40 "Long-running tests"
41 [ testGroup
42 "Solver QuickCheck"
43 UnitTests.Distribution.Solver.Modular.QuickCheck.tests
44 , testGroup "UnitTests.Distribution.Client.VCS" $
45 UnitTests.Distribution.Client.VCS.tests mtimeChange
46 , testGroup "UnitTests.Distribution.Client.FileMonitor" $
47 UnitTests.Distribution.Client.FileMonitor.tests mtimeChange
48 , UnitTests.Distribution.Client.Described.tests