-
Notifications
You must be signed in to change notification settings - Fork 697
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
3 changed files
with
13 additions
and
1 deletion.
There are no files selected for viewing
Binary file not shown.
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 = "pkg-config" |
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,7 +1,17 @@ | ||
import System.Directory | ||
import Test.Cabal.Prelude | ||
|
||
-- Test that invalid unicode in pkg-config output doesn't trip up cabal very much | ||
main = cabalTest $ expectBrokenIfWindows 10179 $ do | ||
main = cabalTest $ 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", "pkg-config.shim"] | ||
cdir <- testCurrentDir `fmap` getTestEnv | ||
res <- cabal' "v2-build" ["--extra-prog-path="++cdir, "-v2"] | ||
assertOutputContains "Some pkg-config packages have names containing invalid unicode: or" res |