Skip to content

Commit 94e08f1

Browse files
committed
Fix cabal formatter test flags
1 parent e5fd0f2 commit 94e08f1

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

Diff for: haskell-language-server.cabal

+2
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ test-suite hls-cabal-fmt-plugin-tests
144144

145145
if flag(isolateCabalfmtTests)
146146
build-tool-depends: cabal-fmt:cabal-fmt ^>=0.1.6
147+
cpp-options: -Dhls_isolate_cabalfmt_tests
147148

148149
-----------------------------
149150
-- cabal-gild plugin
@@ -194,6 +195,7 @@ test-suite hls-cabal-gild-plugin-tests
194195

195196
if flag(isolateCabalGildTests)
196197
build-tool-depends: cabal-gild:cabal-gild ^>=1.1
198+
cpp-options: -Dhls_isolate_cabalgild_tests
197199

198200
-----------------------------
199201
-- cabal plugin

Diff for: plugins/hls-cabal-fmt-plugin/test/Main.hs

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import Test.Hls
1212
data CabalFmtFound = Found | NotFound
1313

1414
isTestIsolated :: Bool
15-
#if isolateTests
15+
#if hls_isolate_cabalfmt_tests
1616
isTestIsolated = True
1717
#else
1818
isTestIsolated = False
@@ -21,7 +21,7 @@ isTestIsolated = False
2121
isCabalFmtFound :: IO CabalFmtFound
2222
isCabalFmtFound = case isTestIsolated of
2323
True -> pure Found
24-
False-> do
24+
False -> do
2525
cabalFmt <- findExecutable "cabal-fmt"
2626
pure $ maybe NotFound (const Found) cabalFmt
2727

@@ -51,7 +51,7 @@ cabalFmtGolden :: CabalFmtFound -> TestName -> FilePath -> FilePath -> (TextDocu
5151
cabalFmtGolden NotFound title _ _ _ =
5252
testCase title $
5353
assertFailure $ "Couldn't find cabal-fmt on PATH or this is not an isolated run. "
54-
<> "Use cabal flag 'isolateTests' to make it isolated or install cabal-fmt locally."
54+
<> "Use cabal flag 'isolateCabalFmtTests' to make it isolated or install cabal-fmt locally."
5555
cabalFmtGolden Found title path desc act = goldenWithCabalDocFormatter def cabalFmtPlugin "cabal-fmt" conf title testDataDir path desc "cabal" act
5656
where
5757
conf = def

Diff for: plugins/hls-cabal-gild-plugin/test/Main.hs

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import Test.Hls
1212
data CabalGildFound = Found | NotFound
1313

1414
isTestIsolated :: Bool
15-
#if isolateTests
15+
#if hls_isolate_cabalgild_tests
1616
isTestIsolated = True
1717
#else
1818
isTestIsolated = False
@@ -21,7 +21,7 @@ isTestIsolated = False
2121
isCabalFmtFound :: IO CabalGildFound
2222
isCabalFmtFound = case isTestIsolated of
2323
True -> pure Found
24-
False-> do
24+
False -> do
2525
cabalGild <- findExecutable "cabal-gild"
2626
pure $ maybe NotFound (const Found) cabalGild
2727

@@ -49,7 +49,7 @@ cabalGildGolden :: CabalGildFound -> TestName -> FilePath -> FilePath -> (TextDo
4949
cabalGildGolden NotFound title _ _ _ =
5050
testCase title $
5151
assertFailure $ "Couldn't find cabal-gild on PATH or this is not an isolated run. "
52-
<> "Use cabal flag 'isolateTests' to make it isolated or install cabal-gild locally."
52+
<> "Use cabal flag 'isolateCabalGildTests' to make it isolated or install cabal-gild locally."
5353
cabalGildGolden Found title path desc act = goldenWithCabalDocFormatter def cabalGildPlugin "cabal-gild" conf title testDataDir path desc "cabal" act
5454
where
5555
conf = def

0 commit comments

Comments
 (0)