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 Nov 12, 2018
1 parent e32b9d1 commit a06b3e3
Show file tree
Hide file tree
Showing 6 changed files with 18 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 @@ -179,7 +179,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 @@ -196,7 +196,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 @@ -1048,11 +1048,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 @@ -1119,6 +1123,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 @@ -1896,7 +1896,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
3 changes: 3 additions & 0 deletions cabal-install/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
no longer ignores all arguments except the last one (#5512).
* Add the following option aliases for '-dir'-suffixed options:
'storedir', 'logsdir', 'packagedir', 'sourcedir', 'outputdir' (#5484).
* 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
to define their requirements (as in the executable stanza) in place
of a target. This also allows the use of 'cabal' as an interpreter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ instance Arbitrary PackageConfig where
<*> arbitrary
<*> arbitrary
<*> arbitrary
<*> arbitrary
<*> shortListOf 5 arbitrary
where
arbitraryProgramName :: Gen String
arbitraryProgramName =
Expand Down

0 comments on commit a06b3e3

Please sign in to comment.