Skip to content

Commit

Permalink
Fix remaining tests and update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
harpocrates committed Aug 13, 2018
1 parent 9d1b8b4 commit d0d3415
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions cabal-install/Distribution/Client/CmdRepl.hs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ replCommand = Client.installCommand {
++ "to the default component (or no component if there is no project present)\n"

++ cmdCommonHelpTextNewBuildBeta,
commandDefaultFlags = (configFlags,configExFlags,installFlags,haddockFlags,testFlags,defaultEnvFlags),
commandDefaultFlags = (configFlags,configExFlags,installFlags,haddockFlags,testFlags,[],defaultEnvFlags),
commandOptions = \showOrParseArgs ->
map liftOriginal (commandOptions Client.installCommand showOrParseArgs)
++ map liftReplOpts (replOptions showOrParseArgs)
Expand All @@ -192,7 +192,7 @@ replCommand = Client.installCommand {
updateOriginal (a,b,c,d,e) (_,_,_,_,_,f,g) = (a,b,c,d,e,f,g)

projectReplOpts (_,_,_,_,_,f,_) = f
updateReplOpts e (a,b,c,d,e,_,g) = (a,b,c,d,e,f,g)
updateReplOpts f (a,b,c,d,e,_,g) = (a,b,c,d,e,f,g)

projectEnvOpts (_,_,_,_,_,_,g) = g
updateEnvOpts g (a,b,c,d,e,f,_) = (a,b,c,d,e,f,g)
Expand Down
4 changes: 0 additions & 4 deletions cabal-install/Distribution/Client/CmdRun.hs
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,8 @@ import System.Directory
import System.FilePath
( (</>) )

<<<<<<< HEAD
runCommand :: CommandUI (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags)
=======

runCommand :: CommandUI (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags, TestFlags)
>>>>>>> Add 'TestFlags' to 'installCommand'
runCommand = Client.installCommand {
commandName = "new-run",
commandSynopsis = "Run an executable.",
Expand Down
15 changes: 11 additions & 4 deletions cabal-install/Distribution/Client/ProjectConfig/Legacy.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1046,11 +1046,15 @@ legacyPackageConfigFieldDescrs =
legacyTestFlags
(\flags conf -> conf { legacyTestFlags = flags })
. mapFieldNames
("test-"++)
. filterFields
[ "log", "machine-log", "show-details", "keep-tix-files"
, "test-options", "test-option"
prefixTest
. addFields
[ newLineListField "test-options"
(showTokenQ . fromPathTemplate) (fmap toPathTemplate parseTokenQ)
testOptions
(\v conf -> conf { testOptions = v })
]
. filterFields
[ "log", "machine-log", "show-details", "keep-tix-files" ]
. commandOptionsToFields
) (testOptions' ParseArgs)

Expand Down Expand Up @@ -1117,6 +1121,9 @@ legacyPackageConfigFieldDescrs =
caseWarning = PWarning $
"The '" ++ name ++ "' field is case sensitive, use 'True' or 'False'.")

prefixTest name | "test-" `isPrefixOf` name = name
| otherwise = "test-" ++ name


legacyPackageConfigSectionDescrs :: [SectionDescr LegacyProjectConfig]
legacyPackageConfigSectionDescrs =
Expand Down
2 changes: 1 addition & 1 deletion cabal-install/Distribution/Client/Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1869,7 +1869,7 @@ testOptions showOrParseArgs
| opt <- commandOptions Cabal.testCommand showOrParseArgs
, let name = optionName opt
, name `elem` ["log", "machine-log", "show-details", "keep-tix-files"
, "test-options", "test-option" ]
,"test-options", "test-option"]
]
where
prefixTest name | "test-" `isPrefixOf` name = name
Expand Down
1 change: 1 addition & 0 deletions cabal-install/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

2.6.0.0 (current development version)
* New solver flag: '--reject-unconstrained-dependencies'. (#2568)
* Ported old-style test options to the new-style commands (#5455).

2.4.0.0
* 'new-run' now allows the user to run scripts that use a special block
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ instance Arbitrary PackageConfig where
<*> arbitrary
<*> arbitrary
<*> arbitrary
<*> arbitrary
<*> shortListOf 5 arbitrary
where
arbitraryProgramName :: Gen String
arbitraryProgramName =
Expand Down

0 comments on commit d0d3415

Please sign in to comment.