--no-docs

This commit is contained in:
Michael Snoyman 2013-03-01 12:27:49 +02:00
parent 98172d3cb4
commit 96cf781c00
4 changed files with 10 additions and 2 deletions

View File

@ -23,6 +23,7 @@ defaultBuildSettings = BuildSettings
, expectedFailuresBuild = defaultExpectedFailures
, extraArgs = const ["-fnetwork23"]
, testWorkerThreads = 4
, buildDocs = True
}
build :: BuildSettings -> BuildPlan -> IO ()

View File

@ -100,7 +100,8 @@ runTestSuite settings testdir (packageName, SelectedPackageInfo {..}) = do
when spiHasTests $ do
getHandle AppendMode $ run "cabal" ["build"] dir
getHandle AppendMode $ runGhcPackagePath "cabal" ["test"] dir
getHandle AppendMode $ run "cabal" ["haddock"] dir
when (buildDocs settings) $
getHandle AppendMode $ run "cabal" ["haddock"] dir
return True
let expectedFailure = packageName `Set.member` expectedFailuresBuild settings
if passed

View File

@ -124,6 +124,8 @@ data BuildSettings = BuildSettings
, expectedFailuresBuild :: Set PackageName
, testWorkerThreads :: Int
-- ^ How many threads to spawn for running test suites.
, buildDocs :: Bool
-- ^ Build docs as part of the test procedure.
}
-- | A wrapper around a @Map@ providing a better @Monoid@ instance.

View File

@ -45,6 +45,7 @@ data BuildArgs = BuildArgs
{ sandbox :: String
, buildPlanSrc :: FilePath
, extraArgs' :: [String] -> [String]
, noDocs :: Bool
}
parseBuildArgs :: [String] -> IO BuildArgs
@ -53,12 +54,14 @@ parseBuildArgs =
{ sandbox = sandboxRoot defaultBuildSettings
, buildPlanSrc = defaultBuildPlan
, extraArgs' = id
, noDocs = False
}
where
loop x [] = return x
loop x ("--sandbox":y:rest) = loop x { sandbox = y } rest
loop x ("--build-plan":y:rest) = loop x { buildPlanSrc = y } rest
loop x ("--arg":y:rest) = loop x { extraArgs' = extraArgs' x . (y:) } rest
loop x ("--no-docs":rest) = loop x { noDocs = True } rest
loop _ (y:_) = error $ "Did not understand argument: " ++ y
defaultBuildPlan :: FilePath
@ -71,6 +74,7 @@ withBuildSettings args f = do
let settings = defaultBuildSettings
{ sandboxRoot = sandbox
, extraArgs = extraArgs' . extraArgs defaultBuildSettings
, buildDocs = not noDocs
}
f settings bp
@ -114,4 +118,4 @@ main = do
putStrLn " select [--no-clean] [--no-platform] [--exclude package...] [--only-permissive] [--allow package] [--build-plan file]"
putStrLn " check [--build-plan file] [--sandbox rootdir] [--arg cabal-arg]"
putStrLn " build [--build-plan file] [--sandbox rootdir] [--arg cabal-arg]"
putStrLn " test [--build-plan file] [--sandbox rootdir] [--arg cabal-arg]"
putStrLn " test [--build-plan file] [--sandbox rootdir] [--arg cabal-arg] [--no-docs]"