Skip to content

Commit 1a77d06

Browse files
Merge pull request #646 from TeofilC/wip/teo/testTargets
Change testTarget -> testTargets
2 parents 04e8308 + a28d127 commit 1a77d06

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

cabal2nix/src/Distribution/Nixpkgs/Haskell/Derivation.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
module Distribution.Nixpkgs.Haskell.Derivation
77
( Derivation, nullDerivation, pkgid, revision, src, subpath, isLibrary, isExecutable
88
, extraFunctionArgs, libraryDepends, executableDepends, testDepends, configureFlags
9-
, cabalFlags, runHaddock, jailbreak, doCheck, doBenchmark, testTarget, hyperlinkSource
9+
, cabalFlags, runHaddock, jailbreak, doCheck, doBenchmark, testTargets, hyperlinkSource
1010
, enableLibraryProfiling, enableExecutableProfiling, phaseOverrides, editedCabalFile, metaSection
1111
, dependencies, setupDepends, benchmarkDepends, enableSeparateDataOutput, extraAttributes
1212
)
@@ -56,7 +56,7 @@ data Derivation = MkDerivation
5656
, _jailbreak :: Bool
5757
, _doCheck :: Bool
5858
, _doBenchmark :: Bool
59-
, _testTarget :: String
59+
, _testTargets :: [String]
6060
, _hyperlinkSource :: Bool
6161
, _enableLibraryProfiling :: Bool
6262
, _enableExecutableProfiling :: Bool
@@ -88,7 +88,7 @@ nullDerivation = MkDerivation
8888
, _jailbreak = error "undefined Derivation.jailbreak"
8989
, _doCheck = error "undefined Derivation.doCheck"
9090
, _doBenchmark = error "undefined Derivation.doBenchmark"
91-
, _testTarget = error "undefined Derivation.testTarget"
91+
, _testTargets = error "undefined Derivation.testTargets"
9292
, _hyperlinkSource = error "undefined Derivation.hyperlinkSource"
9393
, _enableLibraryProfiling = error "undefined Derivation.enableLibraryProfiling"
9494
, _enableExecutableProfiling = error "undefined Derivation.enableExecutableProfiling"
@@ -132,7 +132,7 @@ instance Pretty Derivation where
132132
, boolattr "jailbreak" _jailbreak _jailbreak
133133
, boolattr "doCheck" (not _doCheck) _doCheck
134134
, boolattr "doBenchmark" _doBenchmark _doBenchmark
135-
, onlyIf (not (null _testTarget)) $ attr "testTarget" $ string _testTarget
135+
, onlyIf (not (null _testTargets)) $ listattr "testTargets" empty (map show _testTargets)
136136
, boolattr "hyperlinkSource" (not _hyperlinkSource) _hyperlinkSource
137137
, onlyIf (not (null _phaseOverrides)) $ vcat ((map text . lines) _phaseOverrides)
138138
, pPrint _metaSection

cabal2nix/src/Distribution/Nixpkgs/Haskell/FromCabal.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ fromPackageDescription haskellResolver nixpkgsResolver missingDeps flags Package
112112
& jailbreak .~ False
113113
& doCheck .~ True
114114
& doBenchmark .~ False
115-
& testTarget .~ mempty
115+
& testTargets .~ mempty
116116
& hyperlinkSource .~ True
117117
& enableLibraryProfiling .~ False
118118
& enableExecutableProfiling .~ False

cabal2nix/src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ hooks =
8989
, ("darcs", set phaseOverrides darcsInstallPostInstall . set doCheck False)
9090
, ("dbus", set doCheck False) -- don't execute tests that try to access the network
9191
, ("dhall", set doCheck False) -- attempts to access the network
92-
, ("dns", set testTarget "spec") -- don't execute tests that try to access the network
92+
, ("dns", set testTargets ["spec"]) -- don't execute tests that try to access the network
9393
, ("eventstore", set (metaSection . platforms) (Just $ Set.singleton (NixpkgsPlatformGroup (ident # "x86_64"))))
9494
, ("freenect < 1.2.1", over configureFlags (Set.union (Set.fromList ["--extra-include-dirs=${lib.getDev pkgs.freenect}/include/libfreenect", "--extra-lib-dirs=${lib.getLib pkgs.freenect}/lib"])))
9595
, ("fltkhs", set (libraryDepends . system . contains (pkg "fltk14")) True . over (libraryDepends . pkgconfig) (Set.union (pkgs ["libGLU", "libGL"]))) -- TODO: fltk14 belongs into the *setup* dependencies.
@@ -123,7 +123,7 @@ hooks =
123123
, ("hlibgit2 >= 0.18.0.14", set (testDepends . tool . contains (pkg "git")) True)
124124
, ("hmatrix < 0.18.1.1", set phaseOverrides "preConfigure = \"sed -i hmatrix.cabal -e '/\\\\/usr\\\\//D'\";")
125125
, ("holy-project", set doCheck False) -- attempts to access the network
126-
, ("hoogle", set testTarget "--test-option=--no-net")
126+
, ("hoogle", set testTargets ["--test-option=--no-net"])
127127
, ("hsignal < 0.2.7.4", set phaseOverrides "prePatch = \"rm -v Setup.lhs\";") -- https://github.com/amcphail/hsignal/issues/1
128128
, ("hslua < 0.9.3", over (libraryDepends . system) (replace (pkg "lua") (pkg "lua5_1")))
129129
, ("hslua >= 0.9.3 && < 2.0.0", over (libraryDepends . system) (replace (pkg "lua") (pkg "lua5_3")))
@@ -334,7 +334,7 @@ opencvOverrides = set phaseOverrides "hardeningDisable = [ \"bindnow\" ];"
334334
. over (libraryDepends . pkgconfig) (replace (pkg "opencv") (pkg "opencv3"))
335335

336336
hspecCoreOverrides :: Derivation -> Derivation -- https://github.com/hspec/hspec/issues/330
337-
hspecCoreOverrides = set phaseOverrides "testTarget = \"--test-option=--skip --test-option='Test.Hspec.Core.Runner.hspecResult runs specs in parallel'\";"
337+
hspecCoreOverrides = set phaseOverrides "testTargets = [ \"--test-option=--skip\" \"--test-option='Test.Hspec.Core.Runner.hspecResult runs specs in parallel'\" ];"
338338

339339
cabal2nixOverrides :: Derivation -> Derivation
340340
cabal2nixOverrides = set phaseOverrides $ unlines

cabal2nix/test/golden-test-cases/hoogle.nix.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ mkDerivation {
2323
warp-tls zlib
2424
];
2525
executableHaskellDepends = [ base ];
26-
testTarget = "--test-option=--no-net";
26+
testTargets = [ "--test-option=--no-net" ];
2727
homepage = "http://hoogle.haskell.org/";
2828
description = "Haskell API Search";
2929
license = lib.licenses.bsd3;

0 commit comments

Comments
 (0)