Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jasagredo committed Jul 15, 2024
1 parent cef49cd commit d1d698a
Show file tree
Hide file tree
Showing 45 changed files with 136 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -520,11 +520,11 @@ finalizePD
-- Combine lib, exes, and tests into one list of @CondTree@s with tagged data
condTrees =
maybeToList (fmap (mapTreeData Lib . appBounds) mb_lib0)
++ map (\(name, tree) -> mapTreeData (SubComp name . CLib) $ appBounds tree) sub_libs0
++ map (\(name, tree) -> mapTreeData (SubComp name . CFLib) $ appBounds tree) flibs0
++ map (\(name, tree) -> mapTreeData (SubComp name . CExe) $ appBounds tree) exes0
++ map (\(name, tree) -> mapTreeData (SubComp name . CTest) $ appBounds tree) tests0
++ map (\(name, tree) -> mapTreeData (SubComp name . CBench) $ appBounds tree) bms0
++ map (\(name, tree) -> mapTreeData (SubComp name . CLib) $ appBounds tree) sub_libs0
++ map (\(name, tree) -> mapTreeData (SubComp name . CFLib) $ appBounds tree) flibs0
++ map (\(name, tree) -> mapTreeData (SubComp name . CExe) $ appBounds tree) exes0
++ map (\(name, tree) -> mapTreeData (SubComp name . CTest) $ appBounds tree) tests0
++ map (\(name, tree) -> mapTreeData (SubComp name . CBench) $ appBounds tree) bms0

flagChoices = map (\(MkPackageFlag n _ d manual) -> (n, d2c manual n d)) flags
d2c manual n b = case lookupFlagAssignment n userflags of
Expand Down
6 changes: 3 additions & 3 deletions Cabal-syntax/src/Distribution/Types/DefaultBounds.hs
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ applyDefaultBoundsToCondTree
-> CondTree cv [Dependency] a
-> CondTree cv [Dependency] a
applyDefaultBoundsToCondTree db =
mapTreeData (applyDefaultBoundsToBuildInfo db)
. mapTreeConstrs (applyDefaultBoundsToDependencies db)
mapTreeData (applyDefaultBoundsToBuildInfo db)
. mapTreeConstrs (applyDefaultBoundsToDependencies db)

applyDefaultBoundsToBuildInfo :: L.HasBuildInfo a => DefaultBounds -> a -> a
applyDefaultBoundsToBuildInfo db bi =
bi
& L.targetBuildDepends %~ applyDefaultBoundsToDependencies db
& L.buildToolDepends %~ applyDefaultBoundsToExeDependencies db
& L.buildToolDepends %~ applyDefaultBoundsToExeDependencies db

applyDefaultBoundsToDependencies :: DefaultBounds -> [Dependency] -> [Dependency]
applyDefaultBoundsToDependencies (DefaultBounds [] _) = id
Expand Down
4 changes: 3 additions & 1 deletion Cabal-tests/tests/ParserTests/regressions/Octree-0.5.expr
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ GenericPackageDescription {
gpdScannedVersion = Nothing,
genPackageFlags = [],
genDefaultPackageBounds =
Nothing,
DefaultBounds {
defaultTargetBuildDepends = [],
defaultBuildToolDepends = []},
condLibrary = Just
CondNode {
condTreeData = Library {
Expand Down
4 changes: 3 additions & 1 deletion Cabal-tests/tests/ParserTests/regressions/anynone.expr
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ GenericPackageDescription {
gpdScannedVersion = Nothing,
genPackageFlags = [],
genDefaultPackageBounds =
Nothing,
DefaultBounds {
defaultTargetBuildDepends = [],
defaultBuildToolDepends = []},
condLibrary = Just
CondNode {
condTreeData = Library {
Expand Down
4 changes: 3 additions & 1 deletion Cabal-tests/tests/ParserTests/regressions/big-version.expr
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ GenericPackageDescription {
gpdScannedVersion = Nothing,
genPackageFlags = [],
genDefaultPackageBounds =
Nothing,
DefaultBounds {
defaultTargetBuildDepends = [],
defaultBuildToolDepends = []},
condLibrary = Just
CondNode {
condTreeData = Library {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ GenericPackageDescription {
flagDefault = True,
flagManual = True}],
genDefaultPackageBounds =
Nothing,
DefaultBounds {
defaultTargetBuildDepends = [],
defaultBuildToolDepends = []},
condLibrary = Just
CondNode {
condTreeData = Library {
Expand Down
4 changes: 3 additions & 1 deletion Cabal-tests/tests/ParserTests/regressions/common.expr
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ GenericPackageDescription {
gpdScannedVersion = Nothing,
genPackageFlags = [],
genDefaultPackageBounds =
Nothing,
DefaultBounds {
defaultTargetBuildDepends = [],
defaultBuildToolDepends = []},
condLibrary = Just
CondNode {
condTreeData = Library {
Expand Down
4 changes: 3 additions & 1 deletion Cabal-tests/tests/ParserTests/regressions/common2.expr
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ GenericPackageDescription {
gpdScannedVersion = Nothing,
genPackageFlags = [],
genDefaultPackageBounds =
Nothing,
DefaultBounds {
defaultTargetBuildDepends = [],
defaultBuildToolDepends = []},
condLibrary = Just
CondNode {
condTreeData = Library {
Expand Down
4 changes: 3 additions & 1 deletion Cabal-tests/tests/ParserTests/regressions/common3.expr
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ GenericPackageDescription {
gpdScannedVersion = Nothing,
genPackageFlags = [],
genDefaultPackageBounds =
Nothing,
DefaultBounds {
defaultTargetBuildDepends = [],
defaultBuildToolDepends = []},
condLibrary = Just
CondNode {
condTreeData = Library {
Expand Down
4 changes: 3 additions & 1 deletion Cabal-tests/tests/ParserTests/regressions/elif.expr
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ GenericPackageDescription {
gpdScannedVersion = Nothing,
genPackageFlags = [],
genDefaultPackageBounds =
Nothing,
DefaultBounds {
defaultTargetBuildDepends = [],
defaultBuildToolDepends = []},
condLibrary = Just
CondNode {
condTreeData = Library {
Expand Down
4 changes: 3 additions & 1 deletion Cabal-tests/tests/ParserTests/regressions/elif2.expr
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ GenericPackageDescription {
gpdScannedVersion = Nothing,
genPackageFlags = [],
genDefaultPackageBounds =
Nothing,
DefaultBounds {
defaultTargetBuildDepends = [],
defaultBuildToolDepends = []},
condLibrary = Just
CondNode {
condTreeData = Library {
Expand Down
4 changes: 3 additions & 1 deletion Cabal-tests/tests/ParserTests/regressions/encoding-0.8.expr
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ GenericPackageDescription {
gpdScannedVersion = Nothing,
genPackageFlags = [],
genDefaultPackageBounds =
Nothing,
DefaultBounds {
defaultTargetBuildDepends = [],
defaultBuildToolDepends = []},
condLibrary = Just
CondNode {
condTreeData = Library {
Expand Down
4 changes: 3 additions & 1 deletion Cabal-tests/tests/ParserTests/regressions/generics-sop.expr
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ GenericPackageDescription {
gpdScannedVersion = Nothing,
genPackageFlags = [],
genDefaultPackageBounds =
Nothing,
DefaultBounds {
defaultTargetBuildDepends = [],
defaultBuildToolDepends = []},
condLibrary = Just
CondNode {
condTreeData = Library {
Expand Down
4 changes: 3 additions & 1 deletion Cabal-tests/tests/ParserTests/regressions/hasktorch.expr
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ GenericPackageDescription {
flagDefault = False,
flagManual = False}],
genDefaultPackageBounds =
Nothing,
DefaultBounds {
defaultTargetBuildDepends = [],
defaultBuildToolDepends = []},
condLibrary = Just
CondNode {
condTreeData = Library {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ GenericPackageDescription {
gpdScannedVersion = Nothing,
genPackageFlags = [],
genDefaultPackageBounds =
Nothing,
DefaultBounds {
defaultTargetBuildDepends = [],
defaultBuildToolDepends = []},
condLibrary = Just
CondNode {
condTreeData = Library {
Expand Down
4 changes: 3 additions & 1 deletion Cabal-tests/tests/ParserTests/regressions/indentation.expr
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ GenericPackageDescription {
gpdScannedVersion = Nothing,
genPackageFlags = [],
genDefaultPackageBounds =
Nothing,
DefaultBounds {
defaultTargetBuildDepends = [],
defaultBuildToolDepends = []},
condLibrary = Just
CondNode {
condTreeData = Library {
Expand Down
4 changes: 3 additions & 1 deletion Cabal-tests/tests/ParserTests/regressions/indentation2.expr
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ GenericPackageDescription {
gpdScannedVersion = Nothing,
genPackageFlags = [],
genDefaultPackageBounds =
Nothing,
DefaultBounds {
defaultTargetBuildDepends = [],
defaultBuildToolDepends = []},
condLibrary = Just
CondNode {
condTreeData = Library {
Expand Down
4 changes: 3 additions & 1 deletion Cabal-tests/tests/ParserTests/regressions/indentation3.expr
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ GenericPackageDescription {
gpdScannedVersion = Nothing,
genPackageFlags = [],
genDefaultPackageBounds =
Nothing,
DefaultBounds {
defaultTargetBuildDepends = [],
defaultBuildToolDepends = []},
condLibrary = Just
CondNode {
condTreeData = Library {
Expand Down
4 changes: 3 additions & 1 deletion Cabal-tests/tests/ParserTests/regressions/issue-5055.expr
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ GenericPackageDescription {
gpdScannedVersion = Nothing,
genPackageFlags = [],
genDefaultPackageBounds =
Nothing,
DefaultBounds {
defaultTargetBuildDepends = [],
defaultBuildToolDepends = []},
condLibrary = Nothing,
condSubLibraries = [],
condForeignLibs = [],
Expand Down
4 changes: 3 additions & 1 deletion Cabal-tests/tests/ParserTests/regressions/issue-5846.expr
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ GenericPackageDescription {
gpdScannedVersion = Nothing,
genPackageFlags = [],
genDefaultPackageBounds =
Nothing,
DefaultBounds {
defaultTargetBuildDepends = [],
defaultBuildToolDepends = []},
condLibrary = Just
CondNode {
condTreeData = Library {
Expand Down
4 changes: 3 additions & 1 deletion Cabal-tests/tests/ParserTests/regressions/issue-6083-a.expr
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ GenericPackageDescription {
gpdScannedVersion = Nothing,
genPackageFlags = [],
genDefaultPackageBounds =
Nothing,
DefaultBounds {
defaultTargetBuildDepends = [],
defaultBuildToolDepends = []},
condLibrary = Just
CondNode {
condTreeData = Library {
Expand Down
4 changes: 3 additions & 1 deletion Cabal-tests/tests/ParserTests/regressions/issue-6083-b.expr
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ GenericPackageDescription {
gpdScannedVersion = Nothing,
genPackageFlags = [],
genDefaultPackageBounds =
Nothing,
DefaultBounds {
defaultTargetBuildDepends = [],
defaultBuildToolDepends = []},
condLibrary = Just
CondNode {
condTreeData = Library {
Expand Down
4 changes: 3 additions & 1 deletion Cabal-tests/tests/ParserTests/regressions/issue-6083-c.expr
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ GenericPackageDescription {
gpdScannedVersion = Nothing,
genPackageFlags = [],
genDefaultPackageBounds =
Nothing,
DefaultBounds {
defaultTargetBuildDepends = [],
defaultBuildToolDepends = []},
condLibrary = Just
CondNode {
condTreeData = Library {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ GenericPackageDescription {
gpdScannedVersion = Nothing,
genPackageFlags = [],
genDefaultPackageBounds =
Nothing,
DefaultBounds {
defaultTargetBuildDepends = [],
defaultBuildToolDepends = []},
condLibrary = Just
CondNode {
condTreeData = Library {
Expand Down
4 changes: 3 additions & 1 deletion Cabal-tests/tests/ParserTests/regressions/issue-774.expr
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ GenericPackageDescription {
gpdScannedVersion = Nothing,
genPackageFlags = [],
genDefaultPackageBounds =
Nothing,
DefaultBounds {
defaultTargetBuildDepends = [],
defaultBuildToolDepends = []},
condLibrary = Just
CondNode {
condTreeData = Library {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ GenericPackageDescription {
gpdScannedVersion = Nothing,
genPackageFlags = [],
genDefaultPackageBounds =
Nothing,
DefaultBounds {
defaultTargetBuildDepends = [],
defaultBuildToolDepends = []},
condLibrary = Just
CondNode {
condTreeData = Library {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ GenericPackageDescription {
gpdScannedVersion = Nothing,
genPackageFlags = [],
genDefaultPackageBounds =
Nothing,
DefaultBounds {
defaultTargetBuildDepends = [],
defaultBuildToolDepends = []},
condLibrary = Just
CondNode {
condTreeData = Library {
Expand Down
4 changes: 3 additions & 1 deletion Cabal-tests/tests/ParserTests/regressions/leading-comma.expr
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ GenericPackageDescription {
gpdScannedVersion = Nothing,
genPackageFlags = [],
genDefaultPackageBounds =
Nothing,
DefaultBounds {
defaultTargetBuildDepends = [],
defaultBuildToolDepends = []},
condLibrary = Just
CondNode {
condTreeData = Library {
Expand Down
4 changes: 3 additions & 1 deletion Cabal-tests/tests/ParserTests/regressions/libpq1.expr
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ GenericPackageDescription {
flagDefault = False,
flagManual = True}],
genDefaultPackageBounds =
Nothing,
DefaultBounds {
defaultTargetBuildDepends = [],
defaultBuildToolDepends = []},
condLibrary = Just
CondNode {
condTreeData = Library {
Expand Down
4 changes: 3 additions & 1 deletion Cabal-tests/tests/ParserTests/regressions/libpq2.expr
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ GenericPackageDescription {
flagDefault = False,
flagManual = True}],
genDefaultPackageBounds =
Nothing,
DefaultBounds {
defaultTargetBuildDepends = [],
defaultBuildToolDepends = []},
condLibrary = Just
CondNode {
condTreeData = Library {
Expand Down
4 changes: 3 additions & 1 deletion Cabal-tests/tests/ParserTests/regressions/mixin-1.expr
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ GenericPackageDescription {
gpdScannedVersion = Nothing,
genPackageFlags = [],
genDefaultPackageBounds =
Nothing,
DefaultBounds {
defaultTargetBuildDepends = [],
defaultBuildToolDepends = []},
condLibrary = Nothing,
condSubLibraries = [],
condForeignLibs = [],
Expand Down
4 changes: 3 additions & 1 deletion Cabal-tests/tests/ParserTests/regressions/mixin-2.expr
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ GenericPackageDescription {
gpdScannedVersion = Nothing,
genPackageFlags = [],
genDefaultPackageBounds =
Nothing,
DefaultBounds {
defaultTargetBuildDepends = [],
defaultBuildToolDepends = []},
condLibrary = Nothing,
condSubLibraries = [],
condForeignLibs = [],
Expand Down
4 changes: 3 additions & 1 deletion Cabal-tests/tests/ParserTests/regressions/mixin-3.expr
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ GenericPackageDescription {
gpdScannedVersion = Nothing,
genPackageFlags = [],
genDefaultPackageBounds =
Nothing,
DefaultBounds {
defaultTargetBuildDepends = [],
defaultBuildToolDepends = []},
condLibrary = Nothing,
condSubLibraries = [],
condForeignLibs = [],
Expand Down
4 changes: 3 additions & 1 deletion Cabal-tests/tests/ParserTests/regressions/monad-param.expr
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ GenericPackageDescription {
gpdScannedVersion = Nothing,
genPackageFlags = [],
genDefaultPackageBounds =
Nothing,
DefaultBounds {
defaultTargetBuildDepends = [],
defaultBuildToolDepends = []},
condLibrary = Just
CondNode {
condTreeData = Library {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ GenericPackageDescription {
gpdScannedVersion = Nothing,
genPackageFlags = [],
genDefaultPackageBounds =
Nothing,
DefaultBounds {
defaultTargetBuildDepends = [],
defaultBuildToolDepends = []},
condLibrary = Just
CondNode {
condTreeData = Library {
Expand Down
Loading

0 comments on commit d1d698a

Please sign in to comment.