Skip to content

Commit

Permalink
Integration test for the bug from issue 4453
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Sydney Kerckhove committed Jan 28, 2019
1 parent 38ee7fe commit 1994bd3
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/integration/tests/4453-detailed/Main.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import StackTest
import System.Directory

main :: IO ()
main = do
removeDirIgnore ".stack-work"
stack ["test"]
4 changes: 4 additions & 0 deletions test/integration/tests/4453-detailed/files/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.cabal-sandbox/
cabal.sandbox.config
.stack-work/
dist/
30 changes: 30 additions & 0 deletions test/integration/tests/4453-detailed/files/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Copyright Axel Mannhardt (c) 2015

All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.

* Neither the name of Author name here nor the names of other
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6 changes: 6 additions & 0 deletions test/integration/tests/4453-detailed/files/src/Lib.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module Lib
( someFunc
) where

someFunc :: IO ()
someFunc = putStrLn "someFunc"
3 changes: 3 additions & 0 deletions test/integration/tests/4453-detailed/files/stack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
resolver: lts-11.22
packages:
- '.'
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: test-detailed-example
version: 0.1.0.0
build-type: Simple
cabal-version: >=1.20

library
hs-source-dirs: src
exposed-modules: Lib
build-depends: base >= 4.7 && < 5
default-language: Haskell2010

test-suite test-detailed-example-test
type: detailed-0.9
hs-source-dirs: test
test-module: Spec
build-depends: base >= 4.7,
Cabal >= 1.20
default-language: Haskell2010
21 changes: 21 additions & 0 deletions test/integration/tests/4453-detailed/files/test/Spec.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module Spec (tests) where

import Distribution.TestSuite

tests :: IO [Test]
tests = do
return [
test "foo" Pass
, test "bar" (Fail "It did not work out!")
]

test :: String -> Result -> Test
test name r = Test t
where
t = TestInstance {
run = return (Finished r)
, name = name
, tags = []
, options = []
, setOption = \_ _ -> Right t
}

0 comments on commit 1994bd3

Please sign in to comment.