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.
11 "An 'autogen-module' is neither on 'exposed-modules' nor "
14 "On executable 'Exe' an 'autogen-module' is not on "
17 "On test suite 'Test' an 'autogen-module' is not on "
20 "On benchmark 'Bench' an 'autogen-module' is not on "
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.
43 "Could not find module: MyLibHelperModule with any suffix"
46 "module is autogenerated it should be added to 'autogen-modules'"