Skip to content

Commit 3f23b3b

Browse files
aniketdteodanciu
andcommitted
Use tasty-hspec in cardano-ledger-test
Co-authored-by: Teodora Danciu <[email protected]>
1 parent 24ef174 commit 3f23b3b

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

libs/cardano-ledger-test/cardano-ledger-test.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ test-suite cardano-ledger-test
141141

142142
build-depends:
143143
base,
144-
cardano-ledger-core:testlib,
145144
cardano-ledger-test,
146145
tasty,
146+
tasty-hspec,
147147

148148
benchmark bench
149149
type: exitcode-stdio-1.0

libs/cardano-ledger-test/test/Tests.hs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ module Main where
99

1010
import System.Environment (lookupEnv)
1111
import System.IO (hSetEncoding, stdout, utf8)
12-
import Test.Cardano.Ledger.Common (hspec)
1312
import qualified Test.Cardano.Ledger.Constrained.Conway.LedgerTypes.Tests as LedgerTypes
1413
import qualified Test.Cardano.Ledger.Constrained.Conway.MiniTrace as MiniTrace
1514
import qualified Test.Cardano.Ledger.Examples.AlonzoAPI as AlonzoAPI (tests)
@@ -23,17 +22,19 @@ import qualified Test.Cardano.Ledger.NoThunks as NoThunks
2322
import qualified Test.Cardano.Ledger.STS as ConstraintSTS
2423
import Test.Cardano.Ledger.Tickf (calcPoolDistOldEqualsNew)
2524
import Test.Tasty (TestTree, defaultMain, testGroup)
25+
import Test.Tasty.Hspec (testSpec)
2626

2727
main :: IO ()
2828
main = do
2929
hSetEncoding stdout utf8
3030
nightly <- lookupEnv "NIGHTLY"
31-
hspec MiniTrace.spec
31+
minitrace <- testSpec "MiniTrace" MiniTrace.spec
3232
case nightly of
33-
Nothing -> defaultMain $ testGroup "cardano-core" defaultTests
33+
Nothing -> do
34+
defaultMain $ testGroup "cardano-core" $ minitrace:defaultTests
3435
Just _ -> do
35-
hspec LedgerTypes.spec
36-
defaultMain $ testGroup "cardano-core - nightly" nightlyTests
36+
ledgerTypesSpec <- testSpec "LedgerTypes" LedgerTypes.spec
37+
defaultMain $ testGroup "cardano-core - nightly" $ ledgerTypesSpec:nightlyTests
3738

3839
defaultTests :: [TestTree]
3940
defaultTests =

0 commit comments

Comments
 (0)