Skip to content

Commit

Permalink
Stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
newhoggy committed Jun 28, 2021
1 parent 67e3d6b commit b0979f6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions cardano-testnet/cardano-testnet.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ test-suite cardano-testnet-tests
, hedgehog-extras
, filepath
, tasty
, tasty-expected-failure
, tasty-hedgehog

other-modules: Spec.Plutus
Expand Down
1 change: 1 addition & 0 deletions cardano-testnet/configuration
1 change: 1 addition & 0 deletions cardano-testnet/scripts
15 changes: 14 additions & 1 deletion cardano-testnet/test/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,33 @@ module Main
( main
) where

import Data.Function ((&))
import Prelude

import qualified Data.List as L
import qualified System.Environment as E
import qualified System.IO.Unsafe as IO
import qualified Test.Tasty as T
import qualified Test.Tasty.ExpectedFailure as T
import qualified Test.Tasty.Ingredients as T
import qualified Test.Tasty.Hedgehog as H

import qualified Spec.Plutus

inNix :: Bool
inNix = IO.unsafePerformIO $ do
L.elem "NIX_STORE" . fmap fst <$> E.getEnvironment

ignoreInNix :: T.TestTree -> T.TestTree
ignoreInNix tree = if inNix
then T.ignoreTestBecause "Disabled in Nix" tree
else tree

tests :: IO T.TestTree
tests = do
pure $ T.testGroup "test/Spec.hs"
[ T.testGroup "Spec"
[ H.testProperty "Plutus" Spec.Plutus.hprop_plutus
[ H.testProperty "Plutus" Spec.Plutus.hprop_plutus & ignoreInNix
]
]

Expand Down

0 comments on commit b0979f6

Please sign in to comment.