diff --git a/cabal-install/tests/UnitTests/Distribution/Client/Init/Golden.hs b/cabal-install/tests/UnitTests/Distribution/Client/Init/Golden.hs
index 6c90582e7ffb56d4dc3038b4b29d6452bcdfd995..faa9be382b31e975aae1dbf1e898b28cc36ce1d7 100644
--- a/cabal-install/tests/UnitTests/Distribution/Client/Init/Golden.hs
+++ b/cabal-install/tests/UnitTests/Distribution/Client/Init/Golden.hs
@@ -271,24 +271,27 @@ goldenCabalTests v pkgIx srcDb = testGroup ".cabal file golden tests"
 
         (Right (ProjectSettings opts pkgDesc (Just libTarget) (Just exeTarget) (Just testTarget), _)) -> do
           let pkgFields = mkPkgDescription opts pkgDesc
+              commonStanza = mkCommonStanza opts
               libStanza  = mkLibStanza  opts $ libTarget {_libDependencies  = mangleBaseDep libTarget  _libDependencies}
               exeStanza  = mkExeStanza  opts $ exeTarget {_exeDependencies  = mangleBaseDep exeTarget  _exeDependencies}
               testStanza = mkTestStanza opts $ testTarget {_testDependencies = mangleBaseDep testTarget _testDependencies}
 
-          mkStanza $ pkgFields ++ [libStanza, exeStanza, testStanza]
+          mkStanza $ pkgFields ++ [commonStanza, libStanza, exeStanza, testStanza]
 
         (Right (ProjectSettings opts pkgDesc (Just libTarget) Nothing (Just testTarget), _)) -> do
           let pkgFields = mkPkgDescription opts pkgDesc
+              commonStanza = mkCommonStanza opts
               libStanza  = mkLibStanza  opts $ libTarget  {_libDependencies  = mangleBaseDep libTarget  _libDependencies}
               testStanza = mkTestStanza opts $ testTarget {_testDependencies = mangleBaseDep testTarget _testDependencies}
 
-          mkStanza $ pkgFields ++ [libStanza, testStanza]
+          mkStanza $ pkgFields ++ [commonStanza, libStanza, testStanza]
         
         (Right (ProjectSettings opts pkgDesc Nothing Nothing (Just testTarget), _)) -> do
           let pkgFields = mkPkgDescription opts pkgDesc
+              commonStanza = mkCommonStanza opts
               testStanza = mkTestStanza opts $ testTarget {_testDependencies = mangleBaseDep testTarget _testDependencies}
           
-          mkStanza $ pkgFields ++ [testStanza]
+          mkStanza $ pkgFields ++ [commonStanza, testStanza]
 
         (Right (ProjectSettings _ _ l e t, _)) -> assertFailure $
           show l ++ "\n" ++ show e ++ "\n" ++ show t
diff --git a/cabal-install/tests/fixtures/init/golden/cabal/cabal-lib-and-exe-no-comments.golden b/cabal-install/tests/fixtures/init/golden/cabal/cabal-lib-and-exe-no-comments.golden
index 97d868a683d057fd741bf73bc0dfece98fc3e7e9..7fd052c7d208af4acc3612757a5e260ef2530dbe 100644
--- a/cabal-install/tests/fixtures/init/golden/cabal/cabal-lib-and-exe-no-comments.golden
+++ b/cabal-install/tests/fixtures/init/golden/cabal/cabal-lib-and-exe-no-comments.golden
@@ -20,7 +20,11 @@ extra-doc-files:    CHANGELOG.md
 -- Extra source files to be distributed with the package, such as examples, or a tutorial module.
 -- extra-source-files:
 
+common warnings
+    ghc-options: -Wall
+
 library
+    import:           warnings
     exposed-modules:  MyLib
 
     -- Modules included in this library but not exported.
@@ -33,6 +37,7 @@ library
     default-language: Haskell98
 
 executable y
+    import:           warnings
     main-is:          Main.hs
 
     -- Modules included in this executable, other than Main.
@@ -48,6 +53,7 @@ executable y
     default-language: Haskell2010
 
 test-suite y-test
+    import:           warnings
     default-language: Haskell2010
 
     -- Modules included in this executable, other than Main.
diff --git a/cabal-install/tests/fixtures/init/golden/cabal/cabal-lib-and-exe-with-comments.golden b/cabal-install/tests/fixtures/init/golden/cabal/cabal-lib-and-exe-with-comments.golden
index 976ad1adb35a709b1e8f39e19fa0db28417146b6..8571b4001987c5442dc1b9ceb3815473feaf3ebb 100644
--- a/cabal-install/tests/fixtures/init/golden/cabal/cabal-lib-and-exe-with-comments.golden
+++ b/cabal-install/tests/fixtures/init/golden/cabal/cabal-lib-and-exe-with-comments.golden
@@ -52,7 +52,13 @@ extra-doc-files:    CHANGELOG.md
 -- Extra source files to be distributed with the package, such as examples, or a tutorial module.
 -- extra-source-files:
 
+common warnings
+    ghc-options: -Wall
+
 library
+    -- Import common warning flags.
+    import:           warnings
+
     -- Modules exported by the library.
     exposed-modules:  MyLib
 
@@ -72,6 +78,9 @@ library
     default-language: Haskell98
 
 executable y
+    -- Import common warning flags.
+    import:           warnings
+
     -- .hs or .lhs file containing the Main module.
     main-is:          Main.hs
 
@@ -93,6 +102,9 @@ executable y
     default-language: Haskell2010
 
 test-suite y-test
+    -- Import common warning flags.
+    import:           warnings
+
     -- Base language which the package is written in.
     default-language: Haskell2010
 
diff --git a/cabal-install/tests/fixtures/init/golden/cabal/cabal-lib-no-comments.golden b/cabal-install/tests/fixtures/init/golden/cabal/cabal-lib-no-comments.golden
index c903411c9caf9c069a7affab0a82896833d2d18e..8412d365ecf1ce10da72b57c3468bd94092dc0a6 100644
--- a/cabal-install/tests/fixtures/init/golden/cabal/cabal-lib-no-comments.golden
+++ b/cabal-install/tests/fixtures/init/golden/cabal/cabal-lib-no-comments.golden
@@ -20,7 +20,11 @@ extra-doc-files:    CHANGELOG.md
 -- Extra source files to be distributed with the package, such as examples, or a tutorial module.
 -- extra-source-files:
 
+common warnings
+    ghc-options: -Wall
+
 library
+    import:           warnings
     exposed-modules:  MyLib
 
     -- Modules included in this library but not exported.
@@ -33,6 +37,7 @@ library
     default-language: Haskell98
 
 test-suite y-test
+    import:           warnings
     default-language: Haskell2010
 
     -- Modules included in this executable, other than Main.
diff --git a/cabal-install/tests/fixtures/init/golden/cabal/cabal-lib-with-comments.golden b/cabal-install/tests/fixtures/init/golden/cabal/cabal-lib-with-comments.golden
index 8b54f17e83d0fef7567f35f358b1dc84026c22b6..2d7b768e9ed0f8a2aebea45844b89157b3c4d829 100644
--- a/cabal-install/tests/fixtures/init/golden/cabal/cabal-lib-with-comments.golden
+++ b/cabal-install/tests/fixtures/init/golden/cabal/cabal-lib-with-comments.golden
@@ -52,7 +52,13 @@ extra-doc-files:    CHANGELOG.md
 -- Extra source files to be distributed with the package, such as examples, or a tutorial module.
 -- extra-source-files:
 
+common warnings
+    ghc-options: -Wall
+
 library
+    -- Import common warning flags.
+    import:           warnings
+
     -- Modules exported by the library.
     exposed-modules:  MyLib
 
@@ -72,6 +78,9 @@ library
     default-language: Haskell98
 
 test-suite y-test
+    -- Import common warning flags.
+    import:           warnings
+
     -- Base language which the package is written in.
     default-language: Haskell2010
 
diff --git a/cabal-install/tests/fixtures/init/golden/cabal/cabal-test-suite-no-comments.golden b/cabal-install/tests/fixtures/init/golden/cabal/cabal-test-suite-no-comments.golden
index 72b75365c04b9918a2662e72ccce6665f19ba782..d853443a774c77aed96d695173968ba4655c8660 100644
--- a/cabal-install/tests/fixtures/init/golden/cabal/cabal-test-suite-no-comments.golden
+++ b/cabal-install/tests/fixtures/init/golden/cabal/cabal-test-suite-no-comments.golden
@@ -20,7 +20,11 @@ extra-doc-files:    CHANGELOG.md
 -- Extra source files to be distributed with the package, such as examples, or a tutorial module.
 -- extra-source-files:
 
+common warnings
+    ghc-options: -Wall
+
 test-suite y-test
+    import:           warnings
     default-language: Haskell2010
 
     -- Modules included in this executable, other than Main.
diff --git a/cabal-install/tests/fixtures/init/golden/cabal/cabal-test-suite-with-comments.golden b/cabal-install/tests/fixtures/init/golden/cabal/cabal-test-suite-with-comments.golden
index ad8f7e9a5c7c8d8c3d32a341a4d30956ab7eee10..0e433ac2cccd3c62e9c4ac4c534750576deed267 100644
--- a/cabal-install/tests/fixtures/init/golden/cabal/cabal-test-suite-with-comments.golden
+++ b/cabal-install/tests/fixtures/init/golden/cabal/cabal-test-suite-with-comments.golden
@@ -52,7 +52,13 @@ extra-doc-files:    CHANGELOG.md
 -- Extra source files to be distributed with the package, such as examples, or a tutorial module.
 -- extra-source-files:
 
+common warnings
+    ghc-options: -Wall
+
 test-suite y-test
+    -- Import common warning flags.
+    import:           warnings
+
     -- Base language which the package is written in.
     default-language: Haskell2010
 
diff --git a/cabal-install/tests/fixtures/init/golden/exe/exe-build-tools-with-comments.golden b/cabal-install/tests/fixtures/init/golden/exe/exe-build-tools-with-comments.golden
index a256fb30604a1995e0fea13cf589434cd24f5fce..ea22096155a9620e57f7486e4b058272a7a6fc2e 100644
--- a/cabal-install/tests/fixtures/init/golden/exe/exe-build-tools-with-comments.golden
+++ b/cabal-install/tests/fixtures/init/golden/exe/exe-build-tools-with-comments.golden
@@ -1,4 +1,7 @@
 executable y
+    -- Import common warning flags.
+    import:             warnings
+
     -- .hs or .lhs file containing the Main module.
     main-is:            Main.hs
 
diff --git a/cabal-install/tests/fixtures/init/golden/exe/exe-minimal-no-comments.golden b/cabal-install/tests/fixtures/init/golden/exe/exe-minimal-no-comments.golden
index 88d69ab18db22784dcc5a12831135b53cb5a320f..4d520a4580c32512fb4fb690751f016c1cc79348 100644
--- a/cabal-install/tests/fixtures/init/golden/exe/exe-minimal-no-comments.golden
+++ b/cabal-install/tests/fixtures/init/golden/exe/exe-minimal-no-comments.golden
@@ -1,4 +1,5 @@
 executable y
+    import:           warnings
     main-is:          Main.hs
     build-depends:    base
     hs-source-dirs:   exe
diff --git a/cabal-install/tests/fixtures/init/golden/exe/exe-simple-minimal-with-comments.golden b/cabal-install/tests/fixtures/init/golden/exe/exe-simple-minimal-with-comments.golden
index 88d69ab18db22784dcc5a12831135b53cb5a320f..4d520a4580c32512fb4fb690751f016c1cc79348 100644
--- a/cabal-install/tests/fixtures/init/golden/exe/exe-simple-minimal-with-comments.golden
+++ b/cabal-install/tests/fixtures/init/golden/exe/exe-simple-minimal-with-comments.golden
@@ -1,4 +1,5 @@
 executable y
+    import:           warnings
     main-is:          Main.hs
     build-depends:    base
     hs-source-dirs:   exe
diff --git a/cabal-install/tests/fixtures/init/golden/exe/exe-with-comments.golden b/cabal-install/tests/fixtures/init/golden/exe/exe-with-comments.golden
index deb7bb063dab0d051624ef7a9172023b2e242a48..2669151b85d3e64de55d37be7e3109449c4599ea 100644
--- a/cabal-install/tests/fixtures/init/golden/exe/exe-with-comments.golden
+++ b/cabal-install/tests/fixtures/init/golden/exe/exe-with-comments.golden
@@ -1,4 +1,7 @@
 executable y
+    -- Import common warning flags.
+    import:           warnings
+
     -- .hs or .lhs file containing the Main module.
     main-is:          Main.hs
 
diff --git a/cabal-install/tests/fixtures/init/golden/exe/exe.golden b/cabal-install/tests/fixtures/init/golden/exe/exe.golden
index 3f4d9c54fe6710e7c333811beb17fd08cccaf5be..033ab48ab8db05c7f9977c2e7707b5a7c04e994a 100644
--- a/cabal-install/tests/fixtures/init/golden/exe/exe.golden
+++ b/cabal-install/tests/fixtures/init/golden/exe/exe.golden
@@ -1,4 +1,5 @@
 executable y
+    import:           warnings
     main-is:          Main.hs
 
     -- Modules included in this executable, other than Main.
diff --git a/cabal-install/tests/fixtures/init/golden/lib/lib-build-tools-with-comments.golden b/cabal-install/tests/fixtures/init/golden/lib/lib-build-tools-with-comments.golden
index a828e09ebc28d1cd0061eee89610628b585197e5..609bbe48098238a092bd1a600d046ef279042821 100644
--- a/cabal-install/tests/fixtures/init/golden/lib/lib-build-tools-with-comments.golden
+++ b/cabal-install/tests/fixtures/init/golden/lib/lib-build-tools-with-comments.golden
@@ -1,4 +1,7 @@
 library
+    -- Import common warning flags.
+    import:             warnings
+
     -- Modules exported by the library.
     exposed-modules:    MyLib
 
diff --git a/cabal-install/tests/fixtures/init/golden/lib/lib-minimal-no-comments.golden b/cabal-install/tests/fixtures/init/golden/lib/lib-minimal-no-comments.golden
index 99e5d7fffb81eececce5aac6d30161e2a1decc14..d1aa994111052546c971e809c21096bdd6543d13 100644
--- a/cabal-install/tests/fixtures/init/golden/lib/lib-minimal-no-comments.golden
+++ b/cabal-install/tests/fixtures/init/golden/lib/lib-minimal-no-comments.golden
@@ -1,4 +1,5 @@
 library
+    import:           warnings
     exposed-modules:  MyLib
     build-depends:    base
     hs-source-dirs:   src
diff --git a/cabal-install/tests/fixtures/init/golden/lib/lib-simple-minimal-with-comments.golden b/cabal-install/tests/fixtures/init/golden/lib/lib-simple-minimal-with-comments.golden
index 99e5d7fffb81eececce5aac6d30161e2a1decc14..d1aa994111052546c971e809c21096bdd6543d13 100644
--- a/cabal-install/tests/fixtures/init/golden/lib/lib-simple-minimal-with-comments.golden
+++ b/cabal-install/tests/fixtures/init/golden/lib/lib-simple-minimal-with-comments.golden
@@ -1,4 +1,5 @@
 library
+    import:           warnings
     exposed-modules:  MyLib
     build-depends:    base
     hs-source-dirs:   src
diff --git a/cabal-install/tests/fixtures/init/golden/lib/lib-simple.golden b/cabal-install/tests/fixtures/init/golden/lib/lib-simple.golden
index 8dd9dbcecbd487240b5d60f8b37e28d193bdd620..0b407100beb4d067e57245ac03de22fbc9dff95e 100644
--- a/cabal-install/tests/fixtures/init/golden/lib/lib-simple.golden
+++ b/cabal-install/tests/fixtures/init/golden/lib/lib-simple.golden
@@ -1,4 +1,5 @@
 library
+    import:           warnings
     exposed-modules:  MyLib
 
     -- Modules included in this library but not exported.
diff --git a/cabal-install/tests/fixtures/init/golden/lib/lib-with-comments.golden b/cabal-install/tests/fixtures/init/golden/lib/lib-with-comments.golden
index d64fb60b61310ca27a30b48457c436dad03a6f21..3df8e499d8d4a7890ddc7a253196b0ba7bdfff6d 100644
--- a/cabal-install/tests/fixtures/init/golden/lib/lib-with-comments.golden
+++ b/cabal-install/tests/fixtures/init/golden/lib/lib-with-comments.golden
@@ -1,4 +1,7 @@
 library
+    -- Import common warning flags.
+    import:           warnings
+
     -- Modules exported by the library.
     exposed-modules:  MyLib
 
diff --git a/cabal-install/tests/fixtures/init/golden/lib/lib.golden b/cabal-install/tests/fixtures/init/golden/lib/lib.golden
index 8dd9dbcecbd487240b5d60f8b37e28d193bdd620..0b407100beb4d067e57245ac03de22fbc9dff95e 100644
--- a/cabal-install/tests/fixtures/init/golden/lib/lib.golden
+++ b/cabal-install/tests/fixtures/init/golden/lib/lib.golden
@@ -1,4 +1,5 @@
 library
+    import:           warnings
     exposed-modules:  MyLib
 
     -- Modules included in this library but not exported.
diff --git a/cabal-install/tests/fixtures/init/golden/test/standalone-test-with-comments.golden b/cabal-install/tests/fixtures/init/golden/test/standalone-test-with-comments.golden
index 2381ebd092e32214f7055b061e1df073b4e3c77e..02ed0cfd9629fb263422b34f9ebacd9e4beaac92 100644
--- a/cabal-install/tests/fixtures/init/golden/test/standalone-test-with-comments.golden
+++ b/cabal-install/tests/fixtures/init/golden/test/standalone-test-with-comments.golden
@@ -1,4 +1,7 @@
 test-suite y-test
+    -- Import common warning flags.
+    import:           warnings
+
     -- Base language which the package is written in.
     default-language: Haskell2010
 
diff --git a/cabal-install/tests/fixtures/init/golden/test/standalone-test.golden b/cabal-install/tests/fixtures/init/golden/test/standalone-test.golden
index 7a36e096fb25a7103b1a697bfc620fa7bafbdea3..014252e6bef735e598ecf6ded679b3810a269df0 100644
--- a/cabal-install/tests/fixtures/init/golden/test/standalone-test.golden
+++ b/cabal-install/tests/fixtures/init/golden/test/standalone-test.golden
@@ -1,4 +1,5 @@
 test-suite y-test
+    import:           warnings
     default-language: Haskell2010
 
     -- Modules included in this executable, other than Main.
diff --git a/cabal-install/tests/fixtures/init/golden/test/test-build-tools-with-comments.golden b/cabal-install/tests/fixtures/init/golden/test/test-build-tools-with-comments.golden
index f3cbb8ade97e5ccf31c6bf638879eacea644b035..105afeb3465fceef13f3f630f69dae7f99760581 100644
--- a/cabal-install/tests/fixtures/init/golden/test/test-build-tools-with-comments.golden
+++ b/cabal-install/tests/fixtures/init/golden/test/test-build-tools-with-comments.golden
@@ -1,4 +1,7 @@
 test-suite y-test
+    -- Import common warning flags.
+    import:             warnings
+
     -- Base language which the package is written in.
     default-language:   Haskell2010
 
diff --git a/cabal-install/tests/fixtures/init/golden/test/test-minimal-no-comments.golden b/cabal-install/tests/fixtures/init/golden/test/test-minimal-no-comments.golden
index b092956a6d24b4a7de7cdc8a49c5d5267a5fe81b..2a95da04c2e3fac2aac105beb7c050075b0e564b 100644
--- a/cabal-install/tests/fixtures/init/golden/test/test-minimal-no-comments.golden
+++ b/cabal-install/tests/fixtures/init/golden/test/test-minimal-no-comments.golden
@@ -1,4 +1,5 @@
 test-suite y-test
+    import:           warnings
     default-language: Haskell2010
     type:             exitcode-stdio-1.0
     hs-source-dirs:   test
diff --git a/cabal-install/tests/fixtures/init/golden/test/test-simple-minimal-with-comments.golden b/cabal-install/tests/fixtures/init/golden/test/test-simple-minimal-with-comments.golden
index b092956a6d24b4a7de7cdc8a49c5d5267a5fe81b..2a95da04c2e3fac2aac105beb7c050075b0e564b 100644
--- a/cabal-install/tests/fixtures/init/golden/test/test-simple-minimal-with-comments.golden
+++ b/cabal-install/tests/fixtures/init/golden/test/test-simple-minimal-with-comments.golden
@@ -1,4 +1,5 @@
 test-suite y-test
+    import:           warnings
     default-language: Haskell2010
     type:             exitcode-stdio-1.0
     hs-source-dirs:   test
diff --git a/cabal-install/tests/fixtures/init/golden/test/test-with-comments.golden b/cabal-install/tests/fixtures/init/golden/test/test-with-comments.golden
index 2381ebd092e32214f7055b061e1df073b4e3c77e..02ed0cfd9629fb263422b34f9ebacd9e4beaac92 100644
--- a/cabal-install/tests/fixtures/init/golden/test/test-with-comments.golden
+++ b/cabal-install/tests/fixtures/init/golden/test/test-with-comments.golden
@@ -1,4 +1,7 @@
 test-suite y-test
+    -- Import common warning flags.
+    import:           warnings
+
     -- Base language which the package is written in.
     default-language: Haskell2010
 
diff --git a/cabal-install/tests/fixtures/init/golden/test/test.golden b/cabal-install/tests/fixtures/init/golden/test/test.golden
index 7a36e096fb25a7103b1a697bfc620fa7bafbdea3..014252e6bef735e598ecf6ded679b3810a269df0 100644
--- a/cabal-install/tests/fixtures/init/golden/test/test.golden
+++ b/cabal-install/tests/fixtures/init/golden/test/test.golden
@@ -1,4 +1,5 @@
 test-suite y-test
+    import:           warnings
     default-language: Haskell2010
 
     -- Modules included in this executable, other than Main.