@@ -31,6 +31,7 @@ import RIO.Process
31
31
)
32
32
import qualified RIO.Set as Set
33
33
import qualified RIO.Text as T
34
+ import RIO.Time ( defaultTimeLocale , diffUTCTime , formatTime , getCurrentTime )
34
35
import System.Environment ( getExecutablePath , lookupEnv )
35
36
import System.Info ( os )
36
37
import System.PosixCompat.Files ( createSymbolicLink )
@@ -43,6 +44,7 @@ main = runSimpleApp $ do
43
44
logInfo " Initiating Stack integration test running"
44
45
45
46
options <- getRecord " Stack integration tests"
47
+ startTime <- getCurrentTime
46
48
results <- runApp options $ do
47
49
logInfo " Running with the following environment"
48
50
proc " env" [] runProcess_
@@ -62,10 +64,12 @@ main = runSimpleApp $ do
62
64
loop (idx + 1 ) rest' (res <> accum)
63
65
64
66
loop (1 :: Int ) (Set. toList tests) mempty
65
-
67
+ finalTime <- getCurrentTime
66
68
let (successes, failures) = partition ((== ExitSuccess ) . snd )
67
69
$ Map. toList results
68
-
70
+ let timeDiff = diffUTCTime finalTime startTime
71
+ let timeDiffStr = formatTime defaultTimeLocale " %H:%M:%S - total %s seconds" timeDiff
72
+ logInfo $ " Integration tests ran in : " <> fromString timeDiffStr
69
73
unless (null successes) $ do
70
74
logInfo " Successful tests:"
71
75
for_ successes $ \ (x, _) -> logInfo $ " - " <> display x
@@ -78,6 +82,7 @@ main = runSimpleApp $ do
78
82
for_ failures $ \ (x, ec) -> logInfo $ " - " <> display x <> " - " <> displayShow ec
79
83
exitFailure
80
84
85
+
81
86
data Options = Options
82
87
{ optSpeed :: Maybe Speed
83
88
, optMatch :: Maybe String
0 commit comments