1 module Main
(main
) where
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
17 (mtimeChange
, mtimeChange
') <- calibrateMtimeChangeDelay
18 let toMillis
:: Int -> Double
19 toMillis x
= fromIntegral x
/ 1000.0
21 "File modification time resolution calibration completed, "
22 ++ "maximum delay observed: "
23 ++ (show . toMillis
$ mtimeChange
)
25 ++ "Will be using delay of "
26 ++ (show . toMillis
$ mtimeChange
')
28 defaultMainWithIngredients
29 (includingOptions extraOptions
: defaultIngredients
)
32 tests
:: Int -> TestTree
33 tests mtimeChangeCalibrated
=
34 askOption
$ \(OptionMtimeChangeDelay mtimeChangeProvided
) ->
36 if mtimeChangeProvided
/= 0
37 then mtimeChangeProvided
38 else mtimeChangeCalibrated
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