From fc87925b772b3e0e47cbdb30878e0288f1bb6853 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 4 Jan 2019 18:36:15 -0800 Subject: [PATCH] Tests: Fix findPandoc to work with Windows. --- pandoc.cabal | 2 ++ test/Tests/Helpers.hs | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/pandoc.cabal b/pandoc.cabal index c23552c08..5efd740cd 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -713,6 +713,8 @@ test-suite test-pandoc Tests.Writers.FB2 Tests.Writers.Powerpoint Tests.Writers.OOXML + if os(windows) + cpp-options: -D_WINDOWS ghc-options: -rtsopts -Wall -fno-warn-unused-do-bind -threaded default-language: Haskell2010 other-extensions: NoImplicitPrelude diff --git a/test/Tests/Helpers.hs b/test/Tests/Helpers.hs index 3a8058114..5e3afe0c7 100644 --- a/test/Tests/Helpers.hs +++ b/test/Tests/Helpers.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeSynonymInstances #-} @@ -100,7 +101,11 @@ findPandoc = do "test-pandoc" : "build" : ps -> joinPath (reverse ps) "build" "pandoc" _ -> error $ "findPandoc: could not find pandoc executable") +#ifdef _WINDOWS + "pandoc" <.> "exe" +#else "pandoc" +#endif found <- doesFileExist pandocPath if found then return pandocPath