Skip to content

Commit

Permalink
Disable local snocket tests on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
tdammers committed Jun 21, 2023
1 parent bac7aeb commit e9d6fb9
Showing 1 changed file with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import Control.Monad.ST.Unsafe (unsafeIOToST)
import Control.Tracer (nullTracer)
import Data.ByteString (ByteString)
import qualified Data.ByteString as BS
import Data.Maybe (catMaybes)
import Data.Word (Word32)
import Foreign.Marshal (copyBytes, free, mallocBytes)
import Foreign.Ptr (castPtr, plusPtr)
Expand All @@ -42,14 +41,14 @@ import Test.Tasty.QuickCheck
import Debug.Trace

tests :: TestTree
tests = testGroup "Ouroboros.Network.RawBearer" $
catMaybes
[ Just $ testProperty "raw bearer send receive simulated socket" prop_raw_bearer_send_and_receive_iosim
, Just $ testProperty "raw bearer send receive local socket" prop_raw_bearer_send_and_receive_local
, onlyIf (Socket.isSupportedSockAddr (Socket.SockAddrUnix "dummy")) $
testProperty "raw bearer send receive unix socket" prop_raw_bearer_send_and_receive_unix
, onlyIf (Socket.isSupportedSockAddr (Socket.SockAddrInet 10000 localhost)) $
testProperty "raw bearer send receive inet socket" prop_raw_bearer_send_and_receive_inet
tests = testGroup "Ouroboros.Network.RawBearer"
[ testProperty "raw bearer send receive simulated socket" prop_raw_bearer_send_and_receive_iosim
#if defined(mingw32_HOST_OS)
, testProperty "raw bearer send receive local socket" prop_raw_bearer_send_and_receive_local
#else
, testProperty "raw bearer send receive unix socket" prop_raw_bearer_send_and_receive_unix
#endif
, testProperty "raw bearer send receive inet socket" prop_raw_bearer_send_and_receive_inet
]

onlyIf :: Bool -> a -> Maybe a
Expand Down Expand Up @@ -91,6 +90,7 @@ prop_raw_bearer_send_and_receive_local serverInt clientInt msg =
let clientName = "local_socket_client.test" ++ show clientInt
#endif
cleanUp serverName
cleanUp clientName
let serverAddr = localAddressFromPath serverName
let clientAddr = localAddressFromPath clientName
rawBearerSendAndReceive
Expand All @@ -100,6 +100,7 @@ prop_raw_bearer_send_and_receive_local serverInt clientInt msg =
(Just clientAddr)
msg `finally` do
cleanUp serverName
cleanUp clientName
where
#if defined(mingw32_HOST_OS)
cleanUp _ = return ()
Expand Down

0 comments on commit e9d6fb9

Please sign in to comment.