Merge pull request #10573 from 9999years/validate-verbose
[cabal.git] / cabal-testsuite / PackageTests / PkgConfigParse / setup.test.hs
blobedebd2d131c895dd77c9fac70e18220e1e3f0c90
1 import System.Directory
2 import Test.Cabal.Prelude
4 -- Test that invalid unicode in pkg-config output doesn't trip up cabal very much
5 main = cabalTest $ do
6 when isWindows $ do
7 sh <- fmap takeDirectory <$> liftIO (findExecutable "sh")
8 case sh of
9 Nothing -> skip "no sh"
10 Just sh' -> do
11 let sh'' = concatMap (\c -> case c of
12 '\\' -> "\\\\\\\\"
13 x -> [x]) sh'
14 void $ shell "sed" [ "-i", "-e", "s/FINDSH/" <> sh'' <> "/g", "pkg-config.shim"]
15 cdir <- testCurrentDir `fmap` getTestEnv
16 res <- cabal' "v2-build" ["--extra-prog-path="++cdir, "-v2"]
17 assertOutputContains "Some pkg-config packages have names containing invalid unicode: or" res