[commit: Cabal] master: Fix use of multiple test options. (d020c65)
Ian Lynagh
igloo at earth.li
Tue Jul 19 15:25:44 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/packages/Cabal
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/d020c65d66514f1bbe69815b9c5b0c0b9f0ed5a8
>---------------------------------------------------------------
commit d020c65d66514f1bbe69815b9c5b0c0b9f0ed5a8
Author: Thomas Tuegel <ttuegel at gmail.com>
Date: Sat May 21 22:30:29 2011 +0000
Fix use of multiple test options.
>---------------------------------------------------------------
cabal/Distribution/Simple/Setup.hs | 12 ++++++------
cabal/Distribution/Simple/Test.hs | 3 +--
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/cabal/Distribution/Simple/Setup.hs b/cabal/Distribution/Simple/Setup.hs
index b696bdc..ca9fa0a 100644
--- a/cabal/Distribution/Simple/Setup.hs
+++ b/cabal/Distribution/Simple/Setup.hs
@@ -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
diff --git a/cabal/Distribution/Simple/Test.hs b/cabal/Distribution/Simple/Test.hs
index 6cba127..54a44e6 100644
--- a/cabal/Distribution/Simple/Test.hs
+++ b/cabal/Distribution/Simple/Test.hs
@@ -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
More information about the Cvs-libraries
mailing list