@@ -51,7 +51,6 @@ import Data.Bool (bool)
51
51
import Data.Default
52
52
import Data.List (intercalate )
53
53
import Data.List.Extra (find )
54
- import Data.Maybe
55
54
import qualified Data.Set as Set
56
55
import qualified Data.Text as T
57
56
import Development.IDE (GhcVersion (.. ), ghcVersion )
@@ -166,72 +165,6 @@ hieYamlCradleDirectContents = unlines
166
165
]
167
166
168
167
169
- -- ---------------------------------------------------------------------
170
-
171
- -- | A Hspec formatter for CircleCI.
172
- -- Originally from https://github.com/LeastAuthority/hspec-jenkins
173
- xmlFormatter :: Formatter
174
- xmlFormatter = silent {
175
- headerFormatter = do
176
- writeLine " <?xml version='1.0' encoding='UTF-8'?>"
177
- writeLine " <testsuite>"
178
- , exampleSucceeded
179
- , exampleFailed
180
- , examplePending
181
- , footerFormatter = writeLine " </testsuite>"
182
- }
183
- where
184
-
185
- #if MIN_VERSION_hspec(2,5,0)
186
- exampleSucceeded path _ =
187
- #else
188
- exampleSucceeded path =
189
- #endif
190
- writeLine $ renderMarkup $ testcase path " "
191
-
192
- #if MIN_VERSION_hspec(2,5,0)
193
- exampleFailed path _ err =
194
- #else
195
- exampleFailed path (Left err) =
196
- writeLine $ renderMarkup $ testcase path $
197
- failure ! message (show err) $ " "
198
- exampleFailed path (Right err) =
199
- #endif
200
- writeLine $ renderMarkup $ testcase path $
201
- failure ! message (reasonAsString err) $ " "
202
-
203
- #if MIN_VERSION_hspec(2,5,0)
204
- examplePending path _ reason =
205
- #else
206
- examplePending path reason =
207
- #endif
208
- writeLine $ renderMarkup $ testcase path $
209
- case reason of
210
- Just desc -> skipped ! message desc $ " "
211
- Nothing -> skipped " "
212
-
213
- failure , skipped :: Markup -> Markup
214
- failure = customParent " failure"
215
- skipped = customParent " skipped"
216
-
217
- name , className , message :: String -> Attribute
218
- name = customAttribute " name" . stringValue
219
- className = customAttribute " classname" . stringValue
220
- message = customAttribute " message" . stringValue
221
-
222
- testcase :: Path -> Markup -> Markup
223
- testcase (xs,x) = customParent " testcase" ! name x ! className (intercalate " ." xs)
224
-
225
- reasonAsString :: FailureReason -> String
226
- reasonAsString NoReason = " no reason given"
227
- reasonAsString (Reason x) = x
228
- reasonAsString (ExpectedButGot Nothing expected got) = " Expected " ++ expected ++ " but got " ++ got
229
- reasonAsString (ExpectedButGot (Just src) expected got) = src ++ " expected " ++ expected ++ " but got " ++ got
230
- #if MIN_VERSION_hspec(2,5,0)
231
- reasonAsString (Error Nothing err ) = show err
232
- reasonAsString (Error (Just s) err) = s ++ show err
233
- #endif
234
-
235
168
-- ---------------------------------------------------------------------
236
169
237
170
flushStackEnvironment :: IO ()
0 commit comments