Merge pull request #10525 from 9999years/field-stanza-names
[cabal.git] / cabal-testsuite / PackageTests / Manpage / cabal.test.hs
blob68def2190708a8436b48ee710d91d3a7ce6f898a
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 and OSX.
11 unless (buildOS == Windows || buildOS ==OSX) $ 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