Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Commit 0effcf4

Browse files
committed
Create a custom hie.yaml for testdata
Create a customtom hie.yaml for the more general Purpose testdata directory project
1 parent 3ff767e commit 0effcf4

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

test/utils/TestUtils.hs

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ setupStackFilesIn :: FilePath -> IO ()
111111
setupStackFilesIn f = do
112112
resolver <- readResolver
113113
writeFile (f ++ "stack.yaml") $ stackFileContents resolver
114-
writeFile (f ++ "hie.yaml") hieYamlCradleStackContents
114+
case f of
115+
"./test/testdata/" -> writeFile (f ++ "hie.yaml") testdataHieYamlCradleStackContents
116+
_ -> writeFile (f ++ "hie.yaml") hieYamlCradleStackContents
115117

116118
setupDirectFilesIn :: FilePath -> IO ()
117119
setupDirectFilesIn f =
@@ -214,6 +216,42 @@ hieYamlCradleStackContents = unlines
214216
, " stack:"
215217
]
216218

219+
testdataHieYamlCradleStackContents :: String
220+
testdataHieYamlCradleStackContents = unlines
221+
[ "# WARNING: THIS FILE IS AUTOGENERATED IN test/utils/TestUtils.hs. IT WILL BE OVERWRITTEN ON EVERY TEST RUN"
222+
, "cradle:"
223+
, " stack:"
224+
, " - path: \"ApplyRefact.hs\""
225+
, " component: \"testdata:exe:applyrefact\""
226+
, " - path: \"Hover.hs\""
227+
, " component: \"testdata:exe:hover\""
228+
, " - path: \"Symbols.hs\""
229+
, " component: \"testdata:exe:symbols\""
230+
, " - path: \"ApplyRefact2.hs\""
231+
, " component: \"testdata:exe:applyrefact2\""
232+
, " - path: \"HlintPragma.hs\""
233+
, " component: \"testdata:exe:hlintpragma\""
234+
, " - path: \"HaReCase.hs\""
235+
, " component: \"testdata:exe:harecase\""
236+
, " - path: \"HaReDemote.hs\""
237+
, " component: \"testdata:exe:haredemote\""
238+
, " - path: \"HaReMoveDef.hs\""
239+
, " component: \"testdata:exe:haremovedef\""
240+
, " - path: \"HaReRename.hs\""
241+
, " component: \"testdata:exe:harerename\""
242+
, " - path: \"HaReGA1.hs\""
243+
, " component: \"testdata:exe:haregenapplicative\""
244+
, " - path: \"FuncTest.hs\""
245+
, " component: \"testdata:exe:functests\""
246+
, " - path: \"liquid/Evens.hs\""
247+
, " component: \"testdata:exe:evens\""
248+
, " - path: \"FileWithWarning.hs\""
249+
, " component: \"testdata:exe:filewithwarning\""
250+
, " - path: ."
251+
, " component: \"testdata:exe:filewithwarning\""
252+
]
253+
254+
217255
hieYamlCradleDirectContents :: String
218256
hieYamlCradleDirectContents = unlines
219257
[ "# WARNING: THIS FILE IS AUTOGENERATED IN test/utils/TestUtils.hs. IT WILL BE OVERWRITTEN ON EVERY TEST RUN"

0 commit comments

Comments
 (0)