diff options
author | Yuras Shumovich <shumovichy@gmail.com> | 2017-01-20 16:53:45 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-01-20 16:55:36 -0500 |
commit | 15b9a85ef03e2729d487a6f8460be8880c797609 (patch) | |
tree | 401bc0e8f102c03ff61e7d8d967eefe4accd5960 /testsuite | |
parent | c43011da283bfcef664378bb451d5f3bffcdbe92 (diff) | |
download | haskell-15b9a85ef03e2729d487a6f8460be8880c797609.tar.gz |
Warn on missing home modules
Introduce a warning, -Wmissing-home-modules, to warn about home modules,
not listed in command line.
It is usefull for cabal when user fails to list a module in
`exposed-modules` and `other-modules`.
Test Plan: make TEST=MissingMod
Reviewers: mpickering, austin, bgamari
Reviewed By: bgamari
Subscribers: simonpj, mpickering, thomie
Differential Revision: https://phabricator.haskell.org/D2977
GHC Trac Issues: #13129
Diffstat (limited to 'testsuite')
4 files changed, 13 insertions, 0 deletions
diff --git a/testsuite/tests/warnings/should_compile/MissingMod.hs b/testsuite/tests/warnings/should_compile/MissingMod.hs new file mode 100644 index 0000000000..eaf7983c06 --- /dev/null +++ b/testsuite/tests/warnings/should_compile/MissingMod.hs @@ -0,0 +1,4 @@ +module MissingMod +where + +import MissingMod1 diff --git a/testsuite/tests/warnings/should_compile/MissingMod.stderr b/testsuite/tests/warnings/should_compile/MissingMod.stderr new file mode 100644 index 0000000000..0045092696 --- /dev/null +++ b/testsuite/tests/warnings/should_compile/MissingMod.stderr @@ -0,0 +1,5 @@ + +<no location info>: warning: [-Wmissing-home-modules] + Modules are not listed in command line: MissingMod1 +[1 of 2] Compiling MissingMod1 ( MissingMod1.hs, MissingMod1.o ) +[2 of 2] Compiling MissingMod ( MissingMod.hs, MissingMod.o ) diff --git a/testsuite/tests/warnings/should_compile/MissingMod1.hs b/testsuite/tests/warnings/should_compile/MissingMod1.hs new file mode 100644 index 0000000000..2e78c2311f --- /dev/null +++ b/testsuite/tests/warnings/should_compile/MissingMod1.hs @@ -0,0 +1,2 @@ +module MissingMod1 +where diff --git a/testsuite/tests/warnings/should_compile/all.T b/testsuite/tests/warnings/should_compile/all.T index bb347b065a..f7f0194011 100644 --- a/testsuite/tests/warnings/should_compile/all.T +++ b/testsuite/tests/warnings/should_compile/all.T @@ -24,3 +24,5 @@ test('DeprU', test('Werror01', normal, compile, ['']) test('Werror02', normal, compile, ['']) + +test('MissingMod', normal, multimod_compile, ['MissingMod', '-Wmissing-home-modules']) |