summaryrefslogtreecommitdiff
path: root/testsuite/tests/warnings
diff options
context:
space:
mode:
authorHerbert Valerio Riedel <hvr@gnu.org>2017-05-22 11:59:56 -0400
committerBen Gamari <ben@smart-cactus.org>2017-05-22 12:41:20 -0400
commitdac49bdc79387ca9f91c7c5c9220699efb6239fb (patch)
treedb91e9dea573a30636ca0a75687cd9738ccde0bf /testsuite/tests/warnings
parent83ee930fdd125d74939307ed3fa1bf6a2ba7fb36 (diff)
downloadhaskell-dac49bdc79387ca9f91c7c5c9220699efb6239fb.tar.gz
Handle file targets in missing home modules warning
When main module is listed on command line as a file, we should not issue a warning about it. See Trac #13727 Reviewers: austin, bgamari, Yuras Reviewed By: bgamari, Yuras Subscribers: 23Skidoo, rwbarton, thomie GHC Trac Issues: #13727 Differential Revision: https://phabricator.haskell.org/D3598
Diffstat (limited to 'testsuite/tests/warnings')
-rw-r--r--testsuite/tests/warnings/should_compile/T13727/Makefile3
-rw-r--r--testsuite/tests/warnings/should_compile/T13727/T13727a.stderr6
-rw-r--r--testsuite/tests/warnings/should_compile/T13727/T13727b.stderr6
-rw-r--r--testsuite/tests/warnings/should_compile/T13727/T13727c.stderr3
-rw-r--r--testsuite/tests/warnings/should_compile/T13727/T13727d.stderr3
-rw-r--r--testsuite/tests/warnings/should_compile/T13727/T13727e.stderr3
-rw-r--r--testsuite/tests/warnings/should_compile/T13727/T13727f.stderr7
-rw-r--r--testsuite/tests/warnings/should_compile/T13727/T13727g.stderr7
-rw-r--r--testsuite/tests/warnings/should_compile/T13727/T13727h.stderr7
-rw-r--r--testsuite/tests/warnings/should_compile/T13727/T13727i.stderr7
-rw-r--r--testsuite/tests/warnings/should_compile/T13727/T13727j.stderr7
-rw-r--r--testsuite/tests/warnings/should_compile/T13727/T13727k.stderr4
-rw-r--r--testsuite/tests/warnings/should_compile/T13727/all.T20
-rw-r--r--testsuite/tests/warnings/should_compile/T13727/src-exe/AltMain.hs6
-rw-r--r--testsuite/tests/warnings/should_compile/T13727/src-exe/Main.hs6
-rw-r--r--testsuite/tests/warnings/should_compile/T13727/src-lib/M1.hs1
16 files changed, 96 insertions, 0 deletions
diff --git a/testsuite/tests/warnings/should_compile/T13727/Makefile b/testsuite/tests/warnings/should_compile/T13727/Makefile
new file mode 100644
index 0000000000..1c39d1c1fe
--- /dev/null
+++ b/testsuite/tests/warnings/should_compile/T13727/Makefile
@@ -0,0 +1,3 @@
+TOP=../../../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
diff --git a/testsuite/tests/warnings/should_compile/T13727/T13727a.stderr b/testsuite/tests/warnings/should_compile/T13727/T13727a.stderr
new file mode 100644
index 0000000000..64ad6d2895
--- /dev/null
+++ b/testsuite/tests/warnings/should_compile/T13727/T13727a.stderr
@@ -0,0 +1,6 @@
+
+<no location info>: warning: [-Wmissing-home-modules]
+ Modules are not listed in command line: M1
+[1 of 2] Compiling M1 ( src-lib/M1.hs, src-lib/M1.o )
+[2 of 2] Compiling Main ( src-exe/Main.hs, src-exe/Main.o )
+Linking src-exe/Main ...
diff --git a/testsuite/tests/warnings/should_compile/T13727/T13727b.stderr b/testsuite/tests/warnings/should_compile/T13727/T13727b.stderr
new file mode 100644
index 0000000000..64ad6d2895
--- /dev/null
+++ b/testsuite/tests/warnings/should_compile/T13727/T13727b.stderr
@@ -0,0 +1,6 @@
+
+<no location info>: warning: [-Wmissing-home-modules]
+ Modules are not listed in command line: M1
+[1 of 2] Compiling M1 ( src-lib/M1.hs, src-lib/M1.o )
+[2 of 2] Compiling Main ( src-exe/Main.hs, src-exe/Main.o )
+Linking src-exe/Main ...
diff --git a/testsuite/tests/warnings/should_compile/T13727/T13727c.stderr b/testsuite/tests/warnings/should_compile/T13727/T13727c.stderr
new file mode 100644
index 0000000000..0b9ac0ebf2
--- /dev/null
+++ b/testsuite/tests/warnings/should_compile/T13727/T13727c.stderr
@@ -0,0 +1,3 @@
+[1 of 2] Compiling M1 ( src-lib/M1.hs, src-lib/M1.o )
+[2 of 2] Compiling Main ( src-exe/Main.hs, src-exe/Main.o )
+Linking src-exe/Main ...
diff --git a/testsuite/tests/warnings/should_compile/T13727/T13727d.stderr b/testsuite/tests/warnings/should_compile/T13727/T13727d.stderr
new file mode 100644
index 0000000000..0b9ac0ebf2
--- /dev/null
+++ b/testsuite/tests/warnings/should_compile/T13727/T13727d.stderr
@@ -0,0 +1,3 @@
+[1 of 2] Compiling M1 ( src-lib/M1.hs, src-lib/M1.o )
+[2 of 2] Compiling Main ( src-exe/Main.hs, src-exe/Main.o )
+Linking src-exe/Main ...
diff --git a/testsuite/tests/warnings/should_compile/T13727/T13727e.stderr b/testsuite/tests/warnings/should_compile/T13727/T13727e.stderr
new file mode 100644
index 0000000000..0b9ac0ebf2
--- /dev/null
+++ b/testsuite/tests/warnings/should_compile/T13727/T13727e.stderr
@@ -0,0 +1,3 @@
+[1 of 2] Compiling M1 ( src-lib/M1.hs, src-lib/M1.o )
+[2 of 2] Compiling Main ( src-exe/Main.hs, src-exe/Main.o )
+Linking src-exe/Main ...
diff --git a/testsuite/tests/warnings/should_compile/T13727/T13727f.stderr b/testsuite/tests/warnings/should_compile/T13727/T13727f.stderr
new file mode 100644
index 0000000000..35bfae84a7
--- /dev/null
+++ b/testsuite/tests/warnings/should_compile/T13727/T13727f.stderr
@@ -0,0 +1,7 @@
+
+<no location info>: warning: [-Wmissing-home-modules]
+ Modules are not listed in command line: M1 Main
+[1 of 3] Compiling M1 ( src-lib/M1.hs, src-lib/M1.o )
+[2 of 3] Compiling Main ( src-exe/Main.hs, src-exe/Main.o )
+[3 of 3] Compiling AltMain ( src-exe/AltMain.hs, src-exe/AltMain.o )
+Linking src-exe/AltMain ...
diff --git a/testsuite/tests/warnings/should_compile/T13727/T13727g.stderr b/testsuite/tests/warnings/should_compile/T13727/T13727g.stderr
new file mode 100644
index 0000000000..35bfae84a7
--- /dev/null
+++ b/testsuite/tests/warnings/should_compile/T13727/T13727g.stderr
@@ -0,0 +1,7 @@
+
+<no location info>: warning: [-Wmissing-home-modules]
+ Modules are not listed in command line: M1 Main
+[1 of 3] Compiling M1 ( src-lib/M1.hs, src-lib/M1.o )
+[2 of 3] Compiling Main ( src-exe/Main.hs, src-exe/Main.o )
+[3 of 3] Compiling AltMain ( src-exe/AltMain.hs, src-exe/AltMain.o )
+Linking src-exe/AltMain ...
diff --git a/testsuite/tests/warnings/should_compile/T13727/T13727h.stderr b/testsuite/tests/warnings/should_compile/T13727/T13727h.stderr
new file mode 100644
index 0000000000..1832b38432
--- /dev/null
+++ b/testsuite/tests/warnings/should_compile/T13727/T13727h.stderr
@@ -0,0 +1,7 @@
+
+<no location info>: warning: [-Wmissing-home-modules]
+ Modules are not listed in command line: M1
+[1 of 3] Compiling M1 ( src-lib/M1.hs, src-lib/M1.o )
+[2 of 3] Compiling Main ( src-exe/Main.hs, src-exe/Main.o )
+[3 of 3] Compiling AltMain ( src-exe/AltMain.hs, src-exe/AltMain.o )
+Linking src-exe/AltMain ...
diff --git a/testsuite/tests/warnings/should_compile/T13727/T13727i.stderr b/testsuite/tests/warnings/should_compile/T13727/T13727i.stderr
new file mode 100644
index 0000000000..1832b38432
--- /dev/null
+++ b/testsuite/tests/warnings/should_compile/T13727/T13727i.stderr
@@ -0,0 +1,7 @@
+
+<no location info>: warning: [-Wmissing-home-modules]
+ Modules are not listed in command line: M1
+[1 of 3] Compiling M1 ( src-lib/M1.hs, src-lib/M1.o )
+[2 of 3] Compiling Main ( src-exe/Main.hs, src-exe/Main.o )
+[3 of 3] Compiling AltMain ( src-exe/AltMain.hs, src-exe/AltMain.o )
+Linking src-exe/AltMain ...
diff --git a/testsuite/tests/warnings/should_compile/T13727/T13727j.stderr b/testsuite/tests/warnings/should_compile/T13727/T13727j.stderr
new file mode 100644
index 0000000000..f6d3197f01
--- /dev/null
+++ b/testsuite/tests/warnings/should_compile/T13727/T13727j.stderr
@@ -0,0 +1,7 @@
+
+<no location info>: warning: [-Wmissing-home-modules]
+ Modules are not listed in command line: Main
+[1 of 3] Compiling M1 ( src-lib/M1.hs, src-lib/M1.o )
+[2 of 3] Compiling Main ( src-exe/Main.hs, src-exe/Main.o )
+[3 of 3] Compiling AltMain ( src-exe/AltMain.hs, src-exe/AltMain.o )
+Linking src-exe/AltMain ...
diff --git a/testsuite/tests/warnings/should_compile/T13727/T13727k.stderr b/testsuite/tests/warnings/should_compile/T13727/T13727k.stderr
new file mode 100644
index 0000000000..c648d9b593
--- /dev/null
+++ b/testsuite/tests/warnings/should_compile/T13727/T13727k.stderr
@@ -0,0 +1,4 @@
+[1 of 3] Compiling M1 ( src-lib/M1.hs, src-lib/M1.o )
+[2 of 3] Compiling Main ( src-exe/Main.hs, src-exe/Main.o )
+[3 of 3] Compiling AltMain ( src-exe/AltMain.hs, src-exe/AltMain.o )
+Linking src-exe/AltMain ...
diff --git a/testsuite/tests/warnings/should_compile/T13727/all.T b/testsuite/tests/warnings/should_compile/T13727/all.T
new file mode 100644
index 0000000000..1ca91bded7
--- /dev/null
+++ b/testsuite/tests/warnings/should_compile/T13727/all.T
@@ -0,0 +1,20 @@
+# basic tests
+## complains about M1 only
+test('T13727a', [extra_files(['src-exe/','src-lib/'])], multimod_compile, ['Main', '-isrc-exe -isrc-lib -Wmissing-home-modules'])
+test('T13727b', [extra_files(['src-exe/','src-lib/'])], multimod_compile, ['src-exe/Main.hs', '-isrc-lib -Wmissing-home-modules'])
+## warning-free
+test('T13727c', [extra_files(['src-exe/','src-lib/'])], multimod_compile, ['Main', 'M1 -isrc-exe -isrc-lib -Wmissing-home-modules'])
+test('T13727d', [extra_files(['src-exe/','src-lib/'])], multimod_compile, ['src-exe/Main.hs', 'M1 -isrc-lib -Wmissing-home-modules'])
+test('T13727e', [extra_files(['src-exe/','src-lib/'])], multimod_compile, ['src-exe/Main.hs', 'src-lib/M1.hs -Wmissing-home-modules'])
+
+# tests involving -main-is
+## complains about M1 & Main
+test('T13727f', [extra_files(['src-exe/','src-lib/'])], multimod_compile, ['AltMain', '-main-is AltMain.alt_main -isrc-exe -isrc-lib -Wmissing-home-modules'])
+test('T13727g', [extra_files(['src-exe/','src-lib/'])], multimod_compile, ['src-exe/AltMain.hs', '-main-is AltMain.alt_main -isrc-exe -isrc-lib -Wmissing-home-modules'])
+## complains about M1 only
+test('T13727h', [extra_files(['src-exe/','src-lib/'])], multimod_compile, ['src-exe/AltMain.hs', '-main-is AltMain.alt_main ./src-exe/Main.hs -isrc-exe -isrc-lib -Wmissing-home-modules'])
+test('T13727i', [extra_files(['src-exe/','src-lib/'])], multimod_compile, ['AltMain', '-main-is AltMain.alt_main Main -isrc-exe -isrc-lib -Wmissing-home-modules'])
+## complains about Main only
+test('T13727j', [extra_files(['src-exe/','src-lib/'])], multimod_compile, ['AltMain', '-main-is AltMain.alt_main M1 -isrc-exe -isrc-lib -Wmissing-home-modules'])
+## warning-free
+test('T13727k', [extra_files(['src-exe/','src-lib/'])], multimod_compile, ['AltMain', '-main-is AltMain.alt_main M1 Main -isrc-exe -isrc-lib -Wmissing-home-modules'])
diff --git a/testsuite/tests/warnings/should_compile/T13727/src-exe/AltMain.hs b/testsuite/tests/warnings/should_compile/T13727/src-exe/AltMain.hs
new file mode 100644
index 0000000000..850ae96f33
--- /dev/null
+++ b/testsuite/tests/warnings/should_compile/T13727/src-exe/AltMain.hs
@@ -0,0 +1,6 @@
+module AltMain(alt_main) where
+
+import Main
+
+alt_main :: IO ()
+alt_main = Main.main
diff --git a/testsuite/tests/warnings/should_compile/T13727/src-exe/Main.hs b/testsuite/tests/warnings/should_compile/T13727/src-exe/Main.hs
new file mode 100644
index 0000000000..0394c57d98
--- /dev/null
+++ b/testsuite/tests/warnings/should_compile/T13727/src-exe/Main.hs
@@ -0,0 +1,6 @@
+module Main(main) where
+
+import M1 ()
+
+main :: IO ()
+main = return ()
diff --git a/testsuite/tests/warnings/should_compile/T13727/src-lib/M1.hs b/testsuite/tests/warnings/should_compile/T13727/src-lib/M1.hs
new file mode 100644
index 0000000000..5d99c370b0
--- /dev/null
+++ b/testsuite/tests/warnings/should_compile/T13727/src-lib/M1.hs
@@ -0,0 +1 @@
+module M1 where