Tests: Fix findPandoc to work with Windows.

This commit is contained in:
John MacFarlane 2019-01-04 18:36:15 -08:00
parent ae4a5f4858
commit fc87925b77
2 changed files with 7 additions and 0 deletions

View file

@ -713,6 +713,8 @@ test-suite test-pandoc
Tests.Writers.FB2 Tests.Writers.FB2
Tests.Writers.Powerpoint Tests.Writers.Powerpoint
Tests.Writers.OOXML Tests.Writers.OOXML
if os(windows)
cpp-options: -D_WINDOWS
ghc-options: -rtsopts -Wall -fno-warn-unused-do-bind -threaded ghc-options: -rtsopts -Wall -fno-warn-unused-do-bind -threaded
default-language: Haskell2010 default-language: Haskell2010
other-extensions: NoImplicitPrelude other-extensions: NoImplicitPrelude

View file

@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE TypeSynonymInstances #-}
@ -100,7 +101,11 @@ findPandoc = do
"test-pandoc" : "build" : ps "test-pandoc" : "build" : ps
-> joinPath (reverse ps) </> "build" </> "pandoc" -> joinPath (reverse ps) </> "build" </> "pandoc"
_ -> error $ "findPandoc: could not find pandoc executable") _ -> error $ "findPandoc: could not find pandoc executable")
#ifdef _WINDOWS
</> "pandoc" <.> "exe"
#else
</> "pandoc" </> "pandoc"
#endif
found <- doesFileExist pandocPath found <- doesFileExist pandocPath
if found if found
then return pandocPath then return pandocPath