File tree 4 files changed +23
-2
lines changed
Cabal/Distribution/Simple
PackageTests/NewHaddock/Fails
4 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -559,7 +559,9 @@ runHaddock verbosity tmpFileOpts comp platform haddockProg args
559
559
renderArgs verbosity tmpFileOpts haddockVersion comp platform args $
560
560
\ (flags,result)-> do
561
561
562
- runProgram verbosity haddockProg flags
562
+ haddockOut <- getProgramOutput verbosity haddockProg flags
563
+ unless (verbosity <= silent) $
564
+ putStr haddockOut
563
565
564
566
notice verbosity $ " Documentation created: " ++ result
565
567
Original file line number Diff line number Diff line change @@ -12,4 +12,13 @@ In order, the following will be built:
12
12
- example-1.0 (lib) (first run)
13
13
Preprocessing library for example-1.0..
14
14
Running Haddock on library for example-1.0..
15
+ cabal: '<HADDOCK>' exited with an error:
16
+
17
+ Example.hs:6:11: error:
18
+ • Couldn't match expected type ‘Int’ with actual type ‘Bool’
19
+ • In the expression: False
20
+ In an equation for ‘example’: example = False
21
+ |
22
+ 6 | example = False
23
+ | ^^^^^
15
24
cabal: Failed to build documentation for example-1.0-inplace.
Original file line number Diff line number Diff line change @@ -411,6 +411,10 @@ mkNormalizerEnv = do
411
411
list_out <- liftIO $ readProcess (programPath ghc_pkg_program)
412
412
[" list" , " --global" , " --simple-output" ] " "
413
413
tmpDir <- liftIO $ getTemporaryDirectory
414
+ haddock <- let prog = fromJust $ lookupKnownProgram " haddock" (testProgramDb env)
415
+ in fmap (fst . fromJust) $ liftIO $
416
+ programFindLocation prog (testVerbosity env)
417
+ [ProgramSearchPathDefault ]
414
418
return NormalizerEnv {
415
419
normalizerRoot
416
420
= addTrailingPathSeparator (testSourceDir env),
@@ -423,8 +427,12 @@ mkNormalizerEnv = do
423
427
normalizerKnownPackages
424
428
= mapMaybe simpleParse (words list_out),
425
429
normalizerPlatform
426
- = testPlatform env
430
+ = testPlatform env,
431
+ normalizerHaddock
432
+ = haddock
427
433
}
434
+ where
435
+
428
436
429
437
requireProgramM :: Program -> TestM ConfiguredProgram
430
438
requireProgramM program = do
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ normalizeOutput nenv =
33
33
. resub (posixRegexEscape (normalizerGblTmpDir nenv) ++ " [a-z0-9.-]+" ) " <GBLTMPDIR>" -- note, after TMPDIR
34
34
. resub (posixRegexEscape (normalizerRoot nenv)) " <ROOT>/"
35
35
. resub (posixRegexEscape (normalizerTmpDir nenv)) " <TMPDIR>/"
36
+ . resub (posixRegexEscape (normalizerHaddock nenv)) " <HADDOCK>"
36
37
. appEndo (F. fold (map (Endo . packageIdRegex) (normalizerKnownPackages nenv)))
37
38
-- Look for 0.1/installed-0d6uzW7Ubh1Fb4TB5oeQ3G
38
39
-- These installed packages will vary depending on GHC version
@@ -66,6 +67,7 @@ data NormalizerEnv = NormalizerEnv
66
67
, normalizerGhcVersion :: Version
67
68
, normalizerKnownPackages :: [PackageId ]
68
69
, normalizerPlatform :: Platform
70
+ , normalizerHaddock :: FilePath
69
71
}
70
72
71
73
posixSpecialChars :: [Char ]
You can’t perform that action at this time.
0 commit comments