Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding "devel" flag to run test cases which may fail. #471

Merged
merged 1 commit into from
Jul 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions network.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ tested-with: GHC == 8.0.2
, GHC == 8.8.3
, GHC == 8.10.1

flag devel
description: using tests for developers
default: False

library
default-language: Haskell2010
exposed-modules:
Expand Down Expand Up @@ -126,6 +130,8 @@ test-suite spec
default-language: Haskell2010
hs-source-dirs: tests
main-is: Spec.hs
if flag(devel)
cpp-options: -DDEVELOPMENT
other-modules:
Network.Test.Common
Network.SocketSpec
Expand Down
2 changes: 2 additions & 0 deletions tests/Network/SocketSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ spec = do
bind sock (addrAddress addr) `shouldThrow` anyIOException
-}

#ifdef DEVELOPMENT
it "successfully binds to an ipv6 socket" $ do
addr:_ <- getAddrInfo (Just hints) (Just serverAddr6) Nothing
sock <- socket (addrFamily addr) (addrSocketType addr) (addrProtocol addr)
Expand All @@ -67,6 +68,7 @@ spec = do
addr:_ <- getAddrInfo (Just hints) (Just "::6") Nothing
sock <- socket (addrFamily addr) (addrSocketType addr) (addrProtocol addr)
bind sock (addrAddress addr) `shouldThrow` anyIOException
#endif

it "successfully binds to a unix socket, twice" $ do
withSystemTempDirectory "haskell-network" $ \path -> do
Expand Down