Skip to content

Commit 38e1ddc

Browse files
jasagredoMikolaj
authored andcommitted
Add shims on tests
(cherry picked from commit 7e0db76)
1 parent 33f6b06 commit 38e1ddc

30 files changed

+105
-15
lines changed
Binary file not shown.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
path = "FINDSH\sh.exe"
2+
args = "ghc-pkg"
113 KB
Binary file not shown.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
path = "FINDSH\sh.exe"
2+
args = "ghc"
Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
import Test.Cabal.Prelude
2+
import System.Directory
23

3-
main = setupAndCabalTest $ expectBrokenIfWindows 10179 $ do
4+
main = setupAndCabalTest $ do
5+
when isWindows $ do
6+
sh <- fmap takeDirectory <$> liftIO (findExecutable "sh")
7+
case sh of
8+
Nothing -> skip "no sh"
9+
Just sh' -> do
10+
let sh'' = concatMap (\c -> case c of
11+
'\\' -> "\\\\\\\\"
12+
x -> [x]) sh'
13+
void $ shell "sed" [ "-i", "-e", "s/FINDSH/" <> sh'' <> "/g", "ghc.shim", "ghc-pkg.shim"]
414
env <- getTestEnv
515
let cwd = testCurrentDir env
616
ghc_path <- programPathM ghcProgram
717
r <- withEnv [("WITH_GHC", Just ghc_path)]
8-
. fails $ setup' "configure" ["-w", cwd </> "ghc"]
18+
. fails $ setup' "configure" ["-w", cwd </> if isWindows then "ghc.exe" else "ghc" ]
919
assertOutputContains "is version 9999999" r
Binary file not shown.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
path = "FINDSH\sh.exe"
2+
args = "ghc-7.10"
Binary file not shown.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
path = "FINDSH\sh.exe"
2+
args = "ghc-pkg-ghc-7.10"
Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
import Test.Cabal.Prelude
2+
import System.Directory
23

3-
main = setupAndCabalTest $ expectBrokenIfWindows 10179 $ do
4+
main = setupAndCabalTest $ do
5+
when isWindows $ do
6+
sh <- fmap takeDirectory <$> liftIO (findExecutable "sh")
7+
case sh of
8+
Nothing -> skip "no sh"
9+
Just sh' -> do
10+
let sh'' = concatMap (\c -> case c of
11+
'\\' -> "\\\\\\\\"
12+
x -> [x]) sh'
13+
void $ shell "sed" [ "-i", "-e", "s/FINDSH/" <> sh'' <> "/g", "ghc-7.10.shim", "ghc-pkg-ghc-7.10.shim"]
414
env <- getTestEnv
515
let cwd = testCurrentDir env
616
ghc_path <- programPathM ghcProgram
717
r <- withEnv [("WITH_GHC", Just ghc_path)]
8-
. fails $ setup' "configure" ["-w", cwd </> "ghc-7.10"]
18+
. fails $ setup' "configure" ["-w", cwd </> if isWindows then "ghc-7.10.exe" else "ghc-7.10"]
919
assertOutputContains "is version 9999999" r

0 commit comments

Comments
 (0)