Skip to content

Commit 0c1708f

Browse files
committed
add xml output to runner
1 parent 092db6e commit 0c1708f

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

haskell-language-server.cabal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ test-suite func-test
224224
, lens
225225
, lsp-test >= 0.10.0.0
226226
, tasty
227+
, tasty-ant-xml
227228
, tasty-expected-failure
228229
, tasty-hunit
229230
, tasty-rerun

test/functional/Main.hs

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
module Main where
22

3-
import Control.Monad.IO.Class
4-
import Language.Haskell.LSP.Test
5-
import Test.Hls.Util
63
import Test.Tasty
4+
import Test.Tasty.Runners (listingTests, consoleTestReporter)
75
import Test.Tasty.Ingredients.Rerun
6+
import Test.Tasty.Runners.AntXML
87

98
import Command
109
import Completion
@@ -24,18 +23,14 @@ import Symbol
2423
import TypeDefinition
2524

2625
main :: IO ()
27-
main = do
28-
setupBuildToolFiles
29-
30-
-- run a test session to warm up the cache to prevent timeouts in other tests
31-
putStrLn "Warming up haskell-language-server cache..."
32-
runSessionWithConfig (defaultConfig { messageTimeout = 120 }) hieCommand fullCaps "test/testdata" $
33-
liftIO $ putStrLn "haskell-language-server cache is warmed up"
34-
35-
--TODO Test runner with config like HSpec??
36-
37-
-- test tree
38-
defaultMainWithRerun $ testGroup "haskell-language-server" [
26+
main =
27+
-- ingredient: xml runner writes json file of test results (https://github.com/ocharles/tasty-ant-xml/blob/master/Test/Tasty/Runners/AntXML.hs)
28+
-- rerunningTests allow rerun of failed tests (https://github.com/ocharles/tasty-rerun/blob/master/src/Test/Tasty/Ingredients/Rerun.hs)
29+
defaultMainWithIngredients [
30+
antXMLRunner
31+
, rerunningTests [ listingTests, consoleTestReporter ]
32+
]
33+
$ testGroup "haskell-language-server" [
3934
Command.tests
4035
, Completion.tests
4136
, Deferred.tests

0 commit comments

Comments
 (0)