-
Notifications
You must be signed in to change notification settings - Fork 479
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Test] Add do-notation support for 'TestNested' (#5948)
This refactors the `TestNested` machinery, so that 1. it supports listing tests in a `do`-block, which is something that I need in a different PR to update a huge `do`-block so that some of the tests there become golden 2. the API is more granular and pushes the user in the right direction I've also improved some of the tests while I was there and unified the formatting. Most of the tests we have use 4 spaces instead of 2, so I preserved that, we're probably going to run `fourmolu` over all the files eventually anyway and that'll make the indentation 2-space-based.
- Loading branch information
1 parent
6c6918c
commit 1afe001
Showing
130 changed files
with
653 additions
and
572 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
module Main (main) where | ||
|
||
import Test.Tasty | ||
import Test.Tasty.Extras (TestNested, runTestGroupNestedGhc) | ||
import Test.Tasty.Extras (TestNested, runTestNested, testNestedGhc) | ||
|
||
import PlutusBenchmark.Marlowe.BenchUtil (benchmarkToUPLC, rolePayoutBenchmarks, | ||
semanticsBenchmarks) | ||
|
@@ -30,8 +30,8 @@ mkBudgetTest validator [email protected]{..} = | |
|
||
-- Make a set of golden tests with results stored in a given subdirectory | ||
-- inside a subdirectory determined by the GHC version. | ||
testGroupGhcIn :: [FilePath] -> [TestNested] -> TestTree | ||
testGroupGhcIn path = runTestGroupNestedGhc (["marlowe", "test"] ++ path) | ||
runTestGhc :: [FilePath] -> [TestNested] -> TestTree | ||
runTestGhc path = runTestNested (["marlowe", "test"] ++ path) . pure . testNestedGhc | ||
|
||
main :: IO () | ||
main = do | ||
|
@@ -45,13 +45,13 @@ main = do | |
let allTests :: TestTree | ||
allTests = | ||
testGroup "plutus-benchmark Marlowe tests" | ||
[ testGroupGhcIn ["semantics"] $ | ||
[ runTestGhc ["semantics"] $ | ||
goldenSize "semantics" marloweValidator | ||
: [ goldenUEvalBudget name [value] | ||
| bench <- semanticsMBench | ||
, let (name, value) = mkBudgetTest marloweValidator bench | ||
] | ||
, testGroupGhcIn ["role-payout"] $ | ||
, runTestGhc ["role-payout"] $ | ||
goldenSize "role-payout" rolePayoutValidator | ||
: [ goldenUEvalBudget name [value] | ||
| bench <- rolePayoutMBench | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.