mirror of
https://github.com/haskell/ghcide.git
synced 2024-11-30 01:22:34 +03:00
Add a test case involving -fno-warn-missing-signatures (#720)
* Only enable non-fatal warnings * Revert the change since it has been taken care of in #738
This commit is contained in:
parent
e837b2d0c5
commit
599b27a32b
8
test/data/ignore-fatal/IgnoreFatal.hs
Normal file
8
test/data/ignore-fatal/IgnoreFatal.hs
Normal file
@ -0,0 +1,8 @@
|
||||
-- "missing signature" is declared a fatal warning in the cabal file,
|
||||
-- but is ignored in this module.
|
||||
|
||||
{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
|
||||
|
||||
module IgnoreFatal where
|
||||
|
||||
a = 'a'
|
1
test/data/ignore-fatal/cabal.project
Normal file
1
test/data/ignore-fatal/cabal.project
Normal file
@ -0,0 +1 @@
|
||||
packages: ignore-fatal.cabal
|
4
test/data/ignore-fatal/hie.yaml
Normal file
4
test/data/ignore-fatal/hie.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
cradle:
|
||||
cabal:
|
||||
- path: "."
|
||||
component: "lib:ignore-fatal"
|
10
test/data/ignore-fatal/ignore-fatal.cabal
Normal file
10
test/data/ignore-fatal/ignore-fatal.cabal
Normal file
@ -0,0 +1,10 @@
|
||||
name: ignore-fatal
|
||||
version: 1.0.0
|
||||
build-type: Simple
|
||||
cabal-version: >= 1.2
|
||||
|
||||
library
|
||||
build-depends: base
|
||||
exposed-modules: IgnoreFatal
|
||||
hs-source-dirs: .
|
||||
ghc-options: -Werror=missing-signatures
|
@ -2786,6 +2786,7 @@ haddockTests
|
||||
cradleTests :: TestTree
|
||||
cradleTests = testGroup "cradle"
|
||||
[testGroup "dependencies" [sessionDepsArePickedUp]
|
||||
,testGroup "ignore-fatal" [ignoreFatalWarning]
|
||||
,testGroup "loading" [loadCradleOnlyonce]
|
||||
,testGroup "multi" [simpleMultiTest, simpleMultiTest2]
|
||||
]
|
||||
@ -2875,6 +2876,13 @@ withoutStackEnv s =
|
||||
restore var Nothing = unsetEnv var
|
||||
restore var (Just val) = setEnv var val True
|
||||
|
||||
ignoreFatalWarning :: TestTree
|
||||
ignoreFatalWarning = testCase "ignore-fatal-warning" $ withoutStackEnv $ runWithExtraFiles "ignore-fatal" $ \dir -> do
|
||||
let srcPath = dir </> "IgnoreFatal.hs"
|
||||
src <- liftIO $ readFileUtf8 srcPath
|
||||
_ <- createDoc srcPath "haskell" src
|
||||
expectNoMoreDiagnostics 5
|
||||
|
||||
simpleMultiTest :: TestTree
|
||||
simpleMultiTest = testCase "simple-multi-test" $ withoutStackEnv $ runWithExtraFiles "multi" $ \dir -> do
|
||||
let aPath = dir </> "a/A.hs"
|
||||
|
Loading…
Reference in New Issue
Block a user