Skip to content

Commit 1c8c7a4

Browse files
committed
fix CPP OS detection
1 parent 564526b commit 1c8c7a4

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

fortran-src.cabal

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ library
150150
, temporary >=1.2 && <1.4
151151
, text >=1.2 && <2
152152
, uniplate >=1.6 && <2
153+
if os(windows)
154+
cpp-options: -DFS_DISABLE_WIN_BROKEN_TESTS
153155
default-language: Haskell2010
154156

155157
executable fortran-src
@@ -196,6 +198,8 @@ executable fortran-src
196198
, temporary >=1.2 && <1.4
197199
, text >=1.2 && <2
198200
, uniplate >=1.6 && <2
201+
if os(windows)
202+
cpp-options: -DFS_DISABLE_WIN_BROKEN_TESTS
199203
default-language: Haskell2010
200204

201205
test-suite spec
@@ -274,4 +278,6 @@ test-suite spec
274278
, temporary >=1.2 && <1.4
275279
, text >=1.2 && <2
276280
, uniplate >=1.6 && <2
281+
if os(windows)
282+
cpp-options: -DFS_DISABLE_WIN_BROKEN_TESTS
277283
default-language: Haskell2010

package.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,8 @@ tests:
9696
- deepseq >=1.4 && <1.5
9797
- hspec >=2.2 && <3
9898
- QuickCheck >=2.10 && <2.15
99+
100+
when:
101+
- condition: os(windows)
102+
cpp-options:
103+
- -DFS_DISABLE_WIN_BROKEN_TESTS

test/Language/Fortran/Parser/Fixed/Fortran77/IncludeSpec.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ spec =
5353
, bl st3Span . st st3Span ty2Span $ varGen' var2Span "b"
5454
])
5555
ex = ExpValue () expSpan (ValString "foo.f")
56-
#ifndef _WIN32
56+
#ifndef FS_DISABLE_WIN_BROKEN_TESTS
5757
-- 2022-08-18 raehik
5858
-- These tests failed on the Windows CI on GitHub with an unknown error. I'm
5959
-- assuming it's to do with 'SrcSpan's not matching -- specifically the
@@ -69,5 +69,5 @@ spec =
6969
pfParsed <- iParser [inc] source
7070
pfParsed `shouldBe` pf inc
7171
#else
72-
pure
72+
pure ()
7373
#endif

test/Language/Fortran/RewriterSpec.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ spec = do
222222
"999999999999999999999"
223223
]
224224
)
225-
#ifndef _WIN32
225+
#ifndef FS_DISABLE_WIN_BROKEN_TESTS
226226
-- TODO fails on Windows due to some line ending/spacing bug
227227
, ( workDir ++ "002_other.f"
228228
, [ Replacement
@@ -293,7 +293,7 @@ spec = do
293293
Nothing
294294
"replacementsmap-columnlimit"
295295
[ "001_foo.f"
296-
#ifndef mingw32_HOST_OS
296+
#ifndef FS_DISABLE_WIN_BROKEN_TESTS
297297
, "002_other.f"
298298
, "003_multiline.f"
299299
#endif

0 commit comments

Comments
 (0)