Improve online docs for `includes:` field
[cabal.git] / cabal-testsuite / PackageTests / AutogenModules / Package / setup.test.hs
blob12fb98233093dbb2dd5bcceb79f2e45dc5e46c03
1 import Test.Cabal.Prelude
3 -- Test that setup shows all the 'autogen-modules' warnings.
4 main = setupAndCabalTest $ do
6 configureResult <- fails $ setup' "configure" []
7 sdistResult <- fails $ setup' "sdist" []
9 -- Package check messages.
10 let libAutogenMsg =
11 "An 'autogen-module' is neither on 'exposed-modules' nor "
12 ++ "'other-modules'"
13 let exeAutogenMsg =
14 "On executable 'Exe' an 'autogen-module' is not on "
15 ++ "'other-modules'"
16 let testAutogenMsg =
17 "On test suite 'Test' an 'autogen-module' is not on "
18 ++ "'other-modules'"
19 let benchAutogenMsg =
20 "On benchmark 'Bench' an 'autogen-module' is not on "
21 ++ "'other-modules'"
22 let pathsAutogenMsg =
23 "Packages using 'cabal-version: 2.0' and the autogenerated"
25 -- Asserts for the desired check messages after configure.
26 assertOutputContains libAutogenMsg configureResult
27 assertOutputContains exeAutogenMsg configureResult
28 assertOutputContains testAutogenMsg configureResult
29 assertOutputContains benchAutogenMsg configureResult
31 -- Asserts for the desired check messages after sdist.
32 assertOutputContains "Distribution quality errors:" sdistResult
33 assertOutputContains libAutogenMsg sdistResult
34 assertOutputContains exeAutogenMsg sdistResult
35 assertOutputContains testAutogenMsg sdistResult
36 assertOutputContains benchAutogenMsg sdistResult
37 assertOutputContains pathsAutogenMsg sdistResult
38 -- Asserts for the undesired check messages after sdist.
39 assertOutputDoesNotContain "Distribution quality warnings:" sdistResult
41 -- Asserts for the error messages of the modules not found.
42 assertOutputContains
43 "Could not find module: MyLibHelperModule with any suffix"
44 sdistResult
45 assertOutputContains
46 "module is autogenerated it should be added to 'autogen-modules'"
47 sdistResult
49 return ()