Skip to content
This repository has been archived by the owner on Aug 2, 2020. It is now read-only.

Commit

Permalink
Minor Revision
Browse files Browse the repository at this point in the history
  • Loading branch information
chitrak7 committed Jun 12, 2018
1 parent 29a6a0d commit d886a74
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 14 deletions.
11 changes: 7 additions & 4 deletions src/CommandLine.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
module CommandLine (
optDescrs, cmdLineArgsMap, cmdFlavour, lookupFreeze1, cmdIntegerSimple,
cmdProgressColour, cmdProgressInfo, cmdConfigure, cmdSplitObjects,
cmdInstallDestDir, lookupBuildRoot, TestArgs(..), defaultTestArgs
cmdInstallDestDir, lookupBuildRoot, TestArgs(..), TestSpeed(..),
defaultTestArgs
) where

import Data.Either
Expand All @@ -12,6 +13,8 @@ import Hadrian.Utilities hiding (buildRoot)
import System.Console.GetOpt
import System.Environment

data TestSpeed = Slow | Average | Fast deriving (Show, Eq)

-- | All arguments that can be passed to Hadrian via the command line.
data CommandLineArgs = CommandLineArgs
{ configure :: Bool
Expand Down Expand Up @@ -161,8 +164,8 @@ readTestThreads thread = Right $ \flags -> flags { testArgs = (testArgs flags) {
readTestVerbose :: Maybe String -> Either String (CommandLineArgs -> CommandLineArgs)
readTestVerbose verbose = Right $ \flags -> flags { testArgs = (testArgs flags) { testVerbosity = verbose } }

readTestWays :: Maybe String -> Either String (CommandLineArgs -> CommandLineArgs)
readTestWays ways =
readTestWay :: Maybe String -> Either String (CommandLineArgs -> CommandLineArgs)
readTestWay ways =
case ways of
Nothing -> Right id
Just way -> Right $ \flags ->
Expand Down Expand Up @@ -208,7 +211,7 @@ optDescrs =
"Number of concurrent parallel jobs"
, Option [] ["test-verbose"] (OptArg readTestVerbose "TEST_VERBOSE")
"A verbosity value between 0 and 5. 0 is silent, 4 and higher activates extra output."
, Option [] ["test-way"] (OptArg readTestWays "TEST_WAY")
, Option [] ["test-way"] (OptArg readTestWay "TEST_WAY")
"only run these ways" ]

-- | A type-indexed map containing Hadrian command line arguments to be passed
Expand Down
6 changes: 0 additions & 6 deletions src/Hadrian/Utilities.hs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ module Hadrian.Utilities (

-- * Useful re-exports
Dynamic, fromDynamic, toDyn, TypeRep, typeOf,

-- * Testsuite Settings
TestSpeed (..)
) where

import Control.Monad.Extra
Expand Down Expand Up @@ -484,6 +481,3 @@ renderUnicorn ls =
ponyPadding = " "
boxLines :: [String]
boxLines = ["", "", ""] ++ (lines . renderBox $ ls)

data TestSpeed = Slow | Average | Fast deriving (Show, Eq)

3 changes: 1 addition & 2 deletions src/Rules/Test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ needTestsuiteBuilders = do
need targets
where
needfile :: Stage -> Package -> Action FilePath
needfile stage pkg | isLibrary pkg = pkgConfFile (Context stage pkg vanilla)
| otherwise = programPath =<< programContext stage pkg
needfile stage pkg = programPath =<< programContext stage pkg


needTestBuilders :: Action ()
Expand Down
2 changes: 1 addition & 1 deletion src/Settings/Builders/Make.hs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ validateBuilderArgs = builder (Make "testsuite/tests") ? do
checkPpr <- expr $ fullpath checkPpr
checkApiAnnotations <- expr $ fullpath checkApiAnnotations
return [ "fast"
, "THREADS=" ++ threads
, "THREADS=" ++ show threads
, "TEST_HC=" ++ (top -/- compiler)
, "CHECK_PPR=" ++ (top -/- checkPpr)
, "CHECK_API_ANNOTATIONS=" ++ (top -/- checkApiAnnotations)
Expand Down
2 changes: 1 addition & 1 deletion src/Settings/Builders/RunTest.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Settings.Builders.RunTest (runTestBuilderArgs) where

import CommandLine (TestArgs(..), defaultTestArgs)
import CommandLine (TestArgs(..), defaultTestArgs, TestSpeed(..))
import Flavour
import GHC.Packages
import Hadrian.Builder (getBuilderPath)
Expand Down

0 comments on commit d886a74

Please sign in to comment.