From 75376d0fb778bf6f8bed1f33cf08cca1f774b0f6 Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Wed, 22 Jul 2020 12:07:34 +0900 Subject: [PATCH] adding "devel" flag to run test cases which may fail. --- network.cabal | 6 ++++++ tests/Network/SocketSpec.hs | 2 ++ 2 files changed, 8 insertions(+) diff --git a/network.cabal b/network.cabal index 957f7ebf..5a7b6c3f 100644 --- a/network.cabal +++ b/network.cabal @@ -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: @@ -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 diff --git a/tests/Network/SocketSpec.hs b/tests/Network/SocketSpec.hs index 76d32972..c2ee34b8 100644 --- a/tests/Network/SocketSpec.hs +++ b/tests/Network/SocketSpec.hs @@ -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) @@ -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