Commit 80c98dbc authored by ttuegel's avatar ttuegel
Browse files

Fix use of multiple test options.

parent 51a4e402
......@@ -1265,7 +1265,7 @@ data TestFlags = TestFlags {
--TODO: eliminate the test list and pass it directly as positional args to the testHook
testList :: Flag [String],
-- TODO: think about if/how options are passed to test exes
testOptions :: Flag [PathTemplate]
testOptions :: [PathTemplate]
}
defaultTestFlags :: TestFlags
......@@ -1277,7 +1277,7 @@ defaultTestFlags = TestFlags {
testShowDetails = toFlag Failures,
testKeepTix = toFlag False,
testList = Flag [],
testOptions = Flag []
testOptions = []
}
testCommand :: CommandUI TestFlags
......@@ -1325,16 +1325,16 @@ testCommand = makeCommand name shortDesc longDesc defaultTestFlags options
++ "(name templates can use $pkgid, $compiler, "
++ "$os, $arch, $test-suite)")
testOptions (\v flags -> flags { testOptions = v })
(reqArg' "TEMPLATES" (toFlag . map toPathTemplate . splitArgs)
(map fromPathTemplate . fromFlagOrDefault []))
(reqArg' "TEMPLATES" (map toPathTemplate . splitArgs)
(map fromPathTemplate))
, option [] ["test-option"]
("give extra option to test executables "
++ "(no need to quote options containing spaces, "
++ "name template can use $pkgid, $compiler, "
++ "$os, $arch, $test-suite)")
testOptions (\v flags -> flags { testOptions = v })
(reqArg' "TEMPLATE" (\x -> toFlag [toPathTemplate x])
(map fromPathTemplate . fromFlagOrDefault []))
(reqArg' "TEMPLATE" (\x -> [toPathTemplate x])
(map fromPathTemplate))
]
emptyTestFlags :: TestFlags
......
......@@ -168,8 +168,7 @@ testController flags pkg_descr lbi suite preTest cmd postTest logNamer = do
let distPref = fromFlag $ testDistPref flags
verbosity = fromFlag $ testVerbosity flags
testLogDir = distPref </> "test"
optionTemplates = fromFlag $ testOptions flags
options = map (testOption pkg_descr lbi suite) optionTemplates
options = map (testOption pkg_descr lbi suite) $ testOptions flags
pwd <- getCurrentDirectory
existingEnv <- getEnvironment
......
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