mirror of
https://github.com/Avi-D-coder/implicit-hie.git
synced 2024-09-11 09:05:25 +03:00
Remove autogen-modules from other-modules + Update tests
This commit is contained in:
parent
4513e5033b
commit
3350d7c90f
3
hie.yaml
3
hie.yaml
@ -6,8 +6,5 @@ cradle:
|
||||
- path: "app/Main.hs"
|
||||
component: "implicit-hie:exe:gen-hie"
|
||||
|
||||
- path: "app/Paths_implicit_hie.hs"
|
||||
component: "implicit-hie:exe:gen-hie"
|
||||
|
||||
- path: "test"
|
||||
component: "implicit-hie:test:implicit-hie-test"
|
||||
|
@ -76,7 +76,7 @@ parseBench = parseSecMain (Comp Bench) "benchmark"
|
||||
parseSecMain :: (Name -> Path -> Component) -> Text -> Indent -> Parser [Component]
|
||||
parseSecMain c s i = do
|
||||
n <- componentHeader i s
|
||||
p <- pathMain (i + 1) ["./"] "" []
|
||||
p <- pathMain (i + 1) ["./"] "" [] []
|
||||
pure $ map (c n) p
|
||||
|
||||
parseQuoted :: Parser Text
|
||||
@ -106,17 +106,24 @@ parseList i = items <|> (emptyOrComLine >> indent i >> items)
|
||||
<|> pure []
|
||||
pure $ h : t
|
||||
|
||||
pathMain :: Indent -> [Text] -> Text -> [Text] -> Parser [Text]
|
||||
pathMain i p m o =
|
||||
(hsSourceDir i >>= (\p' -> pathMain i p' m o))
|
||||
<|> (field i "main-is" (const parseString) >>= flip (pathMain i p) o)
|
||||
<|> (field i "other-modules" parseList >>= pathMain i p m)
|
||||
<|> (skipBlockLine i >> pathMain i p m o)
|
||||
<|> pure (map (<//> m) p <> [p' <//> (o' <> ".hs") | p' <- p, o' <- o])
|
||||
|
||||
pathMain :: Indent -> [Text] -> Text -> [Text] -> [Text] -> Parser [Text]
|
||||
pathMain i p m o a =
|
||||
(hsSourceDir i >>= (\p' -> pathMain i p' m o a))
|
||||
<|> (field i "main-is" (const parseString) >>= (\m' -> pathMain i p m' o a))
|
||||
<|> (field i "other-modules" parseList >>= flip (pathMain i p m) a)
|
||||
<|> (field i "autogen-modules" parseList >>= pathMain i p m o)
|
||||
<|> (skipBlockLine i >> pathMain i p m o a)
|
||||
<|> pure
|
||||
( map (<//> m) p
|
||||
<> [ p' <//> (o' <> ".hs")
|
||||
| p' <- p,
|
||||
o' <- filter (`notElem` a) o
|
||||
]
|
||||
)
|
||||
|
||||
(<//>) :: Text -> Text -> Text
|
||||
a <//> b = T.pack (T.unpack a </> T.unpack b)
|
||||
|
||||
infixr 5 <//>
|
||||
|
||||
parseSec :: Indent -> Text -> (Name -> Path -> Component) -> Parser [Component]
|
||||
|
11
test/Spec.hs
11
test/Spec.hs
@ -17,9 +17,7 @@ spec = do
|
||||
describe "Should Succeed"
|
||||
$ it "successfully parses executable section"
|
||||
$ exeSection ~> parseExe 0
|
||||
`shouldParse` [ Comp Exe "implicit-hie-exe" "app/Main.hs",
|
||||
Comp Exe "implicit-hie-exe" "app/Paths_implicit_hie.hs"
|
||||
]
|
||||
`shouldParse` [Comp Exe "gen-hie" "app/Main.hs"]
|
||||
describe "Should Succeed"
|
||||
$ it "successfully parses test section"
|
||||
$ testSection ~> parseTestSuite 0
|
||||
@ -50,8 +48,7 @@ spec = do
|
||||
`shouldParse` Package
|
||||
"implicit-hie"
|
||||
[ Comp Lib "" "src",
|
||||
Comp Exe "implicit-hie-exe" "app/Main.hs",
|
||||
Comp Exe "implicit-hie-exe" "app/Paths_implicit_hie.hs",
|
||||
Comp Exe "gen-hie" "app/Main.hs",
|
||||
Comp Test "implicit-hie-test" "test"
|
||||
]
|
||||
describe "Should Succeed"
|
||||
@ -92,9 +89,11 @@ spec = do
|
||||
|
||||
exeSection :: Text
|
||||
exeSection =
|
||||
"executable implicit-hie-exe\n\
|
||||
"executable gen-hie\n\
|
||||
\ other-modules:\n\
|
||||
\ Paths_implicit_hie\n\
|
||||
\ autogen-modules:\n\
|
||||
\ Paths_implicit_hie\n\
|
||||
\ hs-source-dirs:\n\
|
||||
\ app\n\
|
||||
\ ghc-options: -O2\n\
|
||||
|
@ -1,28 +1,22 @@
|
||||
cradle:
|
||||
cabal:
|
||||
- path: "src"
|
||||
- path: "./src"
|
||||
component: "lib:haskell-language-server"
|
||||
|
||||
- path: "exe/Main.hs"
|
||||
- path: "./exe/Main.hs"
|
||||
component: "haskell-language-server:exe:haskell-language-server"
|
||||
|
||||
- path: "exe/Arguments.hs"
|
||||
- path: "./exe/Arguments.hs"
|
||||
component: "haskell-language-server:exe:haskell-language-server"
|
||||
|
||||
- path: "exe/Paths_haskell_language_server.hs"
|
||||
component: "haskell-language-server:exe:haskell-language-server"
|
||||
|
||||
- path: "exe/Wrapper.hs"
|
||||
- path: "./exe/Wrapper.hs"
|
||||
component: "haskell-language-server:exe:haskell-language-server-wrapper"
|
||||
|
||||
- path: "exe/Arguments.hs"
|
||||
- path: "./exe/Arguments.hs"
|
||||
component: "haskell-language-server:exe:haskell-language-server-wrapper"
|
||||
|
||||
- path: "exe/Paths_haskell_language_server.hs"
|
||||
component: "haskell-language-server:exe:haskell-language-server-wrapper"
|
||||
|
||||
- path: "test/functional"
|
||||
- path: "./test/functional"
|
||||
component: "haskell-language-server:test:func-test"
|
||||
|
||||
- path: "test/utils"
|
||||
- path: "./test/utils"
|
||||
component: "haskell-language-server:lib:hls-test-utils"
|
||||
|
@ -6,8 +6,5 @@ cradle:
|
||||
- path: "./app/Main.hs"
|
||||
component: "implicit-hie:exe:gen-hie"
|
||||
|
||||
- path: "./app/Paths_implicit_hie.hs"
|
||||
component: "implicit-hie:exe:gen-hie"
|
||||
|
||||
- path: "./test"
|
||||
component: "implicit-hie:test:implicit-hie-test"
|
||||
|
Loading…
Reference in New Issue
Block a user