Commit 25b18bf4 authored by Oleg Grenrus's avatar Oleg Grenrus
Browse files

Fix windows build

- findExecutable sh
- Use single quotes for cabal exec
parent 87d55fbd
......@@ -25,8 +25,10 @@ import Distribution.Verbosity (normal)
-- Third party modules.
import Control.Concurrent.Async (withAsync, wait)
import Control.Exception (bracket)
import Data.Maybe (fromMaybe)
import System.Directory
( canonicalizePath
, findExecutable
, getDirectoryContents
, getTemporaryDirectory
, doesDirectoryExist
......@@ -195,7 +197,8 @@ runTestCase assertResult tc = do
bracket createWorkDirectory (removeWorkDirectory doRemove) $ \workDirectory -> do
-- Run
let scriptDirectory = workDirectory </> tcShouldX tc
testResult <- run scriptDirectory "/bin/sh" [ "-e", tcName tc]
sh <- fmap (fromMaybe $ error "Cannot find 'sh' executable") $ findExecutable "sh"
testResult <- run scriptDirectory sh [ "-e", tcName tc]
-- Assert that we got what we expected
assertResult testResult
mustMatch testResult "stdout" (trStdOut testResult) (tcStdOutPath tc)
......
......@@ -11,4 +11,4 @@ $GHC_PKG list | grep -v "my-0.1"
# When run inside 'cabal-exec' the 'sandbox hc-pkg list' sub-command
# should find the library.
cabal exec sh -- -c "cd subdir && $CABAL sandbox hc-pkg list" | grep "my-0.1"
cabal exec sh -- -c 'cd subdir && $CABAL sandbox hc-pkg list' | grep "my-0.1"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment