summaryrefslogtreecommitdiff
path: root/test/runTests.hs
diff options
context:
space:
mode:
authorCsaba Hruska <csaba.hruska@gmail.com>2016-02-17 22:00:26 +0100
committerCsaba Hruska <csaba.hruska@gmail.com>2016-02-17 22:00:26 +0100
commitad0427d4c31856c4f0fe57c1ed6cf7b4fec1ab6e (patch)
tree273c25cfc1914ccfd17158e2e492d29b56ea0859 /test/runTests.hs
parentc88325920b2000584bf9efc344f2a71ad066f4a4 (diff)
work on performance comparison tool
Diffstat (limited to 'test/runTests.hs')
-rw-r--r--test/runTests.hs14
1 files changed, 9 insertions, 5 deletions
diff --git a/test/runTests.hs b/test/runTests.hs
index c36e6c59..a175bc7e 100644
--- a/test/runTests.hs
+++ b/test/runTests.hs
@@ -84,10 +84,11 @@ testDataPath = "./testdata"
84 84
85data Config 85data Config
86 = Config 86 = Config
87 { cfgVerbose :: Bool 87 { cfgVerbose :: Bool
88 , cfgReject :: Bool 88 , cfgReject :: Bool
89 , cfgTimeout :: NominalDiffTime 89 , cfgTimeout :: NominalDiffTime
90 , cfgIgnore :: [String] 90 , cfgIgnore :: [String]
91 , cfgOverallTime :: Bool
91 } deriving Show 92 } deriving Show
92 93
93arguments :: Parser (Config, [String]) 94arguments :: Parser (Config, [String])
@@ -96,6 +97,7 @@ arguments =
96 <*> switch (short 'r' <> long "reject" <> help "Reject test cases with missing, new or different .out files") 97 <*> switch (short 'r' <> long "reject" <> help "Reject test cases with missing, new or different .out files")
97 <*> option (realToFrac <$> (auto :: ReadM Double)) (value 60 <> short 't' <> long "timeout" <> help "Timeout for tests in seconds") 98 <*> option (realToFrac <$> (auto :: ReadM Double)) (value 60 <> short 't' <> long "timeout" <> help "Timeout for tests in seconds")
98 <*> many (option (eitherReader Right) (short 'i' <> long "ignore" <> help "Ignore test")) 99 <*> many (option (eitherReader Right) (short 'i' <> long "ignore" <> help "Ignore test"))
100 <*> switch (long "overall-time" <> help "Writes overall time to overall-time.txt")
99 ) 101 )
100 <*> many (strArgument idm) 102 <*> many (strArgument idm)
101 103
@@ -167,7 +169,9 @@ main = do
167 ] 169 ]
168 ++ sh (\s ty -> ty == Passed && isWip s) "wip passed test" 170 ++ sh (\s ty -> ty == Passed && isWip s) "wip passed test"
169 171
170 putStrLn $ "Overall time: " ++ showTime (sum $ map fst resultDiffs) 172 let overallTime = sum $ map fst resultDiffs
173 putStrLn $ "Overall time: " ++ showTime overallTime
174 when cfgOverallTime $ writeFile "overall-time.txt" $ show (realToFrac overallTime :: Double)
171 175
172 when (or [erroneous r | ((_, r), f) <- zip resultDiffs testSet, not $ isWip f]) exitFailure 176 when (or [erroneous r | ((_, r), f) <- zip resultDiffs testSet, not $ isWip f]) exitFailure
173 putStrLn "All OK" 177 putStrLn "All OK"