forked from haskell/cabal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
105 additions
and
15 deletions.
There are no files selected for viewing
Binary file not shown.
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectory/ghc-pkg.shim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
path = "FINDSH\sh.exe" | ||
args = "ghc-pkg" |
Binary file not shown.
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectory/ghc.shim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
path = "FINDSH\sh.exe" | ||
args = "ghc" |
14 changes: 12 additions & 2 deletions
14
cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectory/setup.test.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,19 @@ | ||
import Test.Cabal.Prelude | ||
import System.Directory | ||
|
||
main = setupAndCabalTest $ expectBrokenIfWindows 10179 $ do | ||
main = setupAndCabalTest $ do | ||
when isWindows $ do | ||
sh <- fmap takeDirectory <$> liftIO (findExecutable "sh") | ||
case sh of | ||
Nothing -> skip "no sh" | ||
Just sh' -> do | ||
let sh'' = concatMap (\c -> case c of | ||
'\\' -> "\\\\\\\\" | ||
x -> [x]) sh' | ||
void $ shell "sed" [ "-i", "-e", "s/FINDSH/" <> sh'' <> "/g", "ghc.shim", "ghc-pkg.shim"] | ||
env <- getTestEnv | ||
let cwd = testCurrentDir env | ||
ghc_path <- programPathM ghcProgram | ||
r <- withEnv [("WITH_GHC", Just ghc_path)] | ||
. fails $ setup' "configure" ["-w", cwd </> "ghc"] | ||
. fails $ setup' "configure" ["-w", cwd </> if isWindows then "ghc.exe" else "ghc" ] | ||
assertOutputContains "is version 9999999" r |
Binary file added
BIN
+113 KB
cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryGhcVersion/ghc-7.10.exe
Binary file not shown.
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryGhcVersion/ghc-7.10.shim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
path = "FINDSH\sh.exe" | ||
args = "ghc-7.10" |
Binary file added
BIN
+113 KB
cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryGhcVersion/ghc-pkg-ghc-7.10.exe
Binary file not shown.
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryGhcVersion/ghc-pkg-ghc-7.10.shim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
path = "FINDSH\sh.exe" | ||
args = "ghc-pkg-ghc-7.10" |
14 changes: 12 additions & 2 deletions
14
cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryGhcVersion/setup.test.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,19 @@ | ||
import Test.Cabal.Prelude | ||
import System.Directory | ||
|
||
main = setupAndCabalTest $ expectBrokenIfWindows 10179 $ do | ||
main = setupAndCabalTest $ do | ||
when isWindows $ do | ||
sh <- fmap takeDirectory <$> liftIO (findExecutable "sh") | ||
case sh of | ||
Nothing -> skip "no sh" | ||
Just sh' -> do | ||
let sh'' = concatMap (\c -> case c of | ||
'\\' -> "\\\\\\\\" | ||
x -> [x]) sh' | ||
void $ shell "sed" [ "-i", "-e", "s/FINDSH/" <> sh'' <> "/g", "ghc-7.10.shim", "ghc-pkg-ghc-7.10.shim"] | ||
env <- getTestEnv | ||
let cwd = testCurrentDir env | ||
ghc_path <- programPathM ghcProgram | ||
r <- withEnv [("WITH_GHC", Just ghc_path)] | ||
. fails $ setup' "configure" ["-w", cwd </> "ghc-7.10"] | ||
. fails $ setup' "configure" ["-w", cwd </> if isWindows then "ghc-7.10.exe" else "ghc-7.10"] | ||
assertOutputContains "is version 9999999" r |
Binary file added
BIN
+113 KB
cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryVersion/ghc-7.10.exe
Binary file not shown.
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryVersion/ghc-7.10.shim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
path = "FINDSH\sh.exe" | ||
args = "ghc-7.10" |
Binary file added
BIN
+113 KB
cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryVersion/ghc-pkg-7.10.exe
Binary file not shown.
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryVersion/ghc-pkg-7.10.shim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
path = "FINDSH\sh.exe" | ||
args = "ghc-pkg-7.10" |
14 changes: 12 additions & 2 deletions
14
cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryVersion/setup.test.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,19 @@ | ||
import Test.Cabal.Prelude | ||
import System.Directory | ||
|
||
main = setupAndCabalTest $ expectBrokenIfWindows 10179 $ do | ||
main = setupAndCabalTest $ do | ||
when isWindows $ do | ||
sh <- fmap takeDirectory <$> liftIO (findExecutable "sh") | ||
case sh of | ||
Nothing -> skip "no sh" | ||
Just sh' -> do | ||
let sh'' = concatMap (\c -> case c of | ||
'\\' -> "\\\\\\\\" | ||
x -> [x]) sh' | ||
void $ shell "sed" [ "-i", "-e", "s/FINDSH/" <> sh'' <> "/g", "ghc-7.10.shim", "ghc-pkg-7.10.shim"] | ||
env <- getTestEnv | ||
let cwd = testCurrentDir env | ||
ghc_path <- programPathM ghcProgram | ||
r <- withEnv [("WITH_GHC", Just ghc_path)] | ||
. fails $ setup' "configure" ["-w", cwd </> "ghc-7.10"] | ||
. fails $ setup' "configure" ["-w", cwd </> if isWindows then "ghc-7.10.exe" else "ghc-7.10"] | ||
assertOutputContains "is version 9999999" r |
Binary file not shown.
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/GhcPkgGuess/Symlink/bin/ghc-pkg.shim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
path = "FINDSH\sh.exe" | ||
args = "bin\ghc-pkg" |
Binary file not shown.
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/GhcPkgGuess/Symlink/bin/ghc.shim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
path = "FINDSH\sh.exe" | ||
args = "ghc" |
18 changes: 15 additions & 3 deletions
18
cabal-testsuite/PackageTests/GhcPkgGuess/Symlink/setup.test.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,22 @@ | ||
import Test.Cabal.Prelude | ||
import System.Directory | ||
|
||
main = setupAndCabalTest $ expectBrokenIfWindows 10179 $ do | ||
withSymlink "bin/ghc" "ghc" $ do | ||
main = setupAndCabalTest $ do | ||
when isWindows $ do | ||
sh <- fmap takeDirectory <$> liftIO (findExecutable "sh") | ||
case sh of | ||
Nothing -> skip "no sh" | ||
Just sh' -> do | ||
let sh'' = concatMap (\c -> case c of | ||
'\\' -> "\\\\\\\\" | ||
x -> [x]) sh' | ||
void $ shell "sed" [ "-i", "-e", "s/FINDSH/" <> sh'' <> "/g", "bin/ghc.shim", "bin/ghc-pkg.shim"] | ||
(if isWindows | ||
then withSymlink "bin/ghc.exe" "ghc.exe" . withSymlink "bin/ghc.shim" "ghc.shim" . withSymlink "bin/ghc" "ghc" | ||
else withSymlink "bin/ghc" "ghc") $ do | ||
env <- getTestEnv | ||
let cwd = testCurrentDir env | ||
ghc_path <- programPathM ghcProgram | ||
r <- withEnv [("WITH_GHC", Just ghc_path)] | ||
. fails $ setup' "configure" ["-w", cwd </> "ghc"] | ||
. fails $ setup' "configure" ["-w", cwd </> if isWindows then "ghc.exe" else "ghc"] | ||
assertOutputContains "is version 9999999" r |
Binary file added
BIN
+113 KB
cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkGhcVersion/bin/ghc-7.10.exe
Binary file not shown.
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkGhcVersion/bin/ghc-7.10.shim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
path = "FINDSH\sh.exe" | ||
args = "ghc" |
Binary file added
BIN
+113 KB
cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkGhcVersion/bin/ghc-pkg-7.10.exe
Binary file not shown.
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkGhcVersion/bin/ghc-pkg-7.10.shim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
path = "FINDSH\sh.exe" | ||
args = "bin\ghc-pkg-7.10" |
18 changes: 15 additions & 3 deletions
18
cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkGhcVersion/setup.test.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,22 @@ | ||
import Test.Cabal.Prelude | ||
import System.Directory | ||
|
||
main = setupAndCabalTest $ expectBrokenIfWindows 10179 $ do | ||
withSymlink "bin/ghc-7.10" "ghc" $ do | ||
main = setupAndCabalTest $ do | ||
when isWindows $ do | ||
sh <- fmap takeDirectory <$> liftIO (findExecutable "sh") | ||
case sh of | ||
Nothing -> skip "no sh" | ||
Just sh' -> do | ||
let sh'' = concatMap (\c -> case c of | ||
'\\' -> "\\\\\\\\" | ||
x -> [x]) sh' | ||
void $ shell "sed" [ "-i", "-e", "s/FINDSH/" <> sh'' <> "/g", "bin/ghc-7.10.shim", "bin/ghc-pkg-7.10.shim"] | ||
(if isWindows | ||
then withSymlink "bin/ghc-7.10.exe" "ghc.exe" . withSymlink "bin/ghc-7.10.shim" "ghc.shim" . withSymlink "bin/ghc-7.10" "ghc" | ||
else withSymlink "bin/ghc-7.10" "ghc") $ do | ||
env <- getTestEnv | ||
let cwd = testCurrentDir env | ||
ghc_path <- programPathM ghcProgram | ||
r <- withEnv [("WITH_GHC", Just ghc_path)] | ||
. fails $ setup' "configure" ["-w", cwd </> "ghc"] | ||
. fails $ setup' "configure" ["-w", cwd </> if isWindows then "ghc.exe" else "ghc"] | ||
assertOutputContains "is version 9999999" r |
Binary file added
BIN
+113 KB
cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkVersion/bin/ghc-7.10.exe
Binary file not shown.
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkVersion/bin/ghc-7.10.shim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
path = "FINDSH\sh.exe" | ||
args = "ghc" |
Binary file added
BIN
+113 KB
cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkVersion/bin/ghc-pkg-ghc-7.10.exe
Binary file not shown.
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkVersion/bin/ghc-pkg-ghc-7.10.shim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
path = "FINDSH\sh.exe" | ||
args = "bin\ghc-pkg-ghc-7.10" |
18 changes: 15 additions & 3 deletions
18
cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkVersion/setup.test.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,22 @@ | ||
import Test.Cabal.Prelude | ||
import System.Directory | ||
|
||
main = setupAndCabalTest $ expectBrokenIfWindows 10179 $ do | ||
withSymlink "bin/ghc-7.10" "ghc" $ do | ||
main = setupAndCabalTest $ do | ||
when isWindows $ do | ||
sh <- fmap takeDirectory <$> liftIO (findExecutable "sh") | ||
case sh of | ||
Nothing -> skip "no sh" | ||
Just sh' -> do | ||
let sh'' = concatMap (\c -> case c of | ||
'\\' -> "\\\\\\\\" | ||
x -> [x]) sh' | ||
void $ shell "sed" [ "-i", "-e", "s/FINDSH/" <> sh'' <> "/g", "bin/ghc-7.10.shim", "bin/ghc-pkg-ghc-7.10.shim"] | ||
(if isWindows | ||
then withSymlink "bin/ghc-7.10.exe" "ghc.exe" . withSymlink "bin/ghc-7.10.shim" "ghc.shim" . withSymlink "bin/ghc-7.10" "ghc" | ||
else withSymlink "bin/ghc-7.10" "ghc") $ do | ||
env <- getTestEnv | ||
let cwd = testCurrentDir env | ||
ghc_path <- programPathM ghcProgram | ||
r <- withEnv [("WITH_GHC", Just ghc_path)] | ||
. fails $ setup' "configure" ["-w", cwd </> "ghc"] | ||
. fails $ setup' "configure" ["-w", cwd </> if isWindows then "ghc.exe" else "ghc"] | ||
assertOutputContains "is version 9999999" r |