make bench tests with command arguments work
This commit is contained in:
parent
bb29623d6e
commit
6958d47329
@ -62,7 +62,7 @@ usagehdr = "bench [-f testsfile] [-n iterations] [-p precision] executable1 [exe
|
|||||||
"Run some functional tests with each of the specified executables,\n" ++
|
"Run some functional tests with each of the specified executables,\n" ++
|
||||||
"where a test is \"zero or more arguments supported by all executables\",\n" ++
|
"where a test is \"zero or more arguments supported by all executables\",\n" ++
|
||||||
"and report the best execution times.\n"
|
"and report the best execution times.\n"
|
||||||
|
|
||||||
options = [
|
options = [
|
||||||
Option ['f'] ["testsfile"] (ReqArg File "testsfile") "file containing tests, one per line, default: bench.tests"
|
Option ['f'] ["testsfile"] (ReqArg File "testsfile") "file containing tests, one per line, default: bench.tests"
|
||||||
,Option ['n'] ["iterations"] (ReqArg Num "iterations") "number of test iterations to run, default: 2"
|
,Option ['n'] ["iterations"] (ReqArg Num "iterations") "number of test iterations to run, default: 2"
|
||||||
@ -149,7 +149,7 @@ doiteration opts test exe iteration = do
|
|||||||
time :: String -> IO Float
|
time :: String -> IO Float
|
||||||
time cmd = do
|
time cmd = do
|
||||||
t1 <- getCurrentTime
|
t1 <- getCurrentTime
|
||||||
ret <- system $ cmd ++ ">/dev/null 2>&1"
|
ret <- system $ cmd ++ " >/dev/null 2>&1"
|
||||||
case ret of
|
case ret of
|
||||||
ExitSuccess -> return ()
|
ExitSuccess -> return ()
|
||||||
ExitFailure f -> putStr $ printf " (error %d)" f
|
ExitFailure f -> putStr $ printf " (error %d)" f
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user