aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjneira <atreyu.bbb@gmail.com>2020-05-09 16:04:26 +0200
committerDaniel Gröber (dxld) <dxld@darkboxed.org>2020-05-20 09:53:08 +0200
commitcbd080a3a6107ec02e2129127d0676291cab19c6 (patch)
tree04dda40bfb729847724e57f8c8f02f781cbc740f
parentc4bfdcedc4620d2dfceb57925d9ced35544cf682 (diff)
Use existing functions to handle .exe
-rw-r--r--tests/ProgramsTest.hs13
1 files changed, 5 insertions, 8 deletions
diff --git a/tests/ProgramsTest.hs b/tests/ProgramsTest.hs
index 4e7c557..1c28ced 100644
--- a/tests/ProgramsTest.hs
+++ b/tests/ProgramsTest.hs
@@ -5,6 +5,7 @@
import Control.Monad
import Data.List
+import Distribution.Simple.Utils (dropExeExtension)
import System.Directory
import System.Environment
import System.Exit
@@ -20,7 +21,7 @@ import Symlink (createSymbolicLink)
main :: IO ()
main = do
-- In windows, program name ends with .exe
- prog_name <- dropExtension <$> getProgName
+ prog_name <- dropExeExtension <$> getProgName
args <- getArgs
case prog_name of
"programs-test"
@@ -52,15 +53,11 @@ do_test = do
withSystemTempDirectory "c-h-programs-test" $ \tmpdir -> do
- let ext = case System.Info.os of
- "mingw32" -> "exe"
- _ -> ""
-
forM_ ["8.6.5", "8.4.4"] $ \ver -> do
- let ghc = tmpdir </> "ghc-" ++ ver <.> ext
- let ghc_pkg = tmpdir </> "ghc-pkg-" ++ ver <.> ext
- let haddock = tmpdir </> "haddock-" ++ ver <.> ext
+ let ghc = tmpdir </> "ghc-" ++ ver <.> exeExtension
+ let ghc_pkg = tmpdir </> "ghc-pkg-" ++ ver <.> exeExtension
+ let haddock = tmpdir </> "haddock-" ++ ver <.> exeExtension
let progs = defaultPrograms { ghcProgram = ghc }
let link = case System.Info.os of