Skip to content

Commit

Permalink
Add pendingOnMacOS helper
Browse files Browse the repository at this point in the history
  • Loading branch information
Anviking committed Jun 14, 2021
1 parent 08f4889 commit e629dcf
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/test-utils/cardano-wallet-test-utils.cabal
Expand Up @@ -57,6 +57,7 @@ library
exposed-modules:
Test.Hspec.Extra
Test.QuickCheck.Extra
Test.Utils.Darwin
Test.Utils.FilePath
Test.Utils.Laws
Test.Utils.Laws.PartialOrd
Expand Down
27 changes: 27 additions & 0 deletions lib/test-utils/src/Test/Utils/Darwin.hs
@@ -0,0 +1,27 @@
-- |
-- Copyright: © 2018-2021 IOHK
-- License: Apache-2.0
--
-- Utility function for making test suites pass on Darwin/macOS.

module Test.Utils.Darwin
( pendingOnMacOS
) where

import Prelude

import Control.Monad
( when )
import System.Info
( os )
import Test.Hspec.Core.Spec
( pendingWith )
import Test.Hspec.Expectations
( Expectation, HasCallStack )

-- | Mark test pending if running on macOS
pendingOnMacOS :: HasCallStack => String -> Expectation
pendingOnMacOS reason = when isDarwin $ pendingWith reason

isDarwin :: Bool
isDarwin = os == "darwin"

0 comments on commit e629dcf

Please sign in to comment.