Skip to content

Commit 96eb252

Browse files
committed
Accept golden tests
1 parent 6716142 commit 96eb252

26 files changed

+165
-26
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,5 @@ bench.html
109109

110110
# ignore the downloaded binary files
111111
scripts/release/binary-downloads/
112+
113+
tests/fixtures

cabal-install/src/Distribution/Client/Init/Format.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ mkTestStanza opts (TestTarget testMain dirs lang otherMods exts deps tools) =
322322
annNoComments
323323
(toUTF8BS "test-suite")
324324
[suiteName]
325-
(insertCommonStanzas ++ [ case specHasCommonStanzas $ _optCabalSpec opts of
325+
(insertCommonStanzas opts ++ [ case specHasCommonStanzas $ _optCabalSpec opts of
326326
NoCommonStanzas -> PrettyEmpty
327327
_ ->
328328
field
@@ -388,7 +388,7 @@ mkTestStanza opts (TestTarget testMain dirs lang otherMods exts deps tools) =
388388
["Extra tools (e.g. alex, hsc2hs, ...) needed to build the source."]
389389
False
390390
opts
391-
]
391+
])
392392
where
393393
suiteName = text $ unPackageName (_optPkgName opts) ++ "-test"
394394

cabal-install/tests/fixtures/init/golden/cabal/cabal-lib-and-exe-no-comments.golden

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ common warnings
1818
ghc-options: -Wall
1919

2020
library
21-
import: warnings
21+
import: extensions
22+
import: ghc-options
23+
import: rts-options
2224
exposed-modules: MyLib
2325
-- other-modules:
2426
-- other-extensions:
@@ -27,7 +29,9 @@ library
2729
default-language: Haskell98
2830

2931
executable y
30-
import: warnings
32+
import: extensions
33+
import: ghc-options
34+
import: rts-options
3135
main-is: Main.hs
3236
-- other-modules:
3337
-- other-extensions:
@@ -39,6 +43,9 @@ executable y
3943
default-language: Haskell2010
4044

4145
test-suite y-test
46+
import: extensions
47+
import: ghc-options
48+
import: rts-options
4249
import: warnings
4350
default-language: Haskell2010
4451
-- other-modules:

cabal-install/tests/fixtures/init/golden/cabal/cabal-lib-and-exe-with-comments.golden

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,14 @@ common warnings
5858
ghc-options: -Wall
5959

6060
library
61-
-- Import common warning flags.
62-
import: warnings
61+
-- Common language extensions
62+
import: extensions
63+
64+
-- Common compiler warnings and optimisations
65+
import: ghc-options
66+
67+
-- Common RTS options
68+
import: rts-options
6369

6470
-- Modules exported by the library.
6571
exposed-modules: MyLib
@@ -80,8 +86,14 @@ library
8086
default-language: Haskell98
8187

8288
executable y
83-
-- Import common warning flags.
84-
import: warnings
89+
-- Common language extensions
90+
import: extensions
91+
92+
-- Common compiler warnings and optimisations
93+
import: ghc-options
94+
95+
-- Common RTS options
96+
import: rts-options
8597

8698
-- .hs or .lhs file containing the Main module.
8799
main-is: Main.hs
@@ -104,6 +116,15 @@ executable y
104116
default-language: Haskell2010
105117

106118
test-suite y-test
119+
-- Common language extensions
120+
import: extensions
121+
122+
-- Common compiler warnings and optimisations
123+
import: ghc-options
124+
125+
-- Common RTS options
126+
import: rts-options
127+
107128
-- Import common warning flags.
108129
import: warnings
109130

cabal-install/tests/fixtures/init/golden/cabal/cabal-lib-no-comments.golden

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ common warnings
1818
ghc-options: -Wall
1919

2020
library
21-
import: warnings
21+
import: extensions
22+
import: ghc-options
23+
import: rts-options
2224
exposed-modules: MyLib
2325
-- other-modules:
2426
-- other-extensions:
@@ -27,6 +29,9 @@ library
2729
default-language: Haskell98
2830

2931
test-suite y-test
32+
import: extensions
33+
import: ghc-options
34+
import: rts-options
3035
import: warnings
3136
default-language: Haskell2010
3237
-- other-modules:

cabal-install/tests/fixtures/init/golden/cabal/cabal-lib-with-comments.golden

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,14 @@ common warnings
5858
ghc-options: -Wall
5959

6060
library
61-
-- Import common warning flags.
62-
import: warnings
61+
-- Common language extensions
62+
import: extensions
63+
64+
-- Common compiler warnings and optimisations
65+
import: ghc-options
66+
67+
-- Common RTS options
68+
import: rts-options
6369

6470
-- Modules exported by the library.
6571
exposed-modules: MyLib
@@ -80,6 +86,15 @@ library
8086
default-language: Haskell98
8187

8288
test-suite y-test
89+
-- Common language extensions
90+
import: extensions
91+
92+
-- Common compiler warnings and optimisations
93+
import: ghc-options
94+
95+
-- Common RTS options
96+
import: rts-options
97+
8398
-- Import common warning flags.
8499
import: warnings
85100

cabal-install/tests/fixtures/init/golden/cabal/cabal-test-suite-no-comments.golden

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ common warnings
1818
ghc-options: -Wall
1919

2020
test-suite y-test
21+
import: extensions
22+
import: ghc-options
23+
import: rts-options
2124
import: warnings
2225
default-language: Haskell2010
2326
-- other-modules:

cabal-install/tests/fixtures/init/golden/cabal/cabal-test-suite-with-comments.golden

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,15 @@ common warnings
5858
ghc-options: -Wall
5959

6060
test-suite y-test
61+
-- Common language extensions
62+
import: extensions
63+
64+
-- Common compiler warnings and optimisations
65+
import: ghc-options
66+
67+
-- Common RTS options
68+
import: rts-options
69+
6170
-- Import common warning flags.
6271
import: warnings
6372

cabal-install/tests/fixtures/init/golden/exe/exe-build-tools-with-comments.golden

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
executable y
2-
-- Import common warning flags.
3-
import: warnings
2+
-- Common language extensions
3+
import: extensions
4+
5+
-- Common compiler warnings and optimisations
6+
import: ghc-options
7+
8+
-- Common RTS options
9+
import: rts-options
410

511
-- .hs or .lhs file containing the Main module.
612
main-is: Main.hs

cabal-install/tests/fixtures/init/golden/exe/exe-minimal-no-comments.golden

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
executable y
2-
import: warnings
2+
import: extensions
3+
import: ghc-options
4+
import: rts-options
35
main-is: Main.hs
46
build-depends: base
57
hs-source-dirs: exe

0 commit comments

Comments
 (0)