Improved benchmark argument parsing.
You can now say 'make bench BENCHARGS="markdown latex reader"' and both the markdown and latex readers will be benchmarked.
This commit is contained in:
parent
d5d6c9876d
commit
07b06cb6e6
1 changed files with 5 additions and 10 deletions
|
@ -48,18 +48,13 @@ writerBench doc (name, writer) = bench (name ++ " writer") $ nf
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = do
|
main = do
|
||||||
args <- getArgs
|
args <- getArgs
|
||||||
|
print args
|
||||||
let matchReader (n, TextReader _) =
|
let matchReader (n, TextReader _) =
|
||||||
case args of
|
"reader" `elem` args && n `elem` args
|
||||||
[] -> True
|
matchReader _ = False
|
||||||
[x] -> x == n
|
|
||||||
(x:y:_) -> x == n && y == "reader"
|
|
||||||
matchReader (_, _) = False
|
|
||||||
let matchWriter (n, TextWriter _) =
|
let matchWriter (n, TextWriter _) =
|
||||||
case args of
|
"writer" `elem` args && n `elem` args
|
||||||
[] -> True
|
matchWriter _ = False
|
||||||
[x] -> x == n
|
|
||||||
(x:y:_) -> x == n && y == "writer"
|
|
||||||
matchWriter (_, _) = False
|
|
||||||
let matchedReaders = filter matchReader readers
|
let matchedReaders = filter matchReader readers
|
||||||
let matchedWriters = filter matchWriter writers
|
let matchedWriters = filter matchWriter writers
|
||||||
inp <- UTF8.toText <$> B.readFile "test/testsuite.txt"
|
inp <- UTF8.toText <$> B.readFile "test/testsuite.txt"
|
||||||
|
|
Loading…
Reference in a new issue