File tree Expand file tree Collapse file tree 2 files changed +31
-17
lines changed
Expand file tree Collapse file tree 2 files changed +31
-17
lines changed Original file line number Diff line number Diff line change 1- module Test where
1+ import Data.Proxy (Proxy (.. ))
2+ import Data.Typeable (Typeable )
3+ import qualified Test.LSP as LSP
4+ import qualified Test.SrcLoc as SrcLoc
5+ import Test.Tasty
6+ import Test.Tasty.Options
27
3- import qualified Test.SrcLoc as SrcLoc
4- import qualified Test.LSP as LSP
5- import Test.Tasty ( TestTree
6- , defaultMain
7- , testGroup
8- )
8+ -- Define the custom option
9+ newtype AlsPathOption = AlsPathOption FilePath
10+ deriving (Show , Typeable )
11+
12+ instance IsOption AlsPathOption where
13+ defaultValue = AlsPathOption " als"
14+ parseValue = Just . AlsPathOption
15+ optionName = return " als-path"
16+ optionHelp = return " Path to the als executable"
917
1018main :: IO ()
11- main = defaultMain tests
19+ main = do
20+ let opts = [Option (Proxy :: Proxy AlsPathOption )]
21+ ingredients = includingOptions opts : defaultIngredients
22+ defaultMainWithIngredients ingredients tests
1223
1324tests :: TestTree
14- tests = testGroup " Tests"
15- [SrcLoc. tests,
16- LSP. tests
17- ]
25+ tests = askOption $ \ (AlsPathOption alsPath) ->
26+ testGroup
27+ " Tests"
28+ [ SrcLoc. tests,
29+ LSP. tests alsPath
30+ ]
Original file line number Diff line number Diff line change @@ -12,15 +12,16 @@ import qualified Data.Aeson as JSON
1212import Switchboard ( agdaCustomMethod )
1313import Agda
1414
15- tests :: TestTree
16- tests =
15+ tests :: FilePath -> TestTree
16+ tests alsPath =
1717 testGroup
1818 " LSP"
19- [ testCase " load" demo
19+ [ testCase " load" ( demo alsPath)
2020 ]
2121
22- demo :: IO ()
23- demo = runSession " als" fullLatestClientCaps " test/data/" $ do
22+ demo :: FilePath -> IO ()
23+ demo alsPath =
24+ runSession alsPath fullLatestClientCaps " test/data/" $ do
2425 doc <- openDoc " A.agda" " agda"
2526
2627 -- Use your favourite favourite combinators.
You can’t perform that action at this time.
0 commit comments