-
Notifications
You must be signed in to change notification settings - Fork 843
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4114 from SkyWriter/feature/self-exec
Fixes self-executing scripts not piping plan construction errors from runhaskell to terminal, issue #3942
- Loading branch information
Showing
6 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
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
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
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,16 @@ | ||
import Control.Monad (unless) | ||
import Data.List (isInfixOf) | ||
import StackTest | ||
|
||
planFailure :: String | ||
planFailure = | ||
"While constructing the build plan, the following exceptions were encountered:" | ||
|
||
main :: IO () | ||
main = do | ||
stackErrStderr ["./script.hs"] (expectMessage planFailure) | ||
|
||
expectMessage :: String -> String -> IO () | ||
expectMessage msg stderr = do | ||
unless (words msg `isInfixOf` words stderr) | ||
(error $ "Expected a warning: \n" ++ show msg) |
3 changes: 3 additions & 0 deletions
3
test/integration/tests/3942-solver-error-output/files/.gitignore
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,3 @@ | ||
.stack-work/ | ||
*.cabal | ||
stack.yaml |
5 changes: 5 additions & 0 deletions
5
test/integration/tests/3942-solver-error-output/files/script.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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env stack | ||
-- stack runhaskell --stack-yaml test-stack.yml --package cloud-seeder | ||
|
||
main :: IO () | ||
main = putStrLn "yo" |
11 changes: 11 additions & 0 deletions
11
test/integration/tests/3942-solver-error-output/files/test-stack.yml
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,11 @@ | ||
resolver: lts-8.22 | ||
|
||
packages: | ||
- location: | ||
git: git@github.com:cjdev/cloudseeder.git | ||
commit: c7068f25c41bcc0b4bdfc9b38ee5b05b5caefae5 | ||
extra-dep: true | ||
|
||
flags: {} | ||
|
||
extra-package-dbs: [] |