Add “Ignore warning” option to cabal check
[cabal.git] / cabal-testsuite / PackageTests / Manpage / cabal.test.hs
blob6b19fa4d7ce768a854d5fd3112356efd24b8df8d
1 import System.Process
2 import Distribution.System (OS(Windows,Linux,OSX), buildOS)
3 import Test.Cabal.Prelude
5 main = cabalTest $ do
6 r <- cabal' "man" ["--raw"]
7 assertOutputContains ".B cabal install" r
8 assertOutputDoesNotContain ".B cabal manpage" r
10 -- The following test of `cabal man` needs `nroff` which is not available under Windows.
11 unless (buildOS == Windows) $ do
13 -- Check that output of `cabal man --raw` can be passed through `nroff -man`
14 -- without producing any warnings (which are printed to stderr).
16 -- NB: runM is not suitable as it mixes stdout and stderr
17 -- r2 <- runM "nroff" ["-man", "/dev/stdin"] $ Just $ resultOutput r
18 (ec, _output, errors) <- liftIO $
19 readProcessWithExitCode "nroff" ["-man", "/dev/stdin"] $ resultOutput r
20 unless (null errors) $
21 assertFailure $ unlines
22 [ "Error: unexpected warnings produced by `nroff -man`:"
23 , errors