Commit 377ac193 authored by Andreas Klebinger's avatar Andreas Klebinger

Fall back to default mode settings if normal/fast are not specified

parent 571648ec
......@@ -388,11 +388,30 @@ getTestCompileArgs nofib@Build{..} test = do
++ [ "-package-env", "-" ]
++ concat [ ["-package", pkg] | pkg <- words (config "SRC_DEPS") ]
getModeArgs :: (String -> String) -> Speed -> [String]
getModeArgs benchSettings speed = words $
case speed of
Slow -> with_default "SLOW_OPTS"
Norm -> benchSettings "NORM_OPTS"
Fast -> with_default "FAST_OPTS"
where
with_default mode_key
| settings <- (benchSettings mode_key)
, not (null settings)
= settings
| otherwise
= (benchSettings "NORM_OPTS")
getTestCmdline :: Nofib -> TestName -> IO (BSL.ByteString, [String])
getTestCmdline Build{..} test = do
config <- readConfig $ output </> unTestName test </> "config.txt"
-- Mode/Speed args default to normal mode.
let speed_args = getModeArgs config speed
-- print config
let args = words (config "PROG_ARGS")
++ words (config $ map toUpper (show speed) ++ "_OPTS")
++ speed_args
stdin_path <-
let s = config "STDIN_FILE"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment