From 626371627c5c96234b7129b3993e8772acfaa7d9 Mon Sep 17 00:00:00 2001 From: lykimq Date: Fri, 7 Apr 2023 11:46:09 +0200 Subject: [PATCH 1/8] Alcotezt-UX: fix invocation headers, opt. titles for [consensus] in all protocols --- manifest/main.ml | 1 - .../test/integration/consensus/dune | 1 - .../test/integration/consensus/test_baking.ml | 21 ++++---- .../consensus/test_consensus_key.ml | 34 ++++++------ .../consensus/test_deactivation.ml | 7 ++- .../integration/consensus/test_delegation.ml | 7 ++- .../consensus/test_double_baking.ml | 7 ++- .../consensus/test_double_endorsement.ml | 7 ++- .../consensus/test_double_preendorsement.ml | 7 ++- .../integration/consensus/test_endorsement.ml | 7 ++- .../consensus/test_frozen_deposits.ml | 17 +++--- .../consensus/test_helpers_rpcs.ml | 7 ++- .../test/integration/consensus/test_main.ml | 53 ------------------- .../consensus/test_participation.ml | 13 +++-- .../consensus/test_preendorsement.ml | 7 ++- .../test/integration/consensus/test_seed.ml | 12 +++-- .../test/integration/consensus/dune | 1 - .../test/integration/consensus/test_baking.ml | 23 ++++---- .../consensus/test_consensus_key.ml | 36 ++++++------- .../consensus/test_deactivation.ml | 9 ++-- .../integration/consensus/test_delegation.ml | 9 ++-- .../consensus/test_double_baking.ml | 9 ++-- .../consensus/test_double_endorsement.ml | 7 ++- .../consensus/test_double_preendorsement.ml | 9 ++-- .../integration/consensus/test_endorsement.ml | 7 ++- .../consensus/test_frozen_deposits.ml | 17 +++--- .../consensus/test_helpers_rpcs.ml | 9 ++-- .../test/integration/consensus/test_main.ml | 53 ------------------- .../consensus/test_participation.ml | 15 +++--- .../consensus/test_preendorsement.ml | 9 ++-- .../test/integration/consensus/test_seed.ml | 14 ++--- .../test/integration/consensus/dune | 1 - .../test/integration/consensus/test_baking.ml | 21 ++++---- .../consensus/test_consensus_key.ml | 34 ++++++------ .../consensus/test_deactivation.ml | 7 ++- .../integration/consensus/test_delegation.ml | 7 ++- .../consensus/test_double_baking.ml | 7 ++- .../consensus/test_double_endorsement.ml | 7 ++- .../consensus/test_double_preendorsement.ml | 7 ++- .../integration/consensus/test_endorsement.ml | 7 ++- .../consensus/test_frozen_deposits.ml | 15 ++++-- .../consensus/test_helpers_rpcs.ml | 7 ++- .../test/integration/consensus/test_main.ml | 53 ------------------- .../consensus/test_participation.ml | 13 +++-- .../consensus/test_preendorsement.ml | 7 ++- .../test/integration/consensus/test_seed.ml | 12 +++-- 46 files changed, 313 insertions(+), 327 deletions(-) delete mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_main.ml delete mode 100644 src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_main.ml delete mode 100644 src/proto_alpha/lib_protocol/test/integration/consensus/test_main.ml diff --git a/manifest/main.ml b/manifest/main.ml index a921b634e442..d6f635794eb9 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -4574,7 +4574,6 @@ end = struct let _integration_consensus = tezt [ - "test_main"; "test_baking"; "test_consensus_key"; "test_deactivation"; diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/dune b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/dune index e43d7b45a08c..4a436a53b8d4 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/dune +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/dune @@ -28,7 +28,6 @@ -open Tezos_protocol_016_PtMumbai_parameters -open Tezos_protocol_plugin_016_PtMumbai) (modules - test_main test_baking test_consensus_key test_deactivation diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_baking.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_baking.ml index ed011ef165a2..aa9128cf30f9 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_baking.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_baking.ml @@ -28,7 +28,8 @@ (** Testing ------- Component: Protocol (baking) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_baking.ml Subject: Rewards and bakers. Tests based on RPCs. *) @@ -432,27 +433,27 @@ let test_committee_sampling () = let tests = [ Tztest.tztest "cycle" `Quick test_cycle; - Tztest.tztest - "test_bake_n_cycles for 12 cycles" - `Quick - (test_bake_n_cycles 12); + Tztest.tztest "bake_n_cycles for 12 cycles" `Quick (test_bake_n_cycles 12); Tztest.tztest "voting_power" `Quick test_voting_power_cache; Tztest.tztest "the fixed baking reward is given after a bake" `Quick test_basic_baking_reward; Tztest.tztest - "test that the block producer gets the bonus while the payload producer \ - gets the baking reward " + "the block producer gets the bonus while the payload producer gets the \ + baking reward " `Quick test_rewards_block_and_payload_producer; Tztest.tztest - "test that a delegate with 8000 tez can bake" + "a delegate with 8000 tez can bake" `Quick (test_enough_active_stake_to_bake ~has_active_stake:true); Tztest.tztest - "test that a delegate with 7999 tez cannot bake" + "a delegate with 7999 tez cannot bake" `Quick (test_enough_active_stake_to_bake ~has_active_stake:false); - Tztest.tztest "test committee sampling" `Quick test_committee_sampling; + Tztest.tztest "committee sampling" `Quick test_committee_sampling; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("baking", tests)] |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_consensus_key.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_consensus_key.ml index 103124ab73ea..4fd27b63d971 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_consensus_key.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_consensus_key.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (delegate_storage) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_consensus_key.ml Subject: consistency of the [Drain_delegate] operation *) @@ -231,72 +232,73 @@ let tests = Tztest. [ tztest - "test drain delegate high balance, excluding ck, ck delegates" + "drain delegate high balance, excluding ck, ck delegates" `Quick (test_drain_delegate ~low_balance:false ~exclude_ck:true ~ck_delegates:true); tztest - "test drain delegate high balance, excluding ck, ck does not delegate" + "drain delegate high balance, excluding ck, ck does not delegate" `Quick (test_drain_delegate ~low_balance:false ~exclude_ck:true ~ck_delegates:false); tztest - "test drain delegate high balance, with ck, ck delegates" + "drain delegate high balance, with ck, ck delegates" `Quick (test_drain_delegate ~low_balance:false ~exclude_ck:false ~ck_delegates:true); tztest - "test drain delegate high balance, with ck, ck does not delegate" + "drain delegate high balance, with ck, ck does not delegate" `Quick (test_drain_delegate ~low_balance:false ~exclude_ck:false ~ck_delegates:false); tztest - "test drain delegate low balance, excluding ck, ck delegates" + "drain delegate low balance, excluding ck, ck delegates" `Quick (test_drain_delegate ~low_balance:true ~exclude_ck:true ~ck_delegates:true); tztest - "test drain delegate low balance, excluding ck, ck does not delegate" + "drain delegate low balance, excluding ck, ck does not delegate" `Quick (test_drain_delegate ~low_balance:true ~exclude_ck:true ~ck_delegates:false); tztest - "test drain delegate low balance, with ck, ck delegates" + "drain delegate low balance, with ck, ck delegates" `Quick (test_drain_delegate ~low_balance:true ~exclude_ck:false ~ck_delegates:true); tztest - "test drain delegate low balance, with ck, ck does not delegate" + "drain delegate low balance, with ck, ck does not delegate" `Quick (test_drain_delegate ~low_balance:true ~exclude_ck:false ~ck_delegates:false); tztest - "test empty drain delegate excluding ck" + "empty drain delegate excluding ck" `Quick (test_drain_empty_delegate ~exclude_ck:true); tztest - "test empty drain delegate with ck" + "empty drain delegate with ck" `Quick (test_drain_empty_delegate ~exclude_ck:false); - tztest "test tz4 consensus key" `Quick test_tz4_consensus_key; - tztest - "test endorsement with ck" - `Quick - test_endorsement_with_consensus_key; + tztest "tz4 consensus key" `Quick test_tz4_consensus_key; + tztest "endorsement with ck" `Quick test_endorsement_with_consensus_key; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("consensus key", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_deactivation.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_deactivation.ml index 8e8cedc20c18..e288e389d930 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_deactivation.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_deactivation.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_deactivation.ml Subject: After a given number of cycles during which a delegate has not made use of its baking and endorsing rights, its account will be deactivated for validator selection. To bake/endorse @@ -354,3 +355,7 @@ let tests = `Quick test_a_really_deactivated_account_is_not_in_the_committee; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("deactivation", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_delegation.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_delegation.ml index 59e597336444..de512b351f02 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_delegation.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_delegation.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (delegation) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_delegation.ml Subject: - Properties on bootstrap contracts (self-delegation, cannot delete/change their delegate (as opposed to contracts not-being-delegate which can do these), bootstrap manager @@ -1612,3 +1613,7 @@ let tests_delegate_registration = (******************************************************************************) let tests = tests_bootstrap_contracts @ tests_delegate_registration + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("delegation", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_double_baking.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_double_baking.ml index 3944df29b9dc..1740f0e8ac62 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_double_baking.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_double_baking.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (double baking) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_double_baking.ml Subject: A double baking evidence operation may be injected when it has been observed that a baker baked two different blocks at the same level and same round. @@ -461,3 +462,7 @@ let tests = `Quick test_valid_double_endorsing_followed_by_double_baking; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("double baking", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_double_endorsement.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_double_endorsement.ml index 39aa32571bfe..a0c6d2cd2663 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_double_endorsement.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_double_endorsement.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (double endorsement) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_double_endorsement.ml Subject: Double endorsement evidence operation may happen when an endorser endorsed two different blocks on the same level. *) @@ -509,3 +510,7 @@ let tests = `Quick test_freeze_more_with_low_balance; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("double endorsement", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_double_preendorsement.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_double_preendorsement.ml index 6d3ec64f42a9..d72304bd6ba3 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_double_preendorsement.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_double_preendorsement.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (double preendorsement) in Full_construction & Application modes - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_double_preendorsement.ml Subject: These tests target different cases for double preendorsement *) open Protocol @@ -399,3 +400,7 @@ let tests = let baking_mode = Block.Baking end) in AppMode.tests @ ConstrMode.tests + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("double preendorsement", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_endorsement.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_endorsement.ml index cda3ce637c0a..788718b5ee07 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_endorsement.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_endorsement.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (endorsement) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_endorsement.ml Subject: Endorsing a block adds an extra layer of confidence to the Tezos' PoS algorithm. The block endorsing operation must be included in the following block. @@ -612,3 +613,7 @@ let tests = `Quick test_endorsement_grandparent_full_construction; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("endorsement", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_frozen_deposits.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_frozen_deposits.ml index e5f392920dd1..89135a13ef54 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_frozen_deposits.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_frozen_deposits.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (frozen_deposits) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_frozen_deposits.ml Subject: consistency of frozen deposits and the [set_deposits_limit] operation *) @@ -680,7 +681,7 @@ let test_error_is_thrown_when_smaller_upper_bound_for_frozen_window () = let tests = Tztest. [ - tztest "test invariants" `Quick test_invariants; + tztest "invariants" `Quick test_invariants; tztest "set deposits limit to 0%" `Quick (test_set_limit 0); tztest "set deposits limit to 5%" `Quick (test_set_limit 5); tztest "set a too high deposits limit" `Quick test_set_too_high_limit; @@ -698,19 +699,23 @@ let tests = `Quick test_unfreeze_deposits_after_deactivation; tztest - "frozen deposits with delegation" + "deposits with delegation" `Quick test_frozen_deposits_with_delegation; tztest - "test frozen deposits with overdelegation" + "frozen deposits with overdelegation" `Quick test_frozen_deposits_with_overdelegation; tztest - "test set limit with overdelegation" + "set limit with overdelegation" `Quick test_set_limit_with_overdelegation; tztest - "test error is thrown when the frozen window is smaller" + "error is thrown when the frozen window is smaller" `Quick test_error_is_thrown_when_smaller_upper_bound_for_frozen_window; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("frozen deposits", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_helpers_rpcs.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_helpers_rpcs.ml index 3f1ec561e735..4d87aeb74497 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_helpers_rpcs.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_helpers_rpcs.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (Helpers RPCs) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_helpers_rpcs.ml Subject: On RPCs. *) @@ -61,3 +62,7 @@ let test_baking_rights () = return_unit let tests = [Tztest.tztest "baking_rights" `Quick test_baking_rights] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("helpers rpcs", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_main.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_main.ml deleted file mode 100644 index e5341ec77bb0..000000000000 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_main.ml +++ /dev/null @@ -1,53 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2021 Nomadic Labs *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -(** Testing - ------- - Component: Protocol - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/main.exe - Subject: Entrypoint -*) - -let () = - Alcotest_lwt.run - ~__FILE__ - "protocol > integration > consensus" - [ - (Protocol.name ^ ": endorsement", Test_endorsement.tests); - (Protocol.name ^ ": preendorsement", Test_preendorsement.tests); - (Protocol.name ^ ": double endorsement", Test_double_endorsement.tests); - ( Protocol.name ^ ": double preendorsement", - Test_double_preendorsement.tests ); - (Protocol.name ^ ": double baking", Test_double_baking.tests); - (Protocol.name ^ ": seed", Test_seed.tests); - (Protocol.name ^ ": baking", Test_baking.tests); - (Protocol.name ^ ": delegation", Test_delegation.tests); - (Protocol.name ^ ": deactivation", Test_deactivation.tests); - (Protocol.name ^ ": helpers rpcs", Test_helpers_rpcs.tests); - (Protocol.name ^ ": participation monitoring", Test_participation.tests); - (Protocol.name ^ ": frozen deposits", Test_frozen_deposits.tests); - (Protocol.name ^ ": consensus key", Test_consensus_key.tests); - ] - |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_participation.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_participation.ml index d4d2de0a5923..1e48f7407254 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_participation.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_participation.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (participation monitoring) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_participation.ml Subject: Participation monitoring in Tenderbake *) @@ -192,12 +193,16 @@ let test_participation_rpc () = let tests = [ Tztest.tztest - "test insufficient participation" + "insufficient participation" `Quick (test_participation ~sufficient_participation:false); Tztest.tztest - "test minimal participation" + "minimal participation" `Quick (test_participation ~sufficient_participation:true); - Tztest.tztest "test participation RPC" `Quick test_participation_rpc; + Tztest.tztest "participation RPC" `Quick test_participation_rpc; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("participation monitoring", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_preendorsement.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_preendorsement.ml index e26246056d95..8aab79358b88 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_preendorsement.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_preendorsement.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (preendorsement) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_preendorsement.ml *) open Protocol @@ -242,3 +243,7 @@ let tests = `Quick test_preendorsement_for_next_round; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("preendorsement", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_seed.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_seed.ml index 993edf276dfd..6e647bc2cb2c 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_seed.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/test_seed.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (seed) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_seed.ml Subject: - seed_nonce_hash included in some blocks - revelation operation of seed_nonce that should correspond to each seed_nonce_hash @@ -633,11 +634,14 @@ let tests = "revelation_missing_and_late" `Quick test_revelation_missing_and_late; - Tztest.tztest "test unrevealed" `Quick test_unrevealed; + Tztest.tztest "unrevealed" `Quick test_unrevealed; Tztest.tztest - "test_early_incorrect_unverified_correct_already_vdf" + "early_incorrect_unverified_correct_already_vdf" `Quick test_early_incorrect_unverified_correct_already_vdf; - Tztest.tztest "test VDF status" `Quick test_vdf_status; + Tztest.tztest "VDF status" `Quick test_vdf_status; Tztest.tztest "for_cycle cycle bounds" `Quick test_cycle_bounds; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("seed", tests)] |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/dune b/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/dune index 02b4e560515f..1b9883735dd8 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/dune +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/dune @@ -28,7 +28,6 @@ -open Tezos_protocol_017_PtNairob_parameters -open Tezos_protocol_plugin_017_PtNairob) (modules - test_main test_baking test_consensus_key test_deactivation diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_baking.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_baking.ml index 8dd765e5fcab..6d2ee39ec61b 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_baking.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_baking.ml @@ -28,9 +28,8 @@ (** Testing ------- Component: Protocol (baking) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ - -- test "^baking$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_baking.ml Subject: Rewards and bakers. Tests based on RPCs. *) @@ -430,27 +429,27 @@ let test_committee_sampling () = let tests = [ Tztest.tztest "cycle" `Quick test_cycle; - Tztest.tztest - "test_bake_n_cycles for 12 cycles" - `Quick - (test_bake_n_cycles 12); + Tztest.tztest "bake_n_cycles for 12 cycles" `Quick (test_bake_n_cycles 12); Tztest.tztest "voting_power" `Quick test_voting_power_cache; Tztest.tztest "the fixed baking reward is given after a bake" `Quick test_basic_baking_reward; Tztest.tztest - "test that the block producer gets the bonus while the payload producer \ - gets the baking reward " + "the block producer gets the bonus while the payload producer gets the \ + baking reward " `Quick test_rewards_block_and_payload_producer; Tztest.tztest - "test that a delegate with 8000 tez can bake" + "a delegate with 8000 tez can bake" `Quick (test_enough_active_stake_to_bake ~has_active_stake:true); Tztest.tztest - "test that a delegate with 7999 tez cannot bake" + "a delegate with 7999 tez cannot bake" `Quick (test_enough_active_stake_to_bake ~has_active_stake:false); - Tztest.tztest "test committee sampling" `Quick test_committee_sampling; + Tztest.tztest "committee sampling" `Quick test_committee_sampling; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("baking", tests)] |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_consensus_key.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_consensus_key.ml index 912d7b5e758c..b6a4e9ec6ab1 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_consensus_key.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_consensus_key.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Protocol (delegate_storage) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ - -- test "^consensus key$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_consensus_key.ml Subject: consistency of the [Drain_delegate] operation *) @@ -233,72 +232,73 @@ let tests = Tztest. [ tztest - "test drain delegate high balance, excluding ck, ck delegates" + "drain delegate high balance, excluding ck, ck delegates" `Quick (test_drain_delegate ~low_balance:false ~exclude_ck:true ~ck_delegates:true); tztest - "test drain delegate high balance, excluding ck, ck does not delegate" + "drain delegate high balance, excluding ck, ck does not delegate" `Quick (test_drain_delegate ~low_balance:false ~exclude_ck:true ~ck_delegates:false); tztest - "test drain delegate high balance, with ck, ck delegates" + "drain delegate high balance, with ck, ck delegates" `Quick (test_drain_delegate ~low_balance:false ~exclude_ck:false ~ck_delegates:true); tztest - "test drain delegate high balance, with ck, ck does not delegate" + "drain delegate high balance, with ck, ck does not delegate" `Quick (test_drain_delegate ~low_balance:false ~exclude_ck:false ~ck_delegates:false); tztest - "test drain delegate low balance, excluding ck, ck delegates" + "drain delegate low balance, excluding ck, ck delegates" `Quick (test_drain_delegate ~low_balance:true ~exclude_ck:true ~ck_delegates:true); tztest - "test drain delegate low balance, excluding ck, ck does not delegate" + "drain delegate low balance, excluding ck, ck does not delegate" `Quick (test_drain_delegate ~low_balance:true ~exclude_ck:true ~ck_delegates:false); tztest - "test drain delegate low balance, with ck, ck delegates" + "drain delegate low balance, with ck, ck delegates" `Quick (test_drain_delegate ~low_balance:true ~exclude_ck:false ~ck_delegates:true); tztest - "test drain delegate low balance, with ck, ck does not delegate" + "drain delegate low balance, with ck, ck does not delegate" `Quick (test_drain_delegate ~low_balance:true ~exclude_ck:false ~ck_delegates:false); tztest - "test empty drain delegate excluding ck" + "empty drain delegate excluding ck" `Quick (test_drain_empty_delegate ~exclude_ck:true); tztest - "test empty drain delegate with ck" + "empty drain delegate with ck" `Quick (test_drain_empty_delegate ~exclude_ck:false); - tztest "test tz4 consensus key" `Quick test_tz4_consensus_key; - tztest - "test endorsement with ck" - `Quick - test_endorsement_with_consensus_key; + tztest "tz4 consensus key" `Quick test_tz4_consensus_key; + tztest "endorsement with ck" `Quick test_endorsement_with_consensus_key; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("consensus key", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_deactivation.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_deactivation.ml index 393330708fea..3686dbdb049f 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_deactivation.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_deactivation.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Protocol - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ - -- test "^deactivation$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_deactivation.ml Subject: After a given number of cycles during which a delegate has not made use of its baking and endorsing rights, its account will be deactivated for validator selection. To bake/endorse @@ -356,3 +355,7 @@ let tests = `Quick test_a_really_deactivated_account_is_not_in_the_committee; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("deactivation", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_delegation.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_delegation.ml index 898aec642f72..b8f3550093a3 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_delegation.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_delegation.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Protocol (delegation) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ - -- test "^delegation$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_delegation.ml Subject: - Properties on bootstrap contracts (self-delegation, cannot delete/change their delegate (as opposed to contracts not-being-delegate which can do these), bootstrap manager @@ -1614,3 +1613,7 @@ let tests_delegate_registration = (******************************************************************************) let tests = tests_bootstrap_contracts @ tests_delegate_registration + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("delegation", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_double_baking.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_double_baking.ml index ce777f8cbf17..ba29f86bafa3 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_double_baking.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_double_baking.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Protocol (double baking) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ - -- test "^double baking$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_double_baking.ml Subject: A double baking evidence operation may be injected when it has been observed that a baker baked two different blocks at the same level and same round. @@ -461,3 +460,7 @@ let tests = `Quick test_valid_double_endorsing_followed_by_double_baking; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("double baking", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_double_endorsement.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_double_endorsement.ml index b62fb4320b0a..5cd36103bb10 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_double_endorsement.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_double_endorsement.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (double endorsement) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/consensus/main.exe -- --test "alpha: double endorsement" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_double_endorsement.ml Subject: Double endorsement evidence operation may happen when an endorser endorsed two different blocks on the same level. *) @@ -555,3 +556,7 @@ let tests = `Quick test_freeze_more_with_low_balance; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("double endorsement", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_double_preendorsement.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_double_preendorsement.ml index f1c8be80ebb2..22eab296fbaf 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_double_preendorsement.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_double_preendorsement.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Protocol (double preendorsement) in Full_construction & Application modes - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ - -- test "^double preendorsement$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_double_preendorsement.ml Subject: These tests target different cases for double preendorsement *) open Protocol @@ -400,3 +399,7 @@ let tests = let baking_mode = Block.Baking end) in AppMode.tests @ ConstrMode.tests + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("double preendorsement", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_endorsement.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_endorsement.ml index ea39907d1ed4..247eab77e387 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_endorsement.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_endorsement.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (endorsement) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/consensus/main.exe -- --test "alpha: endorsement" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_endorsement.ml Subject: Endorsing a block adds an extra layer of confidence to the Tezos' PoS algorithm. The block endorsing operation must be included in the following block. @@ -684,3 +685,7 @@ let tests = `Quick (test_endorsement_threshold ~sufficient_threshold:false); ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("endorsement", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_frozen_deposits.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_frozen_deposits.ml index 9ca124ba1376..7763c95d8b76 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_frozen_deposits.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_frozen_deposits.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Protocol (frozen_deposits) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ - -- test "^frozen deposits$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_frozen_deposits.ml Subject: consistency of frozen deposits and the [set_deposits_limit] operation *) @@ -653,7 +652,7 @@ let test_error_is_thrown_when_smaller_upper_bound_for_frozen_window () = let tests = Tztest. [ - tztest "test invariants" `Quick test_invariants; + tztest "invariants" `Quick test_invariants; tztest "set deposits limit to 0%" `Quick (test_set_limit 0); tztest "set deposits limit to 5%" `Quick (test_set_limit 5); tztest "unset deposits limit" `Quick test_unset_limit; @@ -674,15 +673,19 @@ let tests = `Quick test_frozen_deposits_with_delegation; tztest - "test frozen deposits with overdelegation" + "frozen deposits with overdelegation" `Quick test_frozen_deposits_with_overdelegation; tztest - "test set limit with overdelegation" + "set limit with overdelegation" `Quick test_set_limit_with_overdelegation; tztest - "test error is thrown when the frozen window is smaller" + "error is thrown when the frozen window is smaller" `Quick test_error_is_thrown_when_smaller_upper_bound_for_frozen_window; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("frozen deposits", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_helpers_rpcs.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_helpers_rpcs.ml index 367aa44d4ecf..0933bff5d619 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_helpers_rpcs.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_helpers_rpcs.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Protocol (Helpers RPCs) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ - -- test "^helpers rpcs$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_helpers_rpcs.ml Subject: On RPCs. *) @@ -63,3 +62,7 @@ let test_baking_rights () = return_unit let tests = [Tztest.tztest "baking_rights" `Quick test_baking_rights] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("helpers rpcs", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_main.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_main.ml deleted file mode 100644 index 9976e9dc5115..000000000000 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_main.ml +++ /dev/null @@ -1,53 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2021 Nomadic Labs *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -(** Testing - ------- - Component: Protocol - Invocation: dune runtest src/proto_alpha/lib_protocol/test/integration/consensus - Subject: Entrypoint -*) - -let () = - Alcotest_lwt.run - ~__FILE__ - "protocol > integration > consensus" - [ - (Protocol.name ^ ": endorsement", Test_endorsement.tests); - (Protocol.name ^ ": preendorsement", Test_preendorsement.tests); - (Protocol.name ^ ": double endorsement", Test_double_endorsement.tests); - ( Protocol.name ^ ": double preendorsement", - Test_double_preendorsement.tests ); - (Protocol.name ^ ": double baking", Test_double_baking.tests); - (Protocol.name ^ ": seed", Test_seed.tests); - (Protocol.name ^ ": baking", Test_baking.tests); - (Protocol.name ^ ": delegation", Test_delegation.tests); - (Protocol.name ^ ": deactivation", Test_deactivation.tests); - (Protocol.name ^ ": helpers rpcs", Test_helpers_rpcs.tests); - (Protocol.name ^ ": participation monitoring", Test_participation.tests); - (Protocol.name ^ ": frozen deposits", Test_frozen_deposits.tests); - (Protocol.name ^ ": consensus key", Test_consensus_key.tests); - ] - |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_participation.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_participation.ml index d8e845126282..f6e8d5e9f46c 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_participation.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_participation.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Protocol (participation monitoring) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ - -- test "^participation" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_participation.ml Subject: Participation monitoring in Tenderbake *) @@ -194,12 +193,16 @@ let test_participation_rpc () = let tests = [ Tztest.tztest - "test insufficient participation" + "insufficient participation" `Quick (test_participation ~sufficient_participation:false); Tztest.tztest - "test minimal participation" + "minimal participation" `Quick (test_participation ~sufficient_participation:true); - Tztest.tztest "test participation RPC" `Quick test_participation_rpc; + Tztest.tztest "participation RPC" `Quick test_participation_rpc; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("participation monitoring", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_preendorsement.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_preendorsement.ml index 88a60cead11f..f7d622387f23 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_preendorsement.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_preendorsement.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Protocol (preendorsement) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ - -- test "^preendorsement$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_preendorsement.ml *) open Protocol @@ -236,3 +235,7 @@ let tests = `Quick test_preendorsement_for_next_round; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("preendorsement", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_seed.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_seed.ml index b6e6f6cc21e2..93df78ac53a6 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_seed.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/test_seed.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Protocol (seed) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ - -- test "^seed$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_seed.ml Subject: - seed_nonce_hash included in some blocks - revelation operation of seed_nonce that should correspond to each seed_nonce_hash @@ -639,11 +638,14 @@ let tests = "revelation_missing_and_late" `Quick test_revelation_missing_and_late; - Tztest.tztest "test unrevealed" `Quick test_unrevealed; + Tztest.tztest "unrevealed" `Quick test_unrevealed; Tztest.tztest - "test_early_incorrect_unverified_correct_already_vdf" + "early_incorrect_unverified_correct_already_vdf" `Quick test_early_incorrect_unverified_correct_already_vdf; - Tztest.tztest "test VDF status" `Quick test_vdf_status; + Tztest.tztest "VDF status" `Quick test_vdf_status; Tztest.tztest "for_cycle cycle bounds" `Quick test_cycle_bounds; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("seed", tests)] |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/dune b/src/proto_alpha/lib_protocol/test/integration/consensus/dune index da75d5a3f0b5..92fe3e3fbd1a 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/dune +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/dune @@ -27,7 +27,6 @@ -open Tezos_protocol_alpha_parameters -open Tezos_protocol_plugin_alpha) (modules - test_main test_baking test_consensus_key test_deactivation diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/test_baking.ml b/src/proto_alpha/lib_protocol/test/integration/consensus/test_baking.ml index 4cad6fc77b99..02a41c865a12 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_baking.ml +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/test_baking.ml @@ -28,7 +28,8 @@ (** Testing ------- Component: Protocol (baking) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/consensus/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_baking.ml Subject: Rewards and bakers. Tests based on RPCs. *) @@ -428,27 +429,27 @@ let test_committee_sampling () = let tests = [ Tztest.tztest "cycle" `Quick test_cycle; - Tztest.tztest - "test_bake_n_cycles for 12 cycles" - `Quick - (test_bake_n_cycles 12); + Tztest.tztest "bake_n_cycles for 12 cycles" `Quick (test_bake_n_cycles 12); Tztest.tztest "voting_power" `Quick test_voting_power_cache; Tztest.tztest "the fixed baking reward is given after a bake" `Quick test_basic_baking_reward; Tztest.tztest - "test that the block producer gets the bonus while the payload producer \ - gets the baking reward " + "the block producer gets the bonus while the payload producer gets the \ + baking reward " `Quick test_rewards_block_and_payload_producer; Tztest.tztest - "test that a delegate with 8000 tez can bake" + "a delegate with 8000 tez can bake" `Quick (test_enough_active_stake_to_bake ~has_active_stake:true); Tztest.tztest - "test that a delegate with 7999 tez cannot bake" + "a delegate with 7999 tez cannot bake" `Quick (test_enough_active_stake_to_bake ~has_active_stake:false); - Tztest.tztest "test committee sampling" `Quick test_committee_sampling; + Tztest.tztest "committee sampling" `Quick test_committee_sampling; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("baking", tests)] |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/test_consensus_key.ml b/src/proto_alpha/lib_protocol/test/integration/consensus/test_consensus_key.ml index 138b8c6f36d9..0c89d84b30be 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_consensus_key.ml +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/test_consensus_key.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (delegate_storage) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/consensus/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_consensus_key.ml Subject: consistency of the [Drain_delegate] operation *) @@ -231,72 +232,73 @@ let tests = Tztest. [ tztest - "test drain delegate high balance, excluding ck, ck delegates" + "drain delegate high balance, excluding ck, ck delegates" `Quick (test_drain_delegate ~low_balance:false ~exclude_ck:true ~ck_delegates:true); tztest - "test drain delegate high balance, excluding ck, ck does not delegate" + "drain delegate high balance, excluding ck, ck does not delegate" `Quick (test_drain_delegate ~low_balance:false ~exclude_ck:true ~ck_delegates:false); tztest - "test drain delegate high balance, with ck, ck delegates" + "drain delegate high balance, with ck, ck delegates" `Quick (test_drain_delegate ~low_balance:false ~exclude_ck:false ~ck_delegates:true); tztest - "test drain delegate high balance, with ck, ck does not delegate" + "drain delegate high balance, with ck, ck does not delegate" `Quick (test_drain_delegate ~low_balance:false ~exclude_ck:false ~ck_delegates:false); tztest - "test drain delegate low balance, excluding ck, ck delegates" + "drain delegate low balance, excluding ck, ck delegates" `Quick (test_drain_delegate ~low_balance:true ~exclude_ck:true ~ck_delegates:true); tztest - "test drain delegate low balance, excluding ck, ck does not delegate" + "drain delegate low balance, excluding ck, ck does not delegate" `Quick (test_drain_delegate ~low_balance:true ~exclude_ck:true ~ck_delegates:false); tztest - "test drain delegate low balance, with ck, ck delegates" + "drain delegate low balance, with ck, ck delegates" `Quick (test_drain_delegate ~low_balance:true ~exclude_ck:false ~ck_delegates:true); tztest - "test drain delegate low balance, with ck, ck does not delegate" + "drain delegate low balance, with ck, ck does not delegate" `Quick (test_drain_delegate ~low_balance:true ~exclude_ck:false ~ck_delegates:false); tztest - "test empty drain delegate excluding ck" + "empty drain delegate excluding ck" `Quick (test_drain_empty_delegate ~exclude_ck:true); tztest - "test empty drain delegate with ck" + "empty drain delegate with ck" `Quick (test_drain_empty_delegate ~exclude_ck:false); - tztest "test tz4 consensus key" `Quick test_tz4_consensus_key; - tztest - "test endorsement with ck" - `Quick - test_endorsement_with_consensus_key; + tztest "tz4 consensus key" `Quick test_tz4_consensus_key; + tztest "endorsement with ck" `Quick test_endorsement_with_consensus_key; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("consensus key", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/test_deactivation.ml b/src/proto_alpha/lib_protocol/test/integration/consensus/test_deactivation.ml index c9a10f20ae2b..387d8337413f 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_deactivation.ml +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/test_deactivation.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/consensus/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_deactivation.ml Subject: After a given number of cycles during which a delegate has not made use of its baking and endorsing rights, its account will be deactivated for validator selection. To bake/endorse @@ -354,3 +355,7 @@ let tests = `Quick test_a_really_deactivated_account_is_not_in_the_committee; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("deactivation", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/test_delegation.ml b/src/proto_alpha/lib_protocol/test/integration/consensus/test_delegation.ml index 1a79b1059891..c8cbfdea636f 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_delegation.ml +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/test_delegation.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (delegation) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/consensus/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_delegation.ml Subject: - Properties on bootstrap contracts (self-delegation, cannot delete/change their delegate (as opposed to contracts not-being-delegate which can do these), bootstrap manager @@ -1612,3 +1613,7 @@ let tests_delegate_registration = (******************************************************************************) let tests = tests_bootstrap_contracts @ tests_delegate_registration + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("delegation", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_baking.ml b/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_baking.ml index ef55679db504..83222fafe1d6 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_baking.ml +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_baking.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (double baking) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/consensus/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_double_baking.ml Subject: A double baking evidence operation may be injected when it has been observed that a baker baked two different blocks at the same level and same round. @@ -459,3 +460,7 @@ let tests = `Quick test_valid_double_endorsing_followed_by_double_baking; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("double baking", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_endorsement.ml b/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_endorsement.ml index b9afa6674739..5bad9e140bec 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_endorsement.ml +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_endorsement.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (double endorsement) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/consensus/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_double_endorsement.ml Subject: Double endorsement evidence operation may happen when an endorser endorsed two different blocks on the same level. *) @@ -555,3 +556,7 @@ let tests = `Quick test_freeze_more_with_low_balance; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("double endorsement", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_preendorsement.ml b/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_preendorsement.ml index b4fe816037fb..eeeff16940ce 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_preendorsement.ml +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_preendorsement.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (double preendorsement) in Full_construction & Application modes - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/consensus/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_double_preendorsement.ml Subject: These tests target different cases for double preendorsement *) open Protocol @@ -398,3 +399,7 @@ let tests = let baking_mode = Block.Baking end) in AppMode.tests @ ConstrMode.tests + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("double preendorsement", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/test_endorsement.ml b/src/proto_alpha/lib_protocol/test/integration/consensus/test_endorsement.ml index 78e2ba88c2b5..bd832aa286f8 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_endorsement.ml +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/test_endorsement.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (endorsement) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/consensus/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_endorsement.ml Subject: Endorsing a block adds an extra layer of confidence to the Tezos' PoS algorithm. The block endorsing operation must be included in the following block. @@ -684,3 +685,7 @@ let tests = `Quick (test_endorsement_threshold ~sufficient_threshold:false); ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("endorsement", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/test_frozen_deposits.ml b/src/proto_alpha/lib_protocol/test/integration/consensus/test_frozen_deposits.ml index 94a3822c88f1..302e2398530d 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_frozen_deposits.ml +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/test_frozen_deposits.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (frozen_deposits) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/consensus/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_frozen_deposits.ml Subject: consistency of frozen deposits and the [set_deposits_limit] operation *) @@ -651,7 +652,7 @@ let test_error_is_thrown_when_smaller_upper_bound_for_frozen_window () = let tests = Tztest. [ - tztest "test invariants" `Quick test_invariants; + tztest "invariants" `Quick test_invariants; tztest "set deposits limit to 0%" `Quick (test_set_limit 0); tztest "set deposits limit to 5%" `Quick (test_set_limit 5); tztest "unset deposits limit" `Quick test_unset_limit; @@ -672,15 +673,19 @@ let tests = `Quick test_frozen_deposits_with_delegation; tztest - "test frozen deposits with overdelegation" + "frozen deposits with overdelegation" `Quick test_frozen_deposits_with_overdelegation; tztest - "test set limit with overdelegation" + "set limit with overdelegation" `Quick test_set_limit_with_overdelegation; tztest - "test error is thrown when the frozen window is smaller" + "error is thrown when the frozen window is smaller" `Quick test_error_is_thrown_when_smaller_upper_bound_for_frozen_window; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("frozen deposits", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/test_helpers_rpcs.ml b/src/proto_alpha/lib_protocol/test/integration/consensus/test_helpers_rpcs.ml index c4f592c553d1..b2110081e2d7 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_helpers_rpcs.ml +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/test_helpers_rpcs.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (Helpers RPCs) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/consensus/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_helpers_rpcs.ml Subject: On RPCs. *) @@ -61,3 +62,7 @@ let test_baking_rights () = return_unit let tests = [Tztest.tztest "baking_rights" `Quick test_baking_rights] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("helpers rpcs", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/test_main.ml b/src/proto_alpha/lib_protocol/test/integration/consensus/test_main.ml deleted file mode 100644 index 7e4523930be7..000000000000 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_main.ml +++ /dev/null @@ -1,53 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2021 Nomadic Labs *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -(** Testing - ------- - Component: Protocol - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/consensus/main.exe - Subject: Entrypoint -*) - -let () = - Alcotest_lwt.run - ~__FILE__ - "protocol > integration > consensus" - [ - (Protocol.name ^ ": endorsement", Test_endorsement.tests); - (Protocol.name ^ ": preendorsement", Test_preendorsement.tests); - (Protocol.name ^ ": double endorsement", Test_double_endorsement.tests); - ( Protocol.name ^ ": double preendorsement", - Test_double_preendorsement.tests ); - (Protocol.name ^ ": double baking", Test_double_baking.tests); - (Protocol.name ^ ": seed", Test_seed.tests); - (Protocol.name ^ ": baking", Test_baking.tests); - (Protocol.name ^ ": delegation", Test_delegation.tests); - (Protocol.name ^ ": deactivation", Test_deactivation.tests); - (Protocol.name ^ ": helpers rpcs", Test_helpers_rpcs.tests); - (Protocol.name ^ ": participation monitoring", Test_participation.tests); - (Protocol.name ^ ": frozen deposits", Test_frozen_deposits.tests); - (Protocol.name ^ ": consensus key", Test_consensus_key.tests); - ] - |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/test_participation.ml b/src/proto_alpha/lib_protocol/test/integration/consensus/test_participation.ml index 6f7014e75e51..b01e0c0d3b21 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_participation.ml +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/test_participation.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (participation monitoring) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/consensus/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_participation.ml Subject: Participation monitoring in Tenderbake *) @@ -192,12 +193,16 @@ let test_participation_rpc () = let tests = [ Tztest.tztest - "test insufficient participation" + "insufficient participation" `Quick (test_participation ~sufficient_participation:false); Tztest.tztest - "test minimal participation" + "minimal participation" `Quick (test_participation ~sufficient_participation:true); - Tztest.tztest "test participation RPC" `Quick test_participation_rpc; + Tztest.tztest "participation RPC" `Quick test_participation_rpc; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("participation monitoring", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/test_preendorsement.ml b/src/proto_alpha/lib_protocol/test/integration/consensus/test_preendorsement.ml index f453b7f34bc8..6c76c6c4cbc3 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_preendorsement.ml +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/test_preendorsement.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (preendorsement) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/consensus/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_preendorsement.ml *) open Protocol @@ -234,3 +235,7 @@ let tests = `Quick test_preendorsement_for_next_round; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("preendorsement", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/test_seed.ml b/src/proto_alpha/lib_protocol/test/integration/consensus/test_seed.ml index ccd0a6af169a..37c428c24dc5 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_seed.ml +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/test_seed.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (seed) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/consensus/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/consensus/main.exe \ + -- --file test_seed.ml Subject: - seed_nonce_hash included in some blocks - revelation operation of seed_nonce that should correspond to each seed_nonce_hash @@ -636,11 +637,14 @@ let tests = "revelation_missing_and_late" `Quick test_revelation_missing_and_late; - Tztest.tztest "test unrevealed" `Quick test_unrevealed; + Tztest.tztest "unrevealed" `Quick test_unrevealed; Tztest.tztest - "test_early_incorrect_unverified_correct_already_vdf" + "early_incorrect_unverified_correct_already_vdf" `Quick test_early_incorrect_unverified_correct_already_vdf; - Tztest.tztest "test VDF status" `Quick test_vdf_status; + Tztest.tztest "VDF status" `Quick test_vdf_status; Tztest.tztest "for_cycle cycle bounds" `Quick test_cycle_bounds; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("seed", tests)] |> Lwt_main.run -- GitLab From 76f992cd2ad1b39a8511cd9c64838fef8e0a97f6 Mon Sep 17 00:00:00 2001 From: lykimq Date: Fri, 7 Apr 2023 12:02:49 +0200 Subject: [PATCH 2/8] Alcotezt-UX: fix invocation headers, opt. titles for [gas] in all protocols --- manifest/main.ml | 2 +- .../lib_protocol/test/integration/gas/dune | 2 +- .../test/integration/gas/test_gas_costs.ml | 7 +++- .../test/integration/gas/test_gas_levels.ml | 20 +++++---- .../test/integration/gas/test_main.ml | 41 ------------------- .../lib_protocol/test/integration/gas/dune | 2 +- .../test/integration/gas/test_gas_costs.ml | 9 ++-- .../test/integration/gas/test_gas_levels.ml | 22 +++++----- .../test/integration/gas/test_main.ml | 41 ------------------- .../lib_protocol/test/integration/gas/dune | 2 +- .../test/integration/gas/test_gas_costs.ml | 7 +++- .../test/integration/gas/test_gas_levels.ml | 20 +++++---- .../test/integration/gas/test_main.ml | 41 ------------------- 13 files changed, 58 insertions(+), 158 deletions(-) delete mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/gas/test_main.ml delete mode 100644 src/proto_017_PtNairob/lib_protocol/test/integration/gas/test_main.ml delete mode 100644 src/proto_alpha/lib_protocol/test/integration/gas/test_main.ml diff --git a/manifest/main.ml b/manifest/main.ml index d6f635794eb9..6a83236ee11a 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -4606,7 +4606,7 @@ end = struct in let _integration_gas = tezt - ["test_main"; "test_gas_costs"; "test_gas_levels"] + ["test_gas_costs"; "test_gas_levels"] ~path:(path // "lib_protocol/test/integration/gas") ~opam:(sf "tezos-protocol-%s-tests" name_dash) ~with_macos_security_framework:true diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/dune b/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/dune index e358e9c047c4..9ad3d27331b8 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/dune +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/dune @@ -22,7 +22,7 @@ -open Tezos_protocol_016_PtMumbai -open Tezos_016_PtMumbai_test_helpers -open Tezos_base_test_helpers) - (modules test_main test_gas_costs test_gas_levels)) + (modules test_gas_costs test_gas_levels)) (executable (name main) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/test_gas_costs.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/test_gas_costs.ml index 3e25643683f8..0d769490de25 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/test_gas_costs.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/test_gas_costs.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (gas costs) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/gas/main.exe \ + -- --file test_gas_costs.ml Subject: Gas costs Current limitations: for maps, sets & compare, we only test integer comparable keys. @@ -282,3 +283,7 @@ let tests = `Quick (test_cost_reprs_are_all_positive all_io_costs); ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("gas cost functions", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/test_gas_levels.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/test_gas_levels.ml index 36cbf622cd60..18666f35c8d0 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/test_gas_levels.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/test_gas_levels.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (Gas levels) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/gas/main.exe \ + -- --file test_gas_levels.ml Subject: On gas consumption and exhaustion. *) @@ -394,10 +395,10 @@ let make_batch_test_block_one_origination name contract gas_sampler = let app_n = List.map (fun (x, y) -> (x ^ " with contract " ^ name, y)) in app_n [ - ("Test bake one operation", test_one_operation); - ("Test bake one operation list", test_one_operation_list); - ("Test multiple single operations", test_many_single_operations); - ("Test both lists and single operations", test_mixed_operations); + ("bake one operation", test_one_operation); + ("bake one operation list", test_one_operation_list); + ("multiple single operations", test_many_single_operations); + ("both lists and single operations", test_mixed_operations); ] (** Tests the consumption of all gas in a block, should pass *) @@ -554,9 +555,8 @@ let tests = ( "Detect when gas limit of operation list exceeds the hard gas limit \ per block", test_malformed_block_max_limit_reached' ); - ( "Test the gas consumption of various operations", - test_block_mixed_operations ); - ("Test that emptying an account costs gas", test_emptying_account_gas); + ("the gas consumption of various operations", test_block_mixed_operations); + ("emptying an account costs gas", test_emptying_account_gas); ] @ make_batch_test_block_one_origination "nil" nil_contract basic_gas_sampler @ make_batch_test_block_one_origination @@ -567,3 +567,7 @@ let tests = "infinite loop" loop_contract basic_gas_sampler) + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("gas levels", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/test_main.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/test_main.ml deleted file mode 100644 index 1cad429b1353..000000000000 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/test_main.ml +++ /dev/null @@ -1,41 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2021 Nomadic Labs *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -(** Testing - ------- - Component: Protocol > Gas - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe - Subject: Entrypoint -*) - -let () = - Alcotest_lwt.run - ~__FILE__ - "protocol > integration > gas" - [ - (Protocol.name ^ ": gas levels", Test_gas_levels.tests); - (Protocol.name ^ ": gas cost functions", Test_gas_costs.tests); - ] - |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/gas/dune b/src/proto_017_PtNairob/lib_protocol/test/integration/gas/dune index 7ea3a1758fa1..f672359723a1 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/gas/dune +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/gas/dune @@ -22,7 +22,7 @@ -open Tezos_protocol_017_PtNairob -open Tezos_017_PtNairob_test_helpers -open Tezos_base_test_helpers) - (modules test_main test_gas_costs test_gas_levels)) + (modules test_gas_costs test_gas_levels)) (executable (name main) diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/gas/test_gas_costs.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/gas/test_gas_costs.ml index c7c7f2ed7729..e1d43424324e 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/gas/test_gas_costs.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/gas/test_gas_costs.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Protocol (gas costs) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/gas/main.exe \ - -- test "^gas cost functions$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/gas/main.exe \ + -- --file test_gas_costs.ml Subject: Gas costs Current limitations: for maps, sets & compare, we only test integer comparable keys. @@ -284,3 +283,7 @@ let tests = `Quick (test_cost_reprs_are_all_positive all_io_costs); ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("gas cost functions", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/gas/test_gas_levels.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/gas/test_gas_levels.ml index 03e1aefca885..abaa01b81a15 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/gas/test_gas_levels.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/gas/test_gas_levels.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Protocol (Gas levels) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/gas/main.exe \ - -- test "^gas levels$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/gas/main.exe \ + -- --file test_gas_levels.ml Subject: On gas consumption and exhaustion. *) @@ -399,10 +398,10 @@ let make_batch_test_block_one_origination name contract gas_sampler = let app_n = List.map (fun (x, y) -> (x ^ " with contract " ^ name, y)) in app_n [ - ("Test bake one operation", test_one_operation); - ("Test bake one operation list", test_one_operation_list); - ("Test multiple single operations", test_many_single_operations); - ("Test both lists and single operations", test_mixed_operations); + ("bake one operation", test_one_operation); + ("bake one operation list", test_one_operation_list); + ("multiple single operations", test_many_single_operations); + ("both lists and single operations", test_mixed_operations); ] (** Tests the consumption of all gas in a block, should pass *) @@ -555,9 +554,8 @@ let tests = ( "Detect when gas limit of operation list exceeds the hard gas limit \ per block", test_malformed_block_max_limit_reached' ); - ( "Test the gas consumption of various operations", - test_block_mixed_operations ); - ("Test that emptying an account costs gas", test_emptying_account_gas); + ("the gas consumption of various operations", test_block_mixed_operations); + ("emptying an account costs gas", test_emptying_account_gas); ] @ make_batch_test_block_one_origination "nil" nil_contract basic_gas_sampler @ make_batch_test_block_one_origination @@ -568,3 +566,7 @@ let tests = "infinite loop" loop_contract basic_gas_sampler) + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("gas levels", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/gas/test_main.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/gas/test_main.ml deleted file mode 100644 index acf1b62cdcf4..000000000000 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/gas/test_main.ml +++ /dev/null @@ -1,41 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2021 Nomadic Labs *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -(** Testing - ------- - Component: Protocol > Gas - Invocation: dune runtest src/proto_alpha/lib_protocol/test/integration/gas - Subject: Entrypoint -*) - -let () = - Alcotest_lwt.run - ~__FILE__ - "protocol > integration > gas" - [ - (Protocol.name ^ ": gas levels", Test_gas_levels.tests); - (Protocol.name ^ ": gas cost functions", Test_gas_costs.tests); - ] - |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/gas/dune b/src/proto_alpha/lib_protocol/test/integration/gas/dune index 8af85ef19f2c..0dec55471c64 100644 --- a/src/proto_alpha/lib_protocol/test/integration/gas/dune +++ b/src/proto_alpha/lib_protocol/test/integration/gas/dune @@ -22,7 +22,7 @@ -open Tezos_protocol_alpha -open Tezos_alpha_test_helpers -open Tezos_base_test_helpers) - (modules test_main test_gas_costs test_gas_levels)) + (modules test_gas_costs test_gas_levels)) (executable (name main) diff --git a/src/proto_alpha/lib_protocol/test/integration/gas/test_gas_costs.ml b/src/proto_alpha/lib_protocol/test/integration/gas/test_gas_costs.ml index bd6d0afb3ae9..928902289dbd 100644 --- a/src/proto_alpha/lib_protocol/test/integration/gas/test_gas_costs.ml +++ b/src/proto_alpha/lib_protocol/test/integration/gas/test_gas_costs.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (gas costs) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/gas/main.exe \ + -- --file test_gas_costs.ml Subject: Gas costs Current limitations: for maps, sets & compare, we only test integer comparable keys. @@ -282,3 +283,7 @@ let tests = `Quick (test_cost_reprs_are_all_positive all_io_costs); ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("gas cost functions", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/gas/test_gas_levels.ml b/src/proto_alpha/lib_protocol/test/integration/gas/test_gas_levels.ml index 77f266fc4d30..8127a9f0ec87 100644 --- a/src/proto_alpha/lib_protocol/test/integration/gas/test_gas_levels.ml +++ b/src/proto_alpha/lib_protocol/test/integration/gas/test_gas_levels.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (Gas levels) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/gas/main.exe \ + -- --file test_gas_levels.ml Subject: On gas consumption and exhaustion. *) @@ -397,10 +398,10 @@ let make_batch_test_block_one_origination name contract gas_sampler = let app_n = List.map (fun (x, y) -> (x ^ " with contract " ^ name, y)) in app_n [ - ("Test bake one operation", test_one_operation); - ("Test bake one operation list", test_one_operation_list); - ("Test multiple single operations", test_many_single_operations); - ("Test both lists and single operations", test_mixed_operations); + ("bake one operation", test_one_operation); + ("bake one operation list", test_one_operation_list); + ("multiple single operations", test_many_single_operations); + ("both lists and single operations", test_mixed_operations); ] (** Tests the consumption of all gas in a block, should pass *) @@ -553,9 +554,8 @@ let tests = ( "Detect when gas limit of operation list exceeds the hard gas limit \ per block", test_malformed_block_max_limit_reached' ); - ( "Test the gas consumption of various operations", - test_block_mixed_operations ); - ("Test that emptying an account costs gas", test_emptying_account_gas); + ("the gas consumption of various operations", test_block_mixed_operations); + ("emptying an account costs gas", test_emptying_account_gas); ] @ make_batch_test_block_one_origination "nil" nil_contract basic_gas_sampler @ make_batch_test_block_one_origination @@ -566,3 +566,7 @@ let tests = "infinite loop" loop_contract basic_gas_sampler) + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("gas levels", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/gas/test_main.ml b/src/proto_alpha/lib_protocol/test/integration/gas/test_main.ml deleted file mode 100644 index c5bb194a1416..000000000000 --- a/src/proto_alpha/lib_protocol/test/integration/gas/test_main.ml +++ /dev/null @@ -1,41 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2021 Nomadic Labs *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -(** Testing - ------- - Component: Protocol > Gas - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe - Subject: Entrypoint -*) - -let () = - Alcotest_lwt.run - ~__FILE__ - "protocol > integration > gas" - [ - (Protocol.name ^ ": gas levels", Test_gas_levels.tests); - (Protocol.name ^ ": gas cost functions", Test_gas_costs.tests); - ] - |> Lwt_main.run -- GitLab From 9b5adbb4a350c1dba607571767b79d7991433e12 Mon Sep 17 00:00:00 2001 From: lykimq Date: Fri, 7 Apr 2023 13:00:12 +0200 Subject: [PATCH 3/8] Alcotezt-UX: fix invocation headers, opt. titles for [michelson] in all protocols --- manifest/main.ml | 1 - .../test/integration/michelson/dune | 1 - .../integration/michelson/test_annotations.ml | 7 +- .../michelson/test_block_time_instructions.ml | 7 +- .../michelson/test_contract_event.ml | 7 +- .../test_global_constants_storage.ml | 10 ++- .../michelson/test_interpretation.ml | 23 ++++--- .../michelson/test_lambda_normalization.ml | 9 ++- .../michelson/test_lazy_storage_diff.ml | 12 ++++ .../test/integration/michelson/test_main.ml | 64 ------------------- .../michelson/test_patched_contracts.ml | 7 +- .../integration/michelson/test_sapling.ml | 35 +++++----- .../michelson/test_script_cache.ml | 7 +- .../michelson/test_script_typed_ir_size.ml | 17 +++-- .../michelson/test_temp_big_maps.ml | 7 +- .../michelson/test_ticket_accounting.ml | 7 +- .../michelson/test_ticket_balance.ml | 40 ++++++------ .../michelson/test_ticket_balance_key.ml | 53 ++++++++------- .../test_ticket_lazy_storage_diff.ml | 37 ++++++----- .../michelson/test_ticket_manager.ml | 7 +- .../michelson/test_ticket_operations_diff.ml | 48 +++++++------- .../michelson/test_ticket_scanner.ml | 51 +++++++-------- .../michelson/test_ticket_storage.ml | 7 +- .../michelson/test_typechecking.ml | 45 +++++++------ .../test/integration/michelson/dune | 1 - .../integration/michelson/test_annotations.ml | 8 ++- .../michelson/test_block_time_instructions.ml | 8 ++- .../michelson/test_contract_event.ml | 8 ++- .../test_global_constants_storage.ml | 12 +++- .../michelson/test_interpretation.ml | 26 ++++---- .../michelson/test_lambda_normalization.ml | 11 ++-- .../michelson/test_lazy_storage_diff.ml | 12 ++++ .../test/integration/michelson/test_main.ml | 64 ------------------- .../michelson/test_patched_contracts.ml | 8 ++- .../integration/michelson/test_sapling.ml | 41 ++++++------ .../michelson/test_script_cache.ml | 8 ++- .../michelson/test_script_typed_ir_size.ml | 19 +++--- .../michelson/test_temp_big_maps.ml | 8 ++- .../michelson/test_ticket_accounting.ml | 11 ++-- .../michelson/test_ticket_balance.ml | 42 ++++++------ .../michelson/test_ticket_balance_key.ml | 55 ++++++++-------- .../test_ticket_lazy_storage_diff.ml | 39 ++++++----- .../michelson/test_ticket_manager.ml | 9 ++- .../michelson/test_ticket_operations_diff.ml | 48 +++++++------- .../michelson/test_ticket_scanner.ml | 53 ++++++++------- .../michelson/test_ticket_storage.ml | 9 ++- .../michelson/test_typechecking.ml | 44 +++++++------ .../test/integration/michelson/dune | 1 - .../integration/michelson/test_annotations.ml | 7 +- .../michelson/test_block_time_instructions.ml | 7 +- .../michelson/test_contract_event.ml | 7 +- .../test_global_constants_storage.ml | 10 ++- .../michelson/test_interpretation.ml | 25 +++++--- .../michelson/test_lambda_normalization.ml | 9 ++- .../michelson/test_lazy_storage_diff.ml | 12 ++++ .../test/integration/michelson/test_main.ml | 64 ------------------- .../michelson/test_patched_contracts.ml | 7 +- .../integration/michelson/test_sapling.ml | 40 ++++++------ .../michelson/test_script_cache.ml | 7 +- .../michelson/test_script_typed_ir_size.ml | 17 +++-- .../michelson/test_temp_big_maps.ml | 7 +- .../michelson/test_ticket_accounting.ml | 9 ++- .../michelson/test_ticket_balance.ml | 40 ++++++------ .../michelson/test_ticket_balance_key.ml | 53 ++++++++------- .../test_ticket_lazy_storage_diff.ml | 37 ++++++----- .../michelson/test_ticket_manager.ml | 7 +- .../michelson/test_ticket_operations_diff.ml | 46 ++++++------- .../michelson/test_ticket_scanner.ml | 51 +++++++-------- .../michelson/test_ticket_storage.ml | 7 +- .../michelson/test_typechecking.ml | 45 +++++++------ 70 files changed, 801 insertions(+), 767 deletions(-) delete mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_main.ml delete mode 100644 src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_main.ml delete mode 100644 src/proto_alpha/lib_protocol/test/integration/michelson/test_main.ml diff --git a/manifest/main.ml b/manifest/main.ml index 6a83236ee11a..79b7c99d548d 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -4623,7 +4623,6 @@ end = struct let _integration_michelson = let modules = [ - ("test_main", true); ("test_annotations", true); ("test_block_time_instructions", true); ("test_contract_event", true); diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/dune b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/dune index c06f4353b818..c3545cbe1310 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/dune +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/dune @@ -36,7 +36,6 @@ -open Tezos_benchmark_type_inference_016_PtMumbai -open Tezos_protocol_plugin_016_PtMumbai) (modules - test_main test_annotations test_block_time_instructions test_contract_event diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_annotations.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_annotations.ml index c0ab85002e43..4534a0f5b299 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_annotations.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_annotations.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (Michelson annotations) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_annotations.ml Subject: This module tests that Michelson annotations are properly handled. *) @@ -137,3 +138,7 @@ let tests = `Quick test_internal_origination; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("annotations", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_block_time_instructions.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_block_time_instructions.ml index 0bbb1f1d2df2..abdf566a3dbc 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_block_time_instructions.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_block_time_instructions.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (Michelson block-time instructions) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_block_time_instructions.ml Subject: This module tests that Michelson instructions related to block time are correct. *) @@ -77,3 +78,7 @@ let tests = `Quick test_min_block_time; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("block time instructions", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_contract_event.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_contract_event.ml index 3fd87a5ab22d..d782088bfd49 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_contract_event.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_contract_event.ml @@ -30,7 +30,8 @@ open Lwt_result_syntax (** Testing ------- Component: Protocol (event logging) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_contract_event.ml Subject: This module tests that the event logs can be written to the receipt in correct order and expected format. *) @@ -134,3 +135,7 @@ let tests = `Quick contract_test; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("event logging", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_global_constants_storage.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_global_constants_storage.ml index b1d5597d640c..b9915896909c 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_global_constants_storage.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_global_constants_storage.ml @@ -29,7 +29,8 @@ open Transfers (** Testing ------- Component: Protocol (global table of constants) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_global_constants_storage.ml Subject: This module tests that the global table of constants can be written to and read from across blocks. *) @@ -129,3 +130,10 @@ let tests = `Quick test_no_double_register; ] + +let () = + Alcotest_lwt.run + ~__FILE__ + Protocol.name + [("global table of constants", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_interpretation.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_interpretation.ml index 388a6c590acd..53513516f22e 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_interpretation.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_interpretation.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (interpretation) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_interpretation.ml Subject: Interpretation of Michelson scripts *) @@ -373,7 +374,7 @@ let path = project_root // Filename.dirname __FILE__ let tests = [ - Tztest.tztest "test bad contract error" `Quick test_bad_contract_parameter; + Tztest.tztest "bad contract error" `Quick test_bad_contract_parameter; Tztest.tztest "check robustness overflow error" `Slow test_stack_overflow; Tztest.tztest "check robustness overflow error in lwt" @@ -383,18 +384,18 @@ let tests = "test multiplication no illegitimate overflow" `Quick test_multiplication_close_to_overflow_passes; - Tztest.tztest "test stack overflow error" `Slow test_stack_overflow; + Tztest.tztest "stack overflow error" `Slow test_stack_overflow; Tztest.tztest_qcheck2 - ~name:"test map instr against options" + ~name:"map instr against options" QCheck2.Gen.( triple (opt small_signed_int) (opt small_signed_int) small_signed_int) Test_map_instr_on_options.test_mapping; Tztest.tztest - "test lambda_rec instruction" + "lambda_rec instruction" `Quick (test_contract_success (path // "contracts/rec_fact.tz") "0" "5" "120"); Tztest.tztest - "test lambda_rec instruction with apply" + "lambda_rec instruction with apply" `Quick (test_contract_success (path // "contracts/rec_fact_apply.tz") @@ -402,11 +403,11 @@ let tests = "5" "120"); Tztest.tztest - "test lambda_rec instruction with an infinite recursion" + "lambda_rec instruction with an infinite recursion" `Quick (test_contract_fail (path // "contracts/omega.tz") "Unit" "Unit"); Tztest.tztest - "test lambda_rec instruction storage" + "lambda_rec instruction storage" `Quick (test_store_and_reload (path // "contracts/rec_fact_store.tz") @@ -425,7 +426,7 @@ let tests = ~param_2:"5" ~expected_storage_str_2:"Left 120"); Tztest.tztest - "test lambda_rec instruction storage apply store" + "lambda_rec instruction storage apply store" `Quick (test_store_and_reload (path // "contracts/rec_fact_apply_store.tz") @@ -453,3 +454,7 @@ let tests = ~expected_storage_str_2:"Left 120"); ] @ error_encoding_tests + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("interpretation", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_lambda_normalization.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_lambda_normalization.ml index 3e53d4a0e87f..a16c3d87f331 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_lambda_normalization.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_lambda_normalization.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (Michelson) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_lambda_normalization.ml Subject: Test that lambdas are normalized to optimized format at elaboration *) @@ -230,7 +231,11 @@ let test_lambda_normalization () = let tests = [ Tztest.tztest - "Test that lambdas are normalized to optimized format during elaboration" + "lambdas are normalized to optimized format during elaboration" `Quick test_lambda_normalization; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("lambda normalization", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_lazy_storage_diff.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_lazy_storage_diff.ml index 03a84159c6b2..dfcf84cec9fa 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_lazy_storage_diff.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_lazy_storage_diff.ml @@ -23,6 +23,14 @@ (* *) (*****************************************************************************) +(** Testing + ------- + Component: Protocol (Michelson) + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_lazy_storage_diff.ml + Subject: Test lazy storage +*) + open Protocol (** Generation of input data *) @@ -138,3 +146,7 @@ let tests = Tztest.tztest "conversion roundtrip" `Slow (on_diffs conversion_roundtrip); Tztest.tztest "encoding roundtrip" `Slow (on_diffs encoding_roundtrip); ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("lazy storage diff", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_main.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_main.ml deleted file mode 100644 index 23845304daed..000000000000 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_main.ml +++ /dev/null @@ -1,64 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2021 Nomadic Labs *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -(** Testing - ------- - Component: Protocol - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe - Subject: Integration > Michelson -*) - -let () = - Alcotest_lwt.run - ~__FILE__ - "protocol > integration > michelson" - [ - ( Protocol.name ^ ": global table of constants", - Test_global_constants_storage.tests ); - (Protocol.name ^ ": interpretation", Test_interpretation.tests); - (Protocol.name ^ ": lazy storage diff", Test_lazy_storage_diff.tests); - (Protocol.name ^ ": sapling", Test_sapling.tests); - (Protocol.name ^ ": script typed ir size", Test_script_typed_ir_size.tests); - (Protocol.name ^ ": temp big maps", Test_temp_big_maps.tests); - (Protocol.name ^ ": ticket balance key", Test_ticket_balance_key.tests); - (Protocol.name ^ ": ticket scanner", Test_ticket_scanner.tests); - (Protocol.name ^ ": ticket storage", Test_ticket_storage.tests); - ( Protocol.name ^ ": ticket lazy storage diff", - Test_ticket_lazy_storage_diff.tests ); - ( Protocol.name ^ ": ticket operations diff", - Test_ticket_operations_diff.tests ); - (Protocol.name ^ ": ticket accounting", Test_ticket_accounting.tests); - (Protocol.name ^ ": ticket balance", Test_ticket_balance.tests); - (Protocol.name ^ ": ticket manager", Test_ticket_manager.tests); - (Protocol.name ^ ": typechecking", Test_typechecking.tests); - (Protocol.name ^ ": script cache", Test_script_cache.tests); - ( Protocol.name ^ ": block time instructions", - Test_block_time_instructions.tests ); - (Protocol.name ^ ": annotations", Test_annotations.tests); - (Protocol.name ^ ": event logging", Test_contract_event.tests); - (Protocol.name ^ ": patched contracts", Test_patched_contracts.tests); - (Protocol.name ^ ": lambda normalization", Test_lambda_normalization.tests); - ] - |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_patched_contracts.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_patched_contracts.ml index 7b004719fd75..afaa346c0f2c 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_patched_contracts.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_patched_contracts.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol Migration (patched scripts) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_patched_contracts.ml Subject: Migration *) @@ -213,3 +214,7 @@ let tests = let module Test = Legacy_patch_test (Patches) in List.concat_map Test.tests Patches.patches) test_modules + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("patched contracts", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_sapling.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_sapling.ml index 22a386f1257b..a09cf4f99fad 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_sapling.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_sapling.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (Sapling) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_sapling.ml Subject: On the privacy-preserving library Sapling *) @@ -1146,34 +1147,31 @@ let tests = "test_get_memo_size" `Quick Raw_context_tests.test_get_memo_size; - Tztest.tztest "test_verify_memo" `Quick Alpha_context_tests.test_verify_memo; + Tztest.tztest "verify_memo" `Quick Alpha_context_tests.test_verify_memo; + Tztest.tztest "bench_phases" `Slow Alpha_context_tests.test_bench_phases; Tztest.tztest - "test_bench_phases" - `Slow - Alpha_context_tests.test_bench_phases; - Tztest.tztest - "test_bench_phases_legacy" + "bench_phases_legacy" `Quick Alpha_context_tests.test_bench_phases_legacy; Tztest.tztest - "test_bench_fold_over_same_token" + "bench_fold_over_same_token" `Slow Alpha_context_tests.test_bench_fold_over_same_token; Tztest.tztest - "test_double_spend_same_input" + "double_spend_same_input" `Quick Alpha_context_tests.test_double_spend_same_input; Tztest.tztest - "test_verifyupdate_one_transaction" + "verifyupdate_one_transaction" `Quick Alpha_context_tests.test_verifyupdate_one_transaction; Tztest.tztest - "test_verifyupdate_two_transactions" + "verifyupdate_two_transactions" `Quick Alpha_context_tests.test_verifyupdate_two_transactions; - Tztest.tztest "test_shielded_tez" `Quick Interpreter_tests.test_shielded_tez; + Tztest.tztest "shielded_tez" `Quick Interpreter_tests.test_shielded_tez; Tztest.tztest - "test use state from other contract and transact" + "use state from other contract and transact" `Quick Interpreter_tests.test_use_state_from_other_contract_and_transact; Tztest.tztest @@ -1181,10 +1179,13 @@ let tests = `Quick Interpreter_tests.test_push_sapling_state_should_be_forbidden; Tztest.tztest - "test_transac_and_block" + "transac_and_block" `Quick Interpreter_tests.test_transac_and_block; - Tztest.tztest "test_drop" `Quick Interpreter_tests.test_drop; - Tztest.tztest "test_double" `Quick Interpreter_tests.test_double; - Tztest.tztest "test_state_as_arg" `Quick Interpreter_tests.test_state_as_arg; + Tztest.tztest "drop" `Quick Interpreter_tests.test_drop; + Tztest.tztest "double" `Quick Interpreter_tests.test_double; + Tztest.tztest "state_as_arg" `Quick Interpreter_tests.test_state_as_arg; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("sapling", tests)] |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_script_cache.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_script_cache.ml index 423d8fae5ee7..bab0df4f25d9 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_script_cache.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_script_cache.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (cache) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_script_cache.ml Subject: These unit tests check basic behavior of script cache *) @@ -415,3 +416,7 @@ let tests = test_size_limit_is_in_constants_repr; tztest "entries show LRU behavior" `Quick test_entries_shows_lru; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("script cache", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_script_typed_ir_size.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_script_typed_ir_size.ml index 54638bbe6d31..46edd4851068 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_script_typed_ir_size.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_script_typed_ir_size.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (script typed IR size) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_script_typed_ir_size.ml Subject: Script_typed_ir computes good approximation of values' sizes *) @@ -1040,9 +1041,13 @@ let check_micheline_sizes () = let tests = let open Tztest in [ - tztest "check value size" `Quick check_value_size; - tztest "check ty size" `Quick check_ty_size; - tztest "check kinstr size" `Quick check_kinstr_size; - tztest "check witness sizes" `Quick check_witness_sizes; - tztest "check micheline sizes" `Quick check_micheline_sizes; + tztest "value size" `Quick check_value_size; + tztest "ty size" `Quick check_ty_size; + tztest "kinstr size" `Quick check_kinstr_size; + tztest "witness sizes" `Quick check_witness_sizes; + tztest "micheline sizes" `Quick check_micheline_sizes; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("script typed ir size", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_temp_big_maps.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_temp_big_maps.ml index e4a4b50208ad..e7e389e21087 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_temp_big_maps.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_temp_big_maps.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (temporary big maps) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_temp_big_maps.ml Subject: On temporary big maps. *) @@ -96,3 +97,7 @@ let tests = (test_temp_big_maps_contract param_left param_right)) param_right_values) param_left_values) + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("temp big maps", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_accounting.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_accounting.ml index eeb2d1862972..a1894605abf4 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_accounting.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_accounting.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (Ticket_scanner) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_ticket_accounting.ml Subject: Ticket scanner tests *) @@ -1471,3 +1472,7 @@ let tests = `Quick test_ticket_token_map_of_list_with_duplicates; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("ticket accounting", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_balance.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_balance.ml index 91cab7fa7419..bc897c5105a1 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_balance.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_balance.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (Ticket_balance_key) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_ticket_balance.ml Subject: Ticket balance key hashing *) @@ -1732,34 +1733,35 @@ let test_storage_for_create_and_remove_tickets () = let tests = [ - Tztest.tztest "Test add strict" `Quick test_add_strict; - Tztest.tztest "Test add and remove" `Quick test_add_remove; - Tztest.tztest "Test add to big-map" `Quick test_add_to_big_map; - Tztest.tztest "Test swap big-map" `Quick test_swap_big_map; - Tztest.tztest "Test send ticket" `Quick test_send_tickets; + Tztest.tztest "add strict" `Quick test_add_strict; + Tztest.tztest "dd and remove" `Quick test_add_remove; + Tztest.tztest "add to big-map" `Quick test_add_to_big_map; + Tztest.tztest "swap big-map" `Quick test_swap_big_map; + Tztest.tztest "send ticket" `Quick test_send_tickets; Tztest.tztest - "Test send ticket to implicit" + "send ticket to implicit" `Quick test_send_tickets_to_implicit_account; Tztest.tztest - "Test send and store tickets with amount 0" + "send and store tickets with amount 0" `Quick test_send_and_store_zero_amount_tickets; + Tztest.tztest "send tickets in big-map" `Quick test_send_tickets_in_big_map; + Tztest.tztest "modify big-map" `Quick test_modify_big_map; + Tztest.tztest "send drop" `Quick test_send_tickets_in_big_map_and_drop; Tztest.tztest - "Test send tickets in big-map" - `Quick - test_send_tickets_in_big_map; - Tztest.tztest "Test modify big-map" `Quick test_modify_big_map; - Tztest.tztest "Test send drop" `Quick test_send_tickets_in_big_map_and_drop; - Tztest.tztest - "Test create contract with ticket" + "create contract with ticket" `Quick test_create_contract_with_ticket; - Tztest.tztest "Test join" `Quick test_join_tickets; - Tztest.tztest "Test wallet" `Quick test_ticket_wallet; - Tztest.tztest "Test ticket storage" `Quick test_ticket_storage; + Tztest.tztest "join" `Quick test_join_tickets; + Tztest.tztest "wallet" `Quick test_ticket_wallet; + Tztest.tztest "ticket storage" `Quick test_ticket_storage; Tztest.tztest - "Test storage for create and remove tickets" + "storage for create and remove tickets" `Quick test_storage_for_create_and_remove_tickets; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("ticket balance", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_balance_key.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_balance_key.ml index 2d00f79a3a01..509e453b8210 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_balance_key.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_balance_key.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (Ticket_balance_key) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_ticket_balance_key.ml Subject: Ticket balance key hashing *) @@ -423,30 +424,28 @@ let test_option_some () = let tests = [ - Tztest.tztest "Test different ticketers" `Quick test_different_ticketers; - Tztest.tztest "Test different owners" `Quick test_different_owners; - Tztest.tztest "Test different content" `Quick test_different_content; - Tztest.tztest "Test different amounts" `Quick test_different_amounts; - Tztest.tztest "Test nat int" `Quick test_nat_int; - Tztest.tztest "Test nat mutez" `Quick test_nat_mutez; - Tztest.tztest "Test not bool" `Quick test_bool_nat; - Tztest.tztest "Test nat bytes" `Quick test_nat_bytes; - Tztest.tztest "Test string chain_id" `Quick test_string_chain_id; - Tztest.tztest "Test string key_hash" `Quick test_string_key_hash; - Tztest.tztest "Test string timestamp" `Quick test_string_timestamp; - Tztest.tztest "Test string address" `Quick test_string_address; - Tztest.tztest "Test string key" `Quick test_string_key; - Tztest.tztest "Test string signature" `Quick test_string_signature; - Tztest.tztest "Test annotations for pair" `Quick test_annotation_pair; - Tztest.tztest "Test annotations for or" `Quick test_annotation_or; - Tztest.tztest - "Test annotations for type alias" - `Quick - test_annotation_type_alias; - Tztest.tztest - "Test annotations for paired ors" - `Quick - test_annotation_pair_or; - Tztest.tztest "Test option none" `Quick test_option_none; - Tztest.tztest "Test option some" `Quick test_option_some; + Tztest.tztest "different ticketers" `Quick test_different_ticketers; + Tztest.tztest "different owners" `Quick test_different_owners; + Tztest.tztest "different content" `Quick test_different_content; + Tztest.tztest "different amounts" `Quick test_different_amounts; + Tztest.tztest "nat int" `Quick test_nat_int; + Tztest.tztest "nat mutez" `Quick test_nat_mutez; + Tztest.tztest "not bool" `Quick test_bool_nat; + Tztest.tztest "nat bytes" `Quick test_nat_bytes; + Tztest.tztest "string chain_id" `Quick test_string_chain_id; + Tztest.tztest "string key_hash" `Quick test_string_key_hash; + Tztest.tztest "string timestamp" `Quick test_string_timestamp; + Tztest.tztest "string address" `Quick test_string_address; + Tztest.tztest "string key" `Quick test_string_key; + Tztest.tztest "string signature" `Quick test_string_signature; + Tztest.tztest "annotations for pair" `Quick test_annotation_pair; + Tztest.tztest "annotations for or" `Quick test_annotation_or; + Tztest.tztest "annotations for type alias" `Quick test_annotation_type_alias; + Tztest.tztest "annotations for paired ors" `Quick test_annotation_pair_or; + Tztest.tztest "option none" `Quick test_option_none; + Tztest.tztest "option some" `Quick test_option_some; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("ticket balance key", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_lazy_storage_diff.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_lazy_storage_diff.ml index e484863f390c..6bff3b503daf 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_lazy_storage_diff.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_lazy_storage_diff.ml @@ -27,7 +27,8 @@ (** Testing ------- Component: Protocol (Ticket_scanner) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_ticket_lazy_storage_diff.ml Subject: Ticket scanner tests *) @@ -657,38 +658,36 @@ let test_mix_lazy_diffs () = let tests = [ - Tztest.tztest "Test allocate new empty" `Quick test_allocate_new_empty; - Tztest.tztest "Test allocate new" `Quick test_allocate_new; - Tztest.tztest - "Test allocate new no tickets" - `Quick - test_allocate_new_no_tickets; + Tztest.tztest "allocate new empty" `Quick test_allocate_new_empty; + Tztest.tztest "allocate new" `Quick test_allocate_new; + Tztest.tztest "allocate new no tickets" `Quick test_allocate_new_no_tickets; Tztest.tztest "Remove" `Quick test_remove_big_map; Tztest.tztest - "Test no updates to existing" + "no updates to existing" `Quick test_no_updates_to_existing_big_map; + Tztest.tztest "update existing big-map" `Quick test_update_existing_big_map; Tztest.tztest - "Test update existing big-map" - `Quick - test_update_existing_big_map; - Tztest.tztest - "Test update same key multiple times on existing big-map" + "update same key multiple times on existing big-map" `Quick test_update_same_key_multiple_times_existing_big_map; Tztest.tztest - "Test remove same key multiple times on existing big-map" + "remove same key multiple times on existing big-map" `Quick test_remove_same_key_multiple_times_existing_big_map; Tztest.tztest - "Test update and remove same key multiple times on existing big-map" + "update and remove same key multiple times on existing big-map" `Quick test_update_and_remove_same_key_multiple_times_existing_big_map; - Tztest.tztest "Test copy" `Quick test_copy_big_map; - Tztest.tztest "Test copy with updates" `Quick test_copy_big_map_with_updates; + Tztest.tztest "copy" `Quick test_copy_big_map; + Tztest.tztest "copy with updates" `Quick test_copy_big_map_with_updates; Tztest.tztest - "Test copy with multiple updates to same key" + "copy with multiple updates to same key" `Quick test_copy_big_map_with_updates_to_same_key; - Tztest.tztest "Test mix lazy diffs" `Quick test_mix_lazy_diffs; + Tztest.tztest "mix lazy diffs" `Quick test_mix_lazy_diffs; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("ticket lazy storage diff", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_manager.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_manager.ml index 9d3614361b3d..42d1a520c66f 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_manager.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_manager.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (Ticket_balance_key) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_ticket_manager.ml Subject: Tests that compare the ticket-balance table against tickets in the contract storages. The tests include a lot of operations that sends and store tickets. After each operation we check that the @@ -802,3 +803,7 @@ let tests = test_add_remove_from_lazy_storage; Tztest.tztest "Mix of operations" `Quick test_mixed_operations; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("ticket manager", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_operations_diff.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_operations_diff.ml index 4f4ccb41f638..6af87beafcd1 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_operations_diff.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_operations_diff.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (Ticket_scanner) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_ticket_operations_diff.ml Subject: Ticket scanner tests *) @@ -1307,76 +1308,77 @@ let test_fail_on_zero_amount_tickets () = let tests = [ Tztest.tztest - "Test operations that do not involve tickets" + "operations that do not involve tickets" `Quick test_non_ticket_operations; Tztest.tztest - "Test transfer to non-ticket contract" + "transfer to non-ticket contract" `Quick test_transfer_to_non_ticket_contract; Tztest.tztest - "Test transfer empty ticket list" + "transfer empty ticket list" `Quick test_transfer_empty_ticket_list; - Tztest.tztest "Test transfer one ticket" `Quick test_transfer_one_ticket; + Tztest.tztest "transfer one ticket" `Quick test_transfer_one_ticket; Tztest.tztest - "Test transfer multiple tickets" + "transfer multiple tickets" `Quick test_transfer_multiple_tickets; Tztest.tztest - "Test transfer different tickets" + "transfer different tickets" `Quick test_transfer_different_tickets; Tztest.tztest - "Test transfer to two contracts with different tickets" + "transfer to two contracts with different tickets" `Quick test_transfer_to_two_contracts_with_different_tickets; Tztest.tztest - "Test originate contract that does not contain tickets" + "originate contract that does not contain tickets" `Quick test_originate_non_ticket_contract; Tztest.tztest - "Test originate with empty ticket list" + "originate with empty ticket list" `Quick test_originate_with_empty_tickets_list; Tztest.tztest - "Test originate with one ticket" + "originate with one ticket" `Quick test_originate_with_one_ticket; Tztest.tztest - "Test originate with multiple tickets" + "originate with multiple tickets" `Quick test_originate_with_multiple_tickets; Tztest.tztest - "Test originate with different tickets" + "originate with different tickets" `Quick test_originate_with_different_tickets; Tztest.tztest - "Test originate two contracts with different tickets" + "originate two contracts with different tickets" `Quick test_originate_two_contracts_with_different_tickets; + Tztest.tztest "originate and transfer" `Quick test_originate_and_transfer; Tztest.tztest - "Test originate and transfer" - `Quick - test_originate_and_transfer; - Tztest.tztest - "Test originate big-map with tickets" + "originate big-map with tickets" `Quick test_originate_big_map_with_tickets; Tztest.tztest - "Test transfer big-map with tickets" + "transfer big-map with tickets" `Quick test_transfer_big_map_with_tickets; Tztest.tztest - "Test tx rollup deposit one ticket" + "tx rollup deposit one ticket" `Quick test_tx_rollup_deposit_one_ticket; Tztest.tztest - "Test transfer fails on multiple zero tickets" + "transfer fails on multiple zero tickets" `Quick test_transfer_fails_on_multiple_zero_tickets; Tztest.tztest - "Test fail in zero-amount tickets" + "fail in zero-amount tickets" `Quick test_fail_on_zero_amount_tickets; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("ticket operations diff", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_scanner.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_scanner.ml index 2821fdc0bf5d..a9c2b00fa268 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_scanner.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_scanner.ml @@ -27,7 +27,8 @@ (** Testing ------- Component: Protocol (Ticket_scanner) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_ticket_scanner.ml Subject: Ticket scanner tests *) @@ -627,67 +628,67 @@ let test_tickets_remove_overlay_in_non_empty_in_big_map_ref () = let tests = [ + Tztest.tztest "tickets in unit ticket" `Quick test_tickets_in_unit_ticket; + Tztest.tztest "tickets in list" `Quick test_tickets_in_list; Tztest.tztest - "Test tickets in unit ticket" - `Quick - test_tickets_in_unit_ticket; - Tztest.tztest "Test tickets in list" `Quick test_tickets_in_list; - Tztest.tztest - "Test tickets in list with zero amount" + "tickets in list with zero amount" `Quick test_tickets_in_list_with_zero_amount; - Tztest.tztest "Test tickets in pair" `Quick test_tickets_in_pair; + Tztest.tztest "tickets in pair" `Quick test_tickets_in_pair; Tztest.tztest - "Test tickets in pair with zero amount" + "tickets in pair with zero amount" `Quick test_tickets_in_pair_with_zero_amount; - Tztest.tztest "Test tickets in map" `Quick test_tickets_in_map; + Tztest.tztest "tickets in map" `Quick test_tickets_in_map; Tztest.tztest - "Test tickets in map with zero amount" + "tickets in map with zero amount" `Quick test_tickets_in_map_with_zero_amount; - Tztest.tztest "Test tickets in big map" `Quick test_tickets_in_big_map; + Tztest.tztest "tickets in big map" `Quick test_tickets_in_big_map; Tztest.tztest - "Test tickets in big map with include lazy set to false" + "tickets in big map with include lazy set to false" `Quick test_tickets_in_big_map_strict_only; Tztest.tztest - "Test tickets in list in big map" + "tickets in list in big map" `Quick test_tickets_in_list_in_big_map; Tztest.tztest - "Test tickets in a pair of big-map and list with include lazy set to \ - false" + "tickets in a pair of big-map and list with include lazy set to false" `Quick test_tickets_in_pair_big_map_and_list_strict_only; - Tztest.tztest "Test tickets in or left" `Quick test_tickets_in_or_left; + Tztest.tztest "tickets in or left" `Quick test_tickets_in_or_left; Tztest.tztest - "Test tickets in or left with zero amount" + "tickets in or left with zero amount" `Quick test_tickets_in_or_left_with_zero_amount; - Tztest.tztest "Test tickets in or right" `Quick test_tickets_in_or_right; + Tztest.tztest "tickets in or right" `Quick test_tickets_in_or_right; Tztest.tztest - "Test tickets in empty big-map ref" + "tickets in empty big-map ref" `Quick test_tickets_overlay_in_empty_big_map_ref; Tztest.tztest - "Test tickets in big-map ref" + "tickets in big-map ref" `Quick test_tickets_in_empty_big_map_ref; Tztest.tztest - "Test tickets in non-empty big-map ref" + "tickets in non-empty big-map ref" `Quick test_tickets_in_non_empty_big_map_ref; Tztest.tztest - "Test tickets in non-empty big-map ref with overlay" + "tickets in non-empty big-map ref with overlay" `Quick test_tickets_overlay_in_non_empty_in_big_map_ref; Tztest.tztest - "Test tickets replace existing value from overlay" + "tickets replace existing value from overlay" `Quick test_tickets_replace_overlay_in_non_empty_in_big_map_ref; Tztest.tztest - "Test tickets remove existing value from overlay" + "tickets remove existing value from overlay" `Quick test_tickets_remove_overlay_in_non_empty_in_big_map_ref; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("ticket scanner", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_storage.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_storage.ml index ba6ed02088ef..68bcb6a7e2b2 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_storage.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_ticket_storage.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (Alpha_context.Ticket_balance) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_ticket_storage.ml Subject: Ticket storage functions tested using the Ticket_balance module in Alpha_context. *) @@ -269,3 +270,7 @@ let tests = test_ticket_balance_different_owners; Tztest.tztest "ticket storage space" `Quick test_storage_space; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("ticket storage", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_typechecking.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_typechecking.ml index acb8734c9bcf..f575d9ac0def 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_typechecking.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/test_typechecking.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (type-checking) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_typechecking.ml Subject: Type-checking *) @@ -878,59 +879,63 @@ let test_contract_failure path = let tests = [ - Tztest.tztest "test unparse view" `Quick test_unparse_view; + Tztest.tztest "unparse view" `Quick test_unparse_view; Tztest.tztest - "test typecheck stack overflow error" + "typecheck stack overflow error" `Quick test_typecheck_stack_overflow; - Tztest.tztest "test comb type parsing" `Quick test_parse_comb_type; - Tztest.tztest "test comb type unparsing" `Quick test_unparse_comb_type; + Tztest.tztest "comb type parsing" `Quick test_parse_comb_type; + Tztest.tztest "comb type unparsing" `Quick test_unparse_comb_type; Tztest.tztest - "test comb comparable type unparsing" + "comb comparable type unparsing" `Quick test_unparse_comb_comparable_type; - Tztest.tztest "test comb data parsing" `Quick test_parse_comb_data; - Tztest.tztest "test comb data unparsing" `Quick test_unparse_comb_data; - Tztest.tztest "test optimal comb data unparsing" `Quick test_optimal_comb; - Tztest.tztest "test parse address" `Quick test_parse_address; + Tztest.tztest "comb data parsing" `Quick test_parse_comb_data; + Tztest.tztest "comb data unparsing" `Quick test_unparse_comb_data; + Tztest.tztest "optimal comb data unparsing" `Quick test_optimal_comb; + Tztest.tztest "parse address" `Quick test_parse_address; Tztest.tztest - "test unpackability of the contract type" + "unpackability of the contract type" `Quick test_contract_not_packable; Tztest.tztest - "test forbidden SELF in view" + "forbidden SELF in view" `Quick (test_forbidden_op_in_view "SELF"); Tztest.tztest - "test forbidden SET_DELEGATE in view" + "forbidden SET_DELEGATE in view" `Quick (test_forbidden_op_in_view "SET_DELEGATE"); Tztest.tztest - "test forbidden TRANSFER_TOKENS in view" + "forbidden TRANSFER_TOKENS in view" `Quick (test_forbidden_op_in_view "TRANSFER_TOKENS"); Tztest.tztest - "test forbidden CREATE_CONTRACT in view" + "forbidden CREATE_CONTRACT in view" `Quick (test_forbidden_op_in_view "CREATE_CONTRACT"); Tztest.tztest - "test parse contract data for rollup" + "parse contract data for rollup" `Quick test_parse_contract_data_for_unit_rollup; Tztest.tztest - "test parse contract data for rollup with entrypoint invalid type" + "parse contract data for rollup with entrypoint invalid type" `Quick test_parse_contract_data_for_rollup_with_invalid_type; Tztest.tztest - "test lambda_rec instruction" + "lambda_rec instruction" `Quick (test_contract_success (path // "contracts/rec_fact.tz")); Tztest.tztest - "test lambda_rec instruction with apply" + "lambda_rec instruction with apply" `Quick (test_contract_success (path // "contracts/rec_fact_apply.tz")); Tztest.tztest - "test lambda_rec with type error" + "lambda_rec with type error" `Quick (test_contract_failure (path // "contracts/fail_rec.tz")); ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("typechecking", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/dune b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/dune index c8c898cbd784..591d17699012 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/dune +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/dune @@ -36,7 +36,6 @@ -open Tezos_benchmark_type_inference_017_PtNairob -open Tezos_protocol_plugin_017_PtNairob) (modules - test_main test_annotations test_block_time_instructions test_contract_event diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_annotations.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_annotations.ml index 200d25431759..1f930fea1470 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_annotations.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_annotations.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Protocol (Michelson annotations) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ - -- test "^annotations$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_annotations.ml Subject: This module tests that Michelson annotations are properly handled. *) @@ -138,3 +138,7 @@ let tests = `Quick test_internal_origination; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("annotations", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_block_time_instructions.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_block_time_instructions.ml index ba287bb8b9da..8480d7babfeb 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_block_time_instructions.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_block_time_instructions.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Protocol (Michelson block-time instructions) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ - -- test "^block time instructions$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_block_time_instructions.ml Subject: This module tests that Michelson instructions related to block time are correct. *) @@ -78,3 +78,7 @@ let tests = `Quick test_min_block_time; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("block time instructions", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_contract_event.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_contract_event.ml index 39ac884df84a..16f82977311c 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_contract_event.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_contract_event.ml @@ -29,8 +29,8 @@ open Alpha_context (** Testing ------- Component: Protocol (event logging) - Invocation: cd src/proto_alpha/lib_protocol/test/integration/michelson && \ - dune exec ./main.exe -- test '^event logging$' + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_contract_event.ml Subject: This module tests that the event logs can be written to the receipt in correct order and expected format. *) @@ -134,3 +134,7 @@ let tests = `Quick contract_test; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("event logging", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_global_constants_storage.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_global_constants_storage.ml index 7a031944fbed..3d986cd31af7 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_global_constants_storage.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_global_constants_storage.ml @@ -29,9 +29,8 @@ open Transfers (** Testing ------- Component: Protocol (global table of constants) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ - -- test "^global table of constants$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_global_constants_storage.ml Subject: This module tests that the global table of constants can be written to and read from across blocks. *) @@ -131,3 +130,10 @@ let tests = `Quick test_no_double_register; ] + +let () = + Alcotest_lwt.run + ~__FILE__ + Protocol.name + [("global table of constants", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_interpretation.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_interpretation.ml index aae0da0ab17e..01315969cd98 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_interpretation.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_interpretation.ml @@ -27,8 +27,8 @@ ------- Component: Protocol (interpretation) Dependencies: src/proto_alpha/lib_protocol/script_interpreter.ml - Invocation: cd src/proto_alpha/lib_protocol/test/integration/michelson && \ - dune exec ./main.exe -- test "^interpretation$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_interpretation.ml Subject: Interpretation of Michelson scripts *) @@ -372,28 +372,28 @@ let path = project_root // Filename.dirname __FILE__ let tests = [ - Tztest.tztest "test bad contract error" `Quick test_bad_contract_parameter; + Tztest.tztest "bad contract error" `Quick test_bad_contract_parameter; Tztest.tztest "check robustness overflow error" `Slow test_stack_overflow; Tztest.tztest "check robustness overflow error in lwt" `Slow test_stack_overflow_in_lwt; Tztest.tztest - "test multiplication no illegitimate overflow" + "multiplication no illegitimate overflow" `Quick test_multiplication_close_to_overflow_passes; - Tztest.tztest "test stack overflow error" `Slow test_stack_overflow; + Tztest.tztest "stack overflow error" `Slow test_stack_overflow; Tztest.tztest_qcheck2 - ~name:"test map instr against options" + ~name:"map instr against options" QCheck2.Gen.( triple (opt small_signed_int) (opt small_signed_int) small_signed_int) Test_map_instr_on_options.test_mapping; Tztest.tztest - "test lambda_rec instruction" + "lambda_rec instruction" `Quick (test_contract_success (path // "contracts/rec_fact.tz") "0" "5" "120"); Tztest.tztest - "test lambda_rec instruction with apply" + "lambda_rec instruction with apply" `Quick (test_contract_success (path // "contracts/rec_fact_apply.tz") @@ -401,11 +401,11 @@ let tests = "5" "120"); Tztest.tztest - "test lambda_rec instruction with an infinite recursion" + "lambda_rec instruction with an infinite recursion" `Quick (test_contract_fail (path // "contracts/omega.tz") "Unit" "Unit"); Tztest.tztest - "test lambda_rec instruction storage" + "lambda_rec instruction storage" `Quick (test_store_and_reload (path // "contracts/rec_fact_store.tz") @@ -424,7 +424,7 @@ let tests = ~param_2:"5" ~expected_storage_str_2:"Left 120"); Tztest.tztest - "test lambda_rec instruction storage apply store" + "lambda_rec instruction storage apply store" `Quick (test_store_and_reload (path // "contracts/rec_fact_apply_store.tz") @@ -452,3 +452,7 @@ let tests = ~expected_storage_str_2:"Left 120"); ] @ error_encoding_tests + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("interpretation", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_lambda_normalization.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_lambda_normalization.ml index ab940088a9cf..2bcd8f3eddb7 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_lambda_normalization.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_lambda_normalization.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Protocol (Michelson) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ - -- test "^lambda normalization" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_lambda_normalization.ml Subject: Test that lambdas are normalized to optimized format at elaboration *) @@ -229,7 +228,11 @@ let test_lambda_normalization () = let tests = [ Tztest.tztest - "Test that lambdas are normalized to optimized format during elaboration" + "lambdas are normalized to optimized format during elaboration" `Quick test_lambda_normalization; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("lambda normalization", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_lazy_storage_diff.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_lazy_storage_diff.ml index 03a84159c6b2..7cd63c37976b 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_lazy_storage_diff.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_lazy_storage_diff.ml @@ -23,6 +23,14 @@ (* *) (*****************************************************************************) +(** Testing + ------- + Component: Protocol (Michelson) + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_lazy_storage_diff.ml + Subject: Test lazy storage +*) + open Protocol (** Generation of input data *) @@ -138,3 +146,7 @@ let tests = Tztest.tztest "conversion roundtrip" `Slow (on_diffs conversion_roundtrip); Tztest.tztest "encoding roundtrip" `Slow (on_diffs encoding_roundtrip); ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("lazy storage diff", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_main.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_main.ml deleted file mode 100644 index c15c04dd7d4d..000000000000 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_main.ml +++ /dev/null @@ -1,64 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2021 Nomadic Labs *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -(** Testing - ------- - Component: Protocol - Invocation: dune runtest src/proto_alpha/lib_protocol/test/integration/michelson - Subject: Integration > Michelson -*) - -let () = - Alcotest_lwt.run - ~__FILE__ - "protocol > integration > michelson" - [ - ( Protocol.name ^ ": global table of constants", - Test_global_constants_storage.tests ); - (Protocol.name ^ ": interpretation", Test_interpretation.tests); - (Protocol.name ^ ": lazy storage diff", Test_lazy_storage_diff.tests); - (Protocol.name ^ ": sapling", Test_sapling.tests); - (Protocol.name ^ ": script typed ir size", Test_script_typed_ir_size.tests); - (Protocol.name ^ ": temp big maps", Test_temp_big_maps.tests); - (Protocol.name ^ ": ticket balance key", Test_ticket_balance_key.tests); - (Protocol.name ^ ": ticket scanner", Test_ticket_scanner.tests); - (Protocol.name ^ ": ticket storage", Test_ticket_storage.tests); - ( Protocol.name ^ ": ticket lazy storage diff", - Test_ticket_lazy_storage_diff.tests ); - ( Protocol.name ^ ": ticket operations diff", - Test_ticket_operations_diff.tests ); - (Protocol.name ^ ": ticket accounting", Test_ticket_accounting.tests); - (Protocol.name ^ ": ticket balance", Test_ticket_balance.tests); - (Protocol.name ^ ": ticket manager", Test_ticket_manager.tests); - (Protocol.name ^ ": typechecking", Test_typechecking.tests); - (Protocol.name ^ ": script cache", Test_script_cache.tests); - ( Protocol.name ^ ": block time instructions", - Test_block_time_instructions.tests ); - (Protocol.name ^ ": annotations", Test_annotations.tests); - (Protocol.name ^ ": event logging", Test_contract_event.tests); - (Protocol.name ^ ": patched contracts", Test_patched_contracts.tests); - (Protocol.name ^ ": lambda normalization", Test_lambda_normalization.tests); - ] - |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_patched_contracts.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_patched_contracts.ml index eb6873547f4f..98d194e53b97 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_patched_contracts.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_patched_contracts.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Protocol Migration (patched scripts) - Invocation: cd src/proto_alpha/lib_protocol/test/integration/michelson - dune exec ./main.exe -- test "^patched contracts$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_patched_contracts.ml Subject: Migration *) @@ -216,3 +216,7 @@ let tests = let module Test = Legacy_patch_test (Patches) in List.concat_map Test.tests Patches.patches) test_modules + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("patched contracts", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_sapling.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_sapling.ml index 549db4f0f3b3..f91fe3152cb0 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_sapling.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_sapling.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Protocol (Sapling) - Invocation: cd src/proto_alpha/lib_protocol/test/integration/michelson && \ - dune exec ./main.exe -- test "^sapling$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_sapling.ml Subject: On the privacy-preserving library Sapling *) @@ -1181,38 +1181,32 @@ let tests = `Quick Raw_context_tests.list_insertion_test; Tztest.tztest "root" `Quick Raw_context_tests.root_test; + Tztest.tztest "get_memo_size" `Quick Raw_context_tests.test_get_memo_size; + Tztest.tztest "verify_memo" `Quick Alpha_context_tests.test_verify_memo; + Tztest.tztest "bench_phases" `Slow Alpha_context_tests.test_bench_phases; Tztest.tztest - "test_get_memo_size" - `Quick - Raw_context_tests.test_get_memo_size; - Tztest.tztest "test_verify_memo" `Quick Alpha_context_tests.test_verify_memo; - Tztest.tztest - "test_bench_phases" - `Slow - Alpha_context_tests.test_bench_phases; - Tztest.tztest - "test_bench_phases_legacy" + "bench_phases_legacy" `Quick Alpha_context_tests.test_bench_phases_legacy; Tztest.tztest - "test_bench_fold_over_same_token" + "bench_fold_over_same_token" `Slow Alpha_context_tests.test_bench_fold_over_same_token; Tztest.tztest - "test_double_spend_same_input" + "double_spend_same_input" `Quick Alpha_context_tests.test_double_spend_same_input; Tztest.tztest - "test_verifyupdate_one_transaction" + "verifyupdate_one_transaction" `Quick Alpha_context_tests.test_verifyupdate_one_transaction; Tztest.tztest - "test_verifyupdate_two_transactions" + "verifyupdate_two_transactions" `Quick Alpha_context_tests.test_verifyupdate_two_transactions; - Tztest.tztest "test_shielded_tez" `Quick Interpreter_tests.test_shielded_tez; + Tztest.tztest "shielded_tez" `Quick Interpreter_tests.test_shielded_tez; Tztest.tztest - "test use state from other contract and transact" + "use state from other contract and transact" `Quick Interpreter_tests.test_use_state_from_other_contract_and_transact; Tztest.tztest @@ -1220,10 +1214,13 @@ let tests = `Quick Interpreter_tests.test_push_sapling_state_should_be_forbidden; Tztest.tztest - "test_transac_and_block" + "transac_and_block" `Quick Interpreter_tests.test_transac_and_block; - Tztest.tztest "test_drop" `Quick Interpreter_tests.test_drop; - Tztest.tztest "test_double" `Quick Interpreter_tests.test_double; - Tztest.tztest "test_state_as_arg" `Quick Interpreter_tests.test_state_as_arg; + Tztest.tztest "drop" `Quick Interpreter_tests.test_drop; + Tztest.tztest "double" `Quick Interpreter_tests.test_double; + Tztest.tztest "state_as_arg" `Quick Interpreter_tests.test_state_as_arg; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("sapling", tests)] |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_script_cache.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_script_cache.ml index 1e7851e8ce63..0c80d333454e 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_script_cache.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_script_cache.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Protocol (cache) - Invocation: cd src/proto_alpha/lib_protocol/test/integration/michelson && \ - dune exec ./main.exe -- test "^script cache$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_script_cache.ml Subject: These unit tests check basic behavior of script cache *) @@ -435,3 +435,7 @@ let tests = test_size_limit_is_in_constants_repr; tztest "entries show LRU behavior" `Quick test_entries_shows_lru; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("script cache", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_script_typed_ir_size.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_script_typed_ir_size.ml index 7c07edc87de8..2e437f1ee0df 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_script_typed_ir_size.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_script_typed_ir_size.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Protocol (script typed IR size) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ - -- test "^script typed ir size$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_script_typed_ir_size.ml Subject: Script_typed_ir computes good approximation of values' sizes *) @@ -1042,9 +1041,13 @@ let check_micheline_sizes () = let tests = let open Tztest in [ - tztest "check value size" `Quick check_value_size; - tztest "check ty size" `Quick check_ty_size; - tztest "check kinstr size" `Quick check_kinstr_size; - tztest "check witness sizes" `Quick check_witness_sizes; - tztest "check micheline sizes" `Quick check_micheline_sizes; + tztest "value size" `Quick check_value_size; + tztest "ty size" `Quick check_ty_size; + tztest "kinstr size" `Quick check_kinstr_size; + tztest "witness sizes" `Quick check_witness_sizes; + tztest "micheline sizes" `Quick check_micheline_sizes; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("script typed ir size", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_temp_big_maps.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_temp_big_maps.ml index 8a073ce9bc63..fe2948beeecd 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_temp_big_maps.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_temp_big_maps.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Protocol (temporary big maps) - Invocation: cd src/proto_alpha/lib_protocol/test/integration/michelson \ - && dune exec ./main.exe -- test "^temp big maps$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_temp_big_maps.ml Subject: On temporary big maps. *) @@ -101,3 +101,7 @@ let tests = (test_temp_big_maps_contract param_left param_right)) param_right_values) param_left_values) + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("temp big maps", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_ticket_accounting.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_ticket_accounting.ml index e81ecd23861b..96c3e4b1299e 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_ticket_accounting.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_ticket_accounting.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Protocol (Ticket_scanner) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ - -- test "^ticket accounting" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_ticket_accounting.ml Subject: Ticket scanner tests *) @@ -1436,7 +1435,11 @@ let tests = `Quick test_update_self_origination; Tztest.tztest - "Test ticket-token map with duplicate keys" + "ticket-token map with duplicate keys" `Quick test_ticket_token_map_of_list_with_duplicates; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("ticket accounting", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_ticket_balance.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_ticket_balance.ml index d01b5833493c..1383c45f2dbf 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_ticket_balance.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_ticket_balance.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Protocol (Ticket_balance_key) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ - -- test "^ticket balance" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_ticket_balance.ml Subject: Ticket balance key hashing *) @@ -1758,34 +1757,35 @@ let test_storage_for_create_and_remove_tickets () = let tests = [ - Tztest.tztest "Test add strict" `Quick test_add_strict; - Tztest.tztest "Test add and remove" `Quick test_add_remove; - Tztest.tztest "Test add to big-map" `Quick test_add_to_big_map; - Tztest.tztest "Test swap big-map" `Quick test_swap_big_map; - Tztest.tztest "Test send ticket" `Quick test_send_tickets; + Tztest.tztest "add strict" `Quick test_add_strict; + Tztest.tztest "add and remove" `Quick test_add_remove; + Tztest.tztest "add to big-map" `Quick test_add_to_big_map; + Tztest.tztest "swap big-map" `Quick test_swap_big_map; + Tztest.tztest "send ticket" `Quick test_send_tickets; Tztest.tztest - "Test send ticket to implicit" + "send ticket to implicit" `Quick test_send_tickets_to_implicit_account; Tztest.tztest - "Test send and store tickets with amount 0" + "send and store tickets with amount 0" `Quick test_send_and_store_zero_amount_tickets; + Tztest.tztest "send tickets in big-map" `Quick test_send_tickets_in_big_map; + Tztest.tztest "modify big-map" `Quick test_modify_big_map; + Tztest.tztest "send drop" `Quick test_send_tickets_in_big_map_and_drop; Tztest.tztest - "Test send tickets in big-map" - `Quick - test_send_tickets_in_big_map; - Tztest.tztest "Test modify big-map" `Quick test_modify_big_map; - Tztest.tztest "Test send drop" `Quick test_send_tickets_in_big_map_and_drop; - Tztest.tztest - "Test create contract with ticket" + "create contract with ticket" `Quick test_create_contract_with_ticket; - Tztest.tztest "Test join" `Quick test_join_tickets; - Tztest.tztest "Test wallet" `Quick test_ticket_wallet; - Tztest.tztest "Test ticket storage" `Quick test_ticket_storage; + Tztest.tztest "join" `Quick test_join_tickets; + Tztest.tztest "wallet" `Quick test_ticket_wallet; + Tztest.tztest "ticket storage" `Quick test_ticket_storage; Tztest.tztest - "Test storage for create and remove tickets" + "storage for create and remove tickets" `Quick test_storage_for_create_and_remove_tickets; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("ticket balance", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_ticket_balance_key.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_ticket_balance_key.ml index 02b23a232a12..a9604351a557 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_ticket_balance_key.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_ticket_balance_key.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Protocol (Ticket_balance_key) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ - -- test "^ticket balance key" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_ticket_balance_key.ml Subject: Ticket balance key hashing *) @@ -427,30 +426,28 @@ let test_option_some () = let tests = [ - Tztest.tztest "Test different ticketers" `Quick test_different_ticketers; - Tztest.tztest "Test different owners" `Quick test_different_owners; - Tztest.tztest "Test different content" `Quick test_different_content; - Tztest.tztest "Test different amounts" `Quick test_different_amounts; - Tztest.tztest "Test nat int" `Quick test_nat_int; - Tztest.tztest "Test nat mutez" `Quick test_nat_mutez; - Tztest.tztest "Test not bool" `Quick test_bool_nat; - Tztest.tztest "Test nat bytes" `Quick test_nat_bytes; - Tztest.tztest "Test string chain_id" `Quick test_string_chain_id; - Tztest.tztest "Test string key_hash" `Quick test_string_key_hash; - Tztest.tztest "Test string timestamp" `Quick test_string_timestamp; - Tztest.tztest "Test string address" `Quick test_string_address; - Tztest.tztest "Test string key" `Quick test_string_key; - Tztest.tztest "Test string signature" `Quick test_string_signature; - Tztest.tztest "Test annotations for pair" `Quick test_annotation_pair; - Tztest.tztest "Test annotations for or" `Quick test_annotation_or; - Tztest.tztest - "Test annotations for type alias" - `Quick - test_annotation_type_alias; - Tztest.tztest - "Test annotations for paired ors" - `Quick - test_annotation_pair_or; - Tztest.tztest "Test option none" `Quick test_option_none; - Tztest.tztest "Test option some" `Quick test_option_some; + Tztest.tztest "different ticketers" `Quick test_different_ticketers; + Tztest.tztest "different owners" `Quick test_different_owners; + Tztest.tztest "different content" `Quick test_different_content; + Tztest.tztest "different amounts" `Quick test_different_amounts; + Tztest.tztest "nat int" `Quick test_nat_int; + Tztest.tztest "nat mutez" `Quick test_nat_mutez; + Tztest.tztest "not bool" `Quick test_bool_nat; + Tztest.tztest "nat bytes" `Quick test_nat_bytes; + Tztest.tztest "string chain_id" `Quick test_string_chain_id; + Tztest.tztest "string key_hash" `Quick test_string_key_hash; + Tztest.tztest "string timestamp" `Quick test_string_timestamp; + Tztest.tztest "string address" `Quick test_string_address; + Tztest.tztest "string key" `Quick test_string_key; + Tztest.tztest "string signature" `Quick test_string_signature; + Tztest.tztest "annotations for pair" `Quick test_annotation_pair; + Tztest.tztest "annotations for or" `Quick test_annotation_or; + Tztest.tztest "annotations for type alias" `Quick test_annotation_type_alias; + Tztest.tztest "annotations for paired ors" `Quick test_annotation_pair_or; + Tztest.tztest "option none" `Quick test_option_none; + Tztest.tztest "option some" `Quick test_option_some; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("ticket balance key", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_ticket_lazy_storage_diff.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_ticket_lazy_storage_diff.ml index fbf5d8d6fc5e..efb7cc9d67b0 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_ticket_lazy_storage_diff.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_ticket_lazy_storage_diff.ml @@ -27,9 +27,8 @@ (** Testing ------- Component: Protocol (Ticket_scanner) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ - -- test "^ticket lazy storage diff" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_ticket_lazy_storage_diff.ml Subject: Ticket scanner tests *) @@ -662,38 +661,36 @@ let test_mix_lazy_diffs () = let tests = [ - Tztest.tztest "Test allocate new empty" `Quick test_allocate_new_empty; - Tztest.tztest "Test allocate new" `Quick test_allocate_new; - Tztest.tztest - "Test allocate new no tickets" - `Quick - test_allocate_new_no_tickets; + Tztest.tztest "allocate new empty" `Quick test_allocate_new_empty; + Tztest.tztest "allocate new" `Quick test_allocate_new; + Tztest.tztest "allocate new no tickets" `Quick test_allocate_new_no_tickets; Tztest.tztest "Remove" `Quick test_remove_big_map; Tztest.tztest - "Test no updates to existing" + "no updates to existing" `Quick test_no_updates_to_existing_big_map; + Tztest.tztest "update existing big-map" `Quick test_update_existing_big_map; Tztest.tztest - "Test update existing big-map" - `Quick - test_update_existing_big_map; - Tztest.tztest - "Test update same key multiple times on existing big-map" + "update same key multiple times on existing big-map" `Quick test_update_same_key_multiple_times_existing_big_map; Tztest.tztest - "Test remove same key multiple times on existing big-map" + "remove same key multiple times on existing big-map" `Quick test_remove_same_key_multiple_times_existing_big_map; Tztest.tztest - "Test update and remove same key multiple times on existing big-map" + "update and remove same key multiple times on existing big-map" `Quick test_update_and_remove_same_key_multiple_times_existing_big_map; - Tztest.tztest "Test copy" `Quick test_copy_big_map; - Tztest.tztest "Test copy with updates" `Quick test_copy_big_map_with_updates; + Tztest.tztest "copy" `Quick test_copy_big_map; + Tztest.tztest "copy with updates" `Quick test_copy_big_map_with_updates; Tztest.tztest - "Test copy with multiple updates to same key" + "copy with multiple updates to same key" `Quick test_copy_big_map_with_updates_to_same_key; - Tztest.tztest "Test mix lazy diffs" `Quick test_mix_lazy_diffs; + Tztest.tztest "mix lazy diffs" `Quick test_mix_lazy_diffs; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("ticket lazy storage diff", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_ticket_manager.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_ticket_manager.ml index c0edcbe1c86e..0cbe158dd967 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_ticket_manager.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_ticket_manager.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Protocol (Ticket_balance_key) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ - -- test "^ticket manager" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_ticket_manager.ml Subject: Tests that compare the ticket-balance table against tickets in the contract storages. The tests include a lot of operations that sends and store tickets. After each operation we check that the @@ -812,3 +811,7 @@ let tests = test_add_remove_from_lazy_storage; Tztest.tztest "Mix of operations" `Quick test_mixed_operations; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("ticket manager", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_ticket_operations_diff.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_ticket_operations_diff.ml index 9feaa8317531..bc68ab8577af 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_ticket_operations_diff.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_ticket_operations_diff.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Protocol (Ticket_scanner) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ - -- test "^ticket operations diff" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_ticket_operations_diff.ml Subject: Ticket scanner tests *) @@ -1271,72 +1270,73 @@ let test_fail_on_zero_amount_tickets () = let tests = [ Tztest.tztest - "Test operations that do not involve tickets" + "operations that do not involve tickets" `Quick test_non_ticket_operations; Tztest.tztest - "Test transfer to non-ticket contract" + "transfer to non-ticket contract" `Quick test_transfer_to_non_ticket_contract; Tztest.tztest - "Test transfer empty ticket list" + "transfer empty ticket list" `Quick test_transfer_empty_ticket_list; - Tztest.tztest "Test transfer one ticket" `Quick test_transfer_one_ticket; + Tztest.tztest "transfer one ticket" `Quick test_transfer_one_ticket; Tztest.tztest - "Test transfer multiple tickets" + "transfer multiple tickets" `Quick test_transfer_multiple_tickets; Tztest.tztest - "Test transfer different tickets" + "transfer different tickets" `Quick test_transfer_different_tickets; Tztest.tztest - "Test transfer to two contracts with different tickets" + "transfer to two contracts with different tickets" `Quick test_transfer_to_two_contracts_with_different_tickets; Tztest.tztest - "Test originate contract that does not contain tickets" + "originate contract that does not contain tickets" `Quick test_originate_non_ticket_contract; Tztest.tztest - "Test originate with empty ticket list" + "originate with empty ticket list" `Quick test_originate_with_empty_tickets_list; Tztest.tztest - "Test originate with one ticket" + "originate with one ticket" `Quick test_originate_with_one_ticket; Tztest.tztest - "Test originate with multiple tickets" + "originate with multiple tickets" `Quick test_originate_with_multiple_tickets; Tztest.tztest - "Test originate with different tickets" + "originate with different tickets" `Quick test_originate_with_different_tickets; Tztest.tztest - "Test originate two contracts with different tickets" + "originate two contracts with different tickets" `Quick test_originate_two_contracts_with_different_tickets; + Tztest.tztest "originate and transfer" `Quick test_originate_and_transfer; Tztest.tztest - "Test originate and transfer" - `Quick - test_originate_and_transfer; - Tztest.tztest - "Test originate big-map with tickets" + "originate big-map with tickets" `Quick test_originate_big_map_with_tickets; Tztest.tztest - "Test transfer big-map with tickets" + "transfer big-map with tickets" `Quick test_transfer_big_map_with_tickets; Tztest.tztest - "Test transfer fails on multiple zero tickets" + "transfer fails on multiple zero tickets" `Quick test_transfer_fails_on_multiple_zero_tickets; Tztest.tztest - "Test fail in zero-amount tickets" + "fail in zero-amount tickets" `Quick test_fail_on_zero_amount_tickets; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("ticket operations diff", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_ticket_scanner.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_ticket_scanner.ml index 27cdf80d8478..8397f187d9fd 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_ticket_scanner.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_ticket_scanner.ml @@ -27,9 +27,8 @@ (** Testing ------- Component: Protocol (Ticket_scanner) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ - -- test "^ticket scanner" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_ticket_scanner.ml Subject: Ticket scanner tests *) @@ -634,67 +633,67 @@ let test_tickets_remove_overlay_in_non_empty_in_big_map_ref () = let tests = [ + Tztest.tztest "tickets in unit ticket" `Quick test_tickets_in_unit_ticket; + Tztest.tztest "tickets in list" `Quick test_tickets_in_list; Tztest.tztest - "Test tickets in unit ticket" - `Quick - test_tickets_in_unit_ticket; - Tztest.tztest "Test tickets in list" `Quick test_tickets_in_list; - Tztest.tztest - "Test tickets in list with zero amount" + "tickets in list with zero amount" `Quick test_tickets_in_list_with_zero_amount; - Tztest.tztest "Test tickets in pair" `Quick test_tickets_in_pair; + Tztest.tztest "tickets in pair" `Quick test_tickets_in_pair; Tztest.tztest - "Test tickets in pair with zero amount" + "tickets in pair with zero amount" `Quick test_tickets_in_pair_with_zero_amount; - Tztest.tztest "Test tickets in map" `Quick test_tickets_in_map; + Tztest.tztest "tickets in map" `Quick test_tickets_in_map; Tztest.tztest - "Test tickets in map with zero amount" + "tickets in map with zero amount" `Quick test_tickets_in_map_with_zero_amount; - Tztest.tztest "Test tickets in big map" `Quick test_tickets_in_big_map; + Tztest.tztest "tickets in big map" `Quick test_tickets_in_big_map; Tztest.tztest - "Test tickets in big map with include lazy set to false" + "tickets in big map with include lazy set to false" `Quick test_tickets_in_big_map_strict_only; Tztest.tztest - "Test tickets in list in big map" + "tickets in list in big map" `Quick test_tickets_in_list_in_big_map; Tztest.tztest - "Test tickets in a pair of big-map and list with include lazy set to \ - false" + "tickets in a pair of big-map and list with include lazy set to false" `Quick test_tickets_in_pair_big_map_and_list_strict_only; - Tztest.tztest "Test tickets in or left" `Quick test_tickets_in_or_left; + Tztest.tztest "tickets in or left" `Quick test_tickets_in_or_left; Tztest.tztest - "Test tickets in or left with zero amount" + "tickets in or left with zero amount" `Quick test_tickets_in_or_left_with_zero_amount; - Tztest.tztest "Test tickets in or right" `Quick test_tickets_in_or_right; + Tztest.tztest "tickets in or right" `Quick test_tickets_in_or_right; Tztest.tztest - "Test tickets in empty big-map ref" + "tickets in empty big-map ref" `Quick test_tickets_overlay_in_empty_big_map_ref; Tztest.tztest - "Test tickets in big-map ref" + "tickets in big-map ref" `Quick test_tickets_in_empty_big_map_ref; Tztest.tztest - "Test tickets in non-empty big-map ref" + "tickets in non-empty big-map ref" `Quick test_tickets_in_non_empty_big_map_ref; Tztest.tztest - "Test tickets in non-empty big-map ref with overlay" + "tickets in non-empty big-map ref with overlay" `Quick test_tickets_overlay_in_non_empty_in_big_map_ref; Tztest.tztest - "Test tickets replace existing value from overlay" + "tickets replace existing value from overlay" `Quick test_tickets_replace_overlay_in_non_empty_in_big_map_ref; Tztest.tztest - "Test tickets remove existing value from overlay" + "tickets remove existing value from overlay" `Quick test_tickets_remove_overlay_in_non_empty_in_big_map_ref; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("ticket scanner", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_ticket_storage.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_ticket_storage.ml index 4f1ab85ebed0..72bc85e3b258 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_ticket_storage.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_ticket_storage.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Protocol (Alpha_context.Ticket_balance) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ - -- test "^ticket storage$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_ticket_storage.ml Subject: Ticket storage functions tested using the Ticket_balance module in Alpha_context. *) @@ -275,3 +274,7 @@ let tests = test_ticket_balance_different_owners; Tztest.tztest "ticket storage space" `Quick test_storage_space; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("ticket storage", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_typechecking.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_typechecking.ml index 0373dca0b3e0..1f7444fa7a7b 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_typechecking.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/test_typechecking.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Protocol (type-checking) - Invocation: cd src/proto_alpha/lib_protocol/test/integration/michelson && \ - dune exec ./main.exe -- test "^typechecking$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_typechecking.ml Subject: Type-checking *) @@ -873,59 +873,63 @@ let test_contract_failure path = let tests = [ - Tztest.tztest "test unparse view" `Quick test_unparse_view; + Tztest.tztest "unparse view" `Quick test_unparse_view; Tztest.tztest - "test typecheck stack overflow error" + "typecheck stack overflow error" `Quick test_typecheck_stack_overflow; - Tztest.tztest "test comb type parsing" `Quick test_parse_comb_type; - Tztest.tztest "test comb type unparsing" `Quick test_unparse_comb_type; + Tztest.tztest "comb type parsing" `Quick test_parse_comb_type; + Tztest.tztest "comb type unparsing" `Quick test_unparse_comb_type; Tztest.tztest - "test comb comparable type unparsing" + "comb comparable type unparsing" `Quick test_unparse_comb_comparable_type; - Tztest.tztest "test comb data parsing" `Quick test_parse_comb_data; - Tztest.tztest "test comb data unparsing" `Quick test_unparse_comb_data; - Tztest.tztest "test optimal comb data unparsing" `Quick test_optimal_comb; - Tztest.tztest "test parse address" `Quick test_parse_address; + Tztest.tztest "comb data parsing" `Quick test_parse_comb_data; + Tztest.tztest "comb data unparsing" `Quick test_unparse_comb_data; + Tztest.tztest "optimal comb data unparsing" `Quick test_optimal_comb; + Tztest.tztest "parse address" `Quick test_parse_address; Tztest.tztest "test unpackability of the contract type" `Quick test_contract_not_packable; Tztest.tztest - "test forbidden SELF in view" + "forbidden SELF in view" `Quick (test_forbidden_op_in_view "SELF"); Tztest.tztest - "test forbidden SET_DELEGATE in view" + "forbidden SET_DELEGATE in view" `Quick (test_forbidden_op_in_view "SET_DELEGATE"); Tztest.tztest - "test forbidden TRANSFER_TOKENS in view" + "forbidden TRANSFER_TOKENS in view" `Quick (test_forbidden_op_in_view "TRANSFER_TOKENS"); Tztest.tztest - "test forbidden CREATE_CONTRACT in view" + "forbidden CREATE_CONTRACT in view" `Quick (test_forbidden_op_in_view "CREATE_CONTRACT"); Tztest.tztest - "test parse contract data for rollup" + "parse contract data for rollup" `Quick test_parse_contract_data_for_unit_rollup; Tztest.tztest - "test parse contract data for rollup with entrypoint invalid type" + "parse contract data for rollup with entrypoint invalid type" `Quick test_parse_contract_data_for_rollup_with_invalid_type; Tztest.tztest - "test lambda_rec instruction" + "lambda_rec instruction" `Quick (test_contract_success (path // "contracts/rec_fact.tz")); Tztest.tztest - "test lambda_rec instruction with apply" + "lambda_rec instruction with apply" `Quick (test_contract_success (path // "contracts/rec_fact_apply.tz")); Tztest.tztest - "test lambda_rec with type error" + "lambda_rec with type error" `Quick (test_contract_failure (path // "contracts/fail_rec.tz")); ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("typechecking", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/michelson/dune b/src/proto_alpha/lib_protocol/test/integration/michelson/dune index 5c2630b076eb..2d1bdf43125d 100644 --- a/src/proto_alpha/lib_protocol/test/integration/michelson/dune +++ b/src/proto_alpha/lib_protocol/test/integration/michelson/dune @@ -35,7 +35,6 @@ -open Tezos_benchmark_type_inference_alpha -open Tezos_protocol_plugin_alpha) (modules - test_main test_annotations test_block_time_instructions test_contract_event diff --git a/src/proto_alpha/lib_protocol/test/integration/michelson/test_annotations.ml b/src/proto_alpha/lib_protocol/test/integration/michelson/test_annotations.ml index fea6f2894bfa..ae922dacf11a 100644 --- a/src/proto_alpha/lib_protocol/test/integration/michelson/test_annotations.ml +++ b/src/proto_alpha/lib_protocol/test/integration/michelson/test_annotations.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (Michelson annotations) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_annotations.ml Subject: This module tests that Michelson annotations are properly handled. *) @@ -135,3 +136,7 @@ let tests = `Quick test_internal_origination; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("annotations", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/michelson/test_block_time_instructions.ml b/src/proto_alpha/lib_protocol/test/integration/michelson/test_block_time_instructions.ml index 128ad6b36840..047086044bb2 100644 --- a/src/proto_alpha/lib_protocol/test/integration/michelson/test_block_time_instructions.ml +++ b/src/proto_alpha/lib_protocol/test/integration/michelson/test_block_time_instructions.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (Michelson block-time instructions) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_block_time_instructions.ml Subject: This module tests that Michelson instructions related to block time are correct. *) @@ -77,3 +78,7 @@ let tests = `Quick test_min_block_time; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("block time instructions", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/michelson/test_contract_event.ml b/src/proto_alpha/lib_protocol/test/integration/michelson/test_contract_event.ml index 7919cee4f28c..b0bbb7493183 100644 --- a/src/proto_alpha/lib_protocol/test/integration/michelson/test_contract_event.ml +++ b/src/proto_alpha/lib_protocol/test/integration/michelson/test_contract_event.ml @@ -29,7 +29,8 @@ open Alpha_context (** Testing ------- Component: Protocol (event logging) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_contract_event.ml Subject: This module tests that the event logs can be written to the receipt in correct order and expected format. *) @@ -133,3 +134,7 @@ let tests = `Quick contract_test; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("event logging", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/michelson/test_global_constants_storage.ml b/src/proto_alpha/lib_protocol/test/integration/michelson/test_global_constants_storage.ml index 53cdbd060db7..9cc3325e0b03 100644 --- a/src/proto_alpha/lib_protocol/test/integration/michelson/test_global_constants_storage.ml +++ b/src/proto_alpha/lib_protocol/test/integration/michelson/test_global_constants_storage.ml @@ -29,7 +29,8 @@ open Transfers (** Testing ------- Component: Protocol (global table of constants) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_global_constants_storage.ml Subject: This module tests that the global table of constants can be written to and read from across blocks. *) @@ -129,3 +130,10 @@ let tests = `Quick test_no_double_register; ] + +let () = + Alcotest_lwt.run + ~__FILE__ + Protocol.name + [("global table of constants", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/michelson/test_interpretation.ml b/src/proto_alpha/lib_protocol/test/integration/michelson/test_interpretation.ml index 82110bd3afdd..5c4738abd5a8 100644 --- a/src/proto_alpha/lib_protocol/test/integration/michelson/test_interpretation.ml +++ b/src/proto_alpha/lib_protocol/test/integration/michelson/test_interpretation.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (interpretation) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/michelson/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_interpretation.ml Subject: Interpretation of Michelson scripts *) @@ -370,28 +371,28 @@ let path = project_root // Filename.dirname __FILE__ let tests = [ - Tztest.tztest "test bad contract error" `Quick test_bad_contract_parameter; + Tztest.tztest "bad contract error" `Quick test_bad_contract_parameter; Tztest.tztest "check robustness overflow error" `Slow test_stack_overflow; Tztest.tztest "check robustness overflow error in lwt" `Slow test_stack_overflow_in_lwt; Tztest.tztest - "test multiplication no illegitimate overflow" + "multiplication no illegitimate overflow" `Quick test_multiplication_close_to_overflow_passes; - Tztest.tztest "test stack overflow error" `Slow test_stack_overflow; + Tztest.tztest "stack overflow error" `Slow test_stack_overflow; Tztest.tztest_qcheck2 - ~name:"test map instr against options" + ~name:"map instr against options" QCheck2.Gen.( triple (opt small_signed_int) (opt small_signed_int) small_signed_int) Test_map_instr_on_options.test_mapping; Tztest.tztest - "test lambda_rec instruction" + "lambda_rec instruction" `Quick (test_contract_success (path // "contracts/rec_fact.tz") "0" "5" "120"); Tztest.tztest - "test lambda_rec instruction with apply" + "lambda_rec instruction with apply" `Quick (test_contract_success (path // "contracts/rec_fact_apply.tz") @@ -399,11 +400,11 @@ let tests = "5" "120"); Tztest.tztest - "test lambda_rec instruction with an infinite recursion" + "lambda_rec instruction with an infinite recursion" `Quick (test_contract_fail (path // "contracts/omega.tz") "Unit" "Unit"); Tztest.tztest - "test lambda_rec instruction storage" + "lambda_rec instruction storage" `Quick (test_store_and_reload (path // "contracts/rec_fact_store.tz") @@ -422,7 +423,7 @@ let tests = ~param_2:"5" ~expected_storage_str_2:"Left 120"); Tztest.tztest - "test lambda_rec instruction storage apply store" + "lambda_rec instruction storage apply store" `Quick (test_store_and_reload (path // "contracts/rec_fact_apply_store.tz") @@ -450,3 +451,7 @@ let tests = ~expected_storage_str_2:"Left 120"); ] @ error_encoding_tests + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("interpretation", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/michelson/test_lambda_normalization.ml b/src/proto_alpha/lib_protocol/test/integration/michelson/test_lambda_normalization.ml index 8f074b7934a6..7c4f246a9686 100644 --- a/src/proto_alpha/lib_protocol/test/integration/michelson/test_lambda_normalization.ml +++ b/src/proto_alpha/lib_protocol/test/integration/michelson/test_lambda_normalization.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (Michelson) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_lambda_normalization.ml Subject: Test that lambdas are normalized to optimized format at elaboration *) @@ -227,7 +228,11 @@ let test_lambda_normalization () = let tests = [ Tztest.tztest - "Test that lambdas are normalized to optimized format during elaboration" + "lambdas are normalized to optimized format during elaboration" `Quick test_lambda_normalization; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("lambda normalization", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/michelson/test_lazy_storage_diff.ml b/src/proto_alpha/lib_protocol/test/integration/michelson/test_lazy_storage_diff.ml index 03a84159c6b2..e69de0e27f24 100644 --- a/src/proto_alpha/lib_protocol/test/integration/michelson/test_lazy_storage_diff.ml +++ b/src/proto_alpha/lib_protocol/test/integration/michelson/test_lazy_storage_diff.ml @@ -23,6 +23,14 @@ (* *) (*****************************************************************************) +(** Testing + ------- + Component: Protocol (Michelson) + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_lazy_storage_diff.ml + Subject: Test lazy storage +*) + open Protocol (** Generation of input data *) @@ -138,3 +146,7 @@ let tests = Tztest.tztest "conversion roundtrip" `Slow (on_diffs conversion_roundtrip); Tztest.tztest "encoding roundtrip" `Slow (on_diffs encoding_roundtrip); ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("lazy storage diff", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/michelson/test_main.ml b/src/proto_alpha/lib_protocol/test/integration/michelson/test_main.ml deleted file mode 100644 index b218726bc9ff..000000000000 --- a/src/proto_alpha/lib_protocol/test/integration/michelson/test_main.ml +++ /dev/null @@ -1,64 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2021 Nomadic Labs *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -(** Testing - ------- - Component: Protocol - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe - Subject: Integration > Michelson -*) - -let () = - Alcotest_lwt.run - ~__FILE__ - "protocol > integration > michelson" - [ - ( Protocol.name ^ ": global table of constants", - Test_global_constants_storage.tests ); - (Protocol.name ^ ": interpretation", Test_interpretation.tests); - (Protocol.name ^ ": lazy storage diff", Test_lazy_storage_diff.tests); - (Protocol.name ^ ": sapling", Test_sapling.tests); - (Protocol.name ^ ": script typed ir size", Test_script_typed_ir_size.tests); - (Protocol.name ^ ": temp big maps", Test_temp_big_maps.tests); - (Protocol.name ^ ": ticket balance key", Test_ticket_balance_key.tests); - (Protocol.name ^ ": ticket scanner", Test_ticket_scanner.tests); - (Protocol.name ^ ": ticket storage", Test_ticket_storage.tests); - ( Protocol.name ^ ": ticket lazy storage diff", - Test_ticket_lazy_storage_diff.tests ); - ( Protocol.name ^ ": ticket operations diff", - Test_ticket_operations_diff.tests ); - (Protocol.name ^ ": ticket accounting", Test_ticket_accounting.tests); - (Protocol.name ^ ": ticket balance", Test_ticket_balance.tests); - (Protocol.name ^ ": ticket manager", Test_ticket_manager.tests); - (Protocol.name ^ ": typechecking", Test_typechecking.tests); - (Protocol.name ^ ": script cache", Test_script_cache.tests); - ( Protocol.name ^ ": block time instructions", - Test_block_time_instructions.tests ); - (Protocol.name ^ ": annotations", Test_annotations.tests); - (Protocol.name ^ ": event logging", Test_contract_event.tests); - (Protocol.name ^ ": patched contracts", Test_patched_contracts.tests); - (Protocol.name ^ ": lambda normalization", Test_lambda_normalization.tests); - ] - |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/michelson/test_patched_contracts.ml b/src/proto_alpha/lib_protocol/test/integration/michelson/test_patched_contracts.ml index 60b76797557c..0f6be435917d 100644 --- a/src/proto_alpha/lib_protocol/test/integration/michelson/test_patched_contracts.ml +++ b/src/proto_alpha/lib_protocol/test/integration/michelson/test_patched_contracts.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol Migration (patched scripts) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_patched_contracts.ml Subject: Migration *) @@ -215,3 +216,7 @@ let tests = let module Test = Legacy_patch_test (Patches) in List.concat_map Test.tests Patches.patches) test_modules + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("patched contracts", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/michelson/test_sapling.ml b/src/proto_alpha/lib_protocol/test/integration/michelson/test_sapling.ml index 8cf026bfb9c0..a5c6a9e1b706 100644 --- a/src/proto_alpha/lib_protocol/test/integration/michelson/test_sapling.ml +++ b/src/proto_alpha/lib_protocol/test/integration/michelson/test_sapling.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (Sapling) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_sapling.ml Subject: On the privacy-preserving library Sapling *) @@ -1180,38 +1181,32 @@ let tests = `Quick Raw_context_tests.list_insertion_test; Tztest.tztest "root" `Quick Raw_context_tests.root_test; + Tztest.tztest "get_memo_size" `Quick Raw_context_tests.test_get_memo_size; + Tztest.tztest "verify_memo" `Quick Alpha_context_tests.test_verify_memo; + Tztest.tztest "bench_phases" `Slow Alpha_context_tests.test_bench_phases; Tztest.tztest - "test_get_memo_size" - `Quick - Raw_context_tests.test_get_memo_size; - Tztest.tztest "test_verify_memo" `Quick Alpha_context_tests.test_verify_memo; - Tztest.tztest - "test_bench_phases" - `Slow - Alpha_context_tests.test_bench_phases; - Tztest.tztest - "test_bench_phases_legacy" + "bench_phases_legacy" `Quick Alpha_context_tests.test_bench_phases_legacy; Tztest.tztest - "test_bench_fold_over_same_token" + "bench_fold_over_same_token" `Slow Alpha_context_tests.test_bench_fold_over_same_token; Tztest.tztest - "test_double_spend_same_input" + "double_spend_same_input" `Quick Alpha_context_tests.test_double_spend_same_input; Tztest.tztest - "test_verifyupdate_one_transaction" + "verifyupdate_one_transaction" `Quick Alpha_context_tests.test_verifyupdate_one_transaction; Tztest.tztest - "test_verifyupdate_two_transactions" + "verifyupdate_two_transactions" `Quick Alpha_context_tests.test_verifyupdate_two_transactions; - Tztest.tztest "test_shielded_tez" `Quick Interpreter_tests.test_shielded_tez; + Tztest.tztest "shielded_tez" `Quick Interpreter_tests.test_shielded_tez; Tztest.tztest - "test use state from other contract and transact" + "use state from other contract and transact" `Quick Interpreter_tests.test_use_state_from_other_contract_and_transact; Tztest.tztest @@ -1219,10 +1214,13 @@ let tests = `Quick Interpreter_tests.test_push_sapling_state_should_be_forbidden; Tztest.tztest - "test_transac_and_block" + "transac_and_block" `Quick Interpreter_tests.test_transac_and_block; - Tztest.tztest "test_drop" `Quick Interpreter_tests.test_drop; - Tztest.tztest "test_double" `Quick Interpreter_tests.test_double; - Tztest.tztest "test_state_as_arg" `Quick Interpreter_tests.test_state_as_arg; + Tztest.tztest "drop" `Quick Interpreter_tests.test_drop; + Tztest.tztest "double" `Quick Interpreter_tests.test_double; + Tztest.tztest "state_as_arg" `Quick Interpreter_tests.test_state_as_arg; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("sapling", tests)] |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/michelson/test_script_cache.ml b/src/proto_alpha/lib_protocol/test/integration/michelson/test_script_cache.ml index 8d64159bd8d6..0177c074c20e 100644 --- a/src/proto_alpha/lib_protocol/test/integration/michelson/test_script_cache.ml +++ b/src/proto_alpha/lib_protocol/test/integration/michelson/test_script_cache.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (cache) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_script_cache.ml Subject: These unit tests check basic behavior of script cache *) @@ -434,3 +435,7 @@ let tests = test_size_limit_is_in_constants_repr; tztest "entries show LRU behavior" `Quick test_entries_shows_lru; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("script cache", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/michelson/test_script_typed_ir_size.ml b/src/proto_alpha/lib_protocol/test/integration/michelson/test_script_typed_ir_size.ml index 5652969b2fc5..6422c891e5d9 100644 --- a/src/proto_alpha/lib_protocol/test/integration/michelson/test_script_typed_ir_size.ml +++ b/src/proto_alpha/lib_protocol/test/integration/michelson/test_script_typed_ir_size.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (script typed IR size) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_script_typed_ir_size.ml Subject: Script_typed_ir computes good approximation of values' sizes *) @@ -1040,9 +1041,13 @@ let check_micheline_sizes () = let tests = let open Tztest in [ - tztest "check value size" `Quick check_value_size; - tztest "check ty size" `Quick check_ty_size; - tztest "check kinstr size" `Quick check_kinstr_size; - tztest "check witness sizes" `Quick check_witness_sizes; - tztest "check micheline sizes" `Quick check_micheline_sizes; + tztest "value size" `Quick check_value_size; + tztest "ty size" `Quick check_ty_size; + tztest "kinstr size" `Quick check_kinstr_size; + tztest "witness sizes" `Quick check_witness_sizes; + tztest "micheline sizes" `Quick check_micheline_sizes; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("script typed ir size", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/michelson/test_temp_big_maps.ml b/src/proto_alpha/lib_protocol/test/integration/michelson/test_temp_big_maps.ml index 1b971500280c..4206b836b05f 100644 --- a/src/proto_alpha/lib_protocol/test/integration/michelson/test_temp_big_maps.ml +++ b/src/proto_alpha/lib_protocol/test/integration/michelson/test_temp_big_maps.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (temporary big maps) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_temp_big_maps.ml Subject: On temporary big maps. *) @@ -100,3 +101,7 @@ let tests = (test_temp_big_maps_contract param_left param_right)) param_right_values) param_left_values) + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("temp big maps", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_accounting.ml b/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_accounting.ml index 4a4abd260a96..f7b3e4bcbc35 100644 --- a/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_accounting.ml +++ b/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_accounting.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (Ticket_scanner) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_ticket_accounting.ml Subject: Ticket scanner tests *) @@ -1434,7 +1435,11 @@ let tests = `Quick test_update_self_origination; Tztest.tztest - "Test ticket-token map with duplicate keys" + "ticket-token map with duplicate keys" `Quick test_ticket_token_map_of_list_with_duplicates; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("ticket accounting", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_balance.ml b/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_balance.ml index c8a342b0fa71..909f6b0bb1ff 100644 --- a/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_balance.ml +++ b/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_balance.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (Ticket_balance_key) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_ticket_balance.ml Subject: Ticket balance key hashing *) @@ -1756,34 +1757,35 @@ let test_storage_for_create_and_remove_tickets () = let tests = [ - Tztest.tztest "Test add strict" `Quick test_add_strict; - Tztest.tztest "Test add and remove" `Quick test_add_remove; - Tztest.tztest "Test add to big-map" `Quick test_add_to_big_map; - Tztest.tztest "Test swap big-map" `Quick test_swap_big_map; - Tztest.tztest "Test send ticket" `Quick test_send_tickets; + Tztest.tztest "add strict" `Quick test_add_strict; + Tztest.tztest "add and remove" `Quick test_add_remove; + Tztest.tztest "add to big-map" `Quick test_add_to_big_map; + Tztest.tztest "swap big-map" `Quick test_swap_big_map; + Tztest.tztest "send ticket" `Quick test_send_tickets; Tztest.tztest - "Test send ticket to implicit" + "send ticket to implicit" `Quick test_send_tickets_to_implicit_account; Tztest.tztest - "Test send and store tickets with amount 0" + "send and store tickets with amount 0" `Quick test_send_and_store_zero_amount_tickets; + Tztest.tztest "send tickets in big-map" `Quick test_send_tickets_in_big_map; + Tztest.tztest "modify big-map" `Quick test_modify_big_map; + Tztest.tztest "send drop" `Quick test_send_tickets_in_big_map_and_drop; Tztest.tztest - "Test send tickets in big-map" - `Quick - test_send_tickets_in_big_map; - Tztest.tztest "Test modify big-map" `Quick test_modify_big_map; - Tztest.tztest "Test send drop" `Quick test_send_tickets_in_big_map_and_drop; - Tztest.tztest - "Test create contract with ticket" + "create contract with ticket" `Quick test_create_contract_with_ticket; - Tztest.tztest "Test join" `Quick test_join_tickets; - Tztest.tztest "Test wallet" `Quick test_ticket_wallet; - Tztest.tztest "Test ticket storage" `Quick test_ticket_storage; + Tztest.tztest "join" `Quick test_join_tickets; + Tztest.tztest "wallet" `Quick test_ticket_wallet; + Tztest.tztest "ticket storage" `Quick test_ticket_storage; Tztest.tztest - "Test storage for create and remove tickets" + "storage for create and remove tickets" `Quick test_storage_for_create_and_remove_tickets; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("ticket balance", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_balance_key.ml b/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_balance_key.ml index 6207afdb8a1a..419642d47780 100644 --- a/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_balance_key.ml +++ b/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_balance_key.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (Ticket_balance_key) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_ticket_balance_key.ml Subject: Ticket balance key hashing *) @@ -425,30 +426,28 @@ let test_option_some () = let tests = [ - Tztest.tztest "Test different ticketers" `Quick test_different_ticketers; - Tztest.tztest "Test different owners" `Quick test_different_owners; - Tztest.tztest "Test different content" `Quick test_different_content; - Tztest.tztest "Test different amounts" `Quick test_different_amounts; - Tztest.tztest "Test nat int" `Quick test_nat_int; - Tztest.tztest "Test nat mutez" `Quick test_nat_mutez; - Tztest.tztest "Test not bool" `Quick test_bool_nat; - Tztest.tztest "Test nat bytes" `Quick test_nat_bytes; - Tztest.tztest "Test string chain_id" `Quick test_string_chain_id; - Tztest.tztest "Test string key_hash" `Quick test_string_key_hash; - Tztest.tztest "Test string timestamp" `Quick test_string_timestamp; - Tztest.tztest "Test string address" `Quick test_string_address; - Tztest.tztest "Test string key" `Quick test_string_key; - Tztest.tztest "Test string signature" `Quick test_string_signature; - Tztest.tztest "Test annotations for pair" `Quick test_annotation_pair; - Tztest.tztest "Test annotations for or" `Quick test_annotation_or; - Tztest.tztest - "Test annotations for type alias" - `Quick - test_annotation_type_alias; - Tztest.tztest - "Test annotations for paired ors" - `Quick - test_annotation_pair_or; - Tztest.tztest "Test option none" `Quick test_option_none; - Tztest.tztest "Test option some" `Quick test_option_some; + Tztest.tztest "different ticketers" `Quick test_different_ticketers; + Tztest.tztest "different owners" `Quick test_different_owners; + Tztest.tztest "different content" `Quick test_different_content; + Tztest.tztest "different amounts" `Quick test_different_amounts; + Tztest.tztest "nat int" `Quick test_nat_int; + Tztest.tztest "nat mutez" `Quick test_nat_mutez; + Tztest.tztest "not bool" `Quick test_bool_nat; + Tztest.tztest "nat bytes" `Quick test_nat_bytes; + Tztest.tztest "string chain_id" `Quick test_string_chain_id; + Tztest.tztest "string key_hash" `Quick test_string_key_hash; + Tztest.tztest "string timestamp" `Quick test_string_timestamp; + Tztest.tztest "string address" `Quick test_string_address; + Tztest.tztest "string key" `Quick test_string_key; + Tztest.tztest "string signature" `Quick test_string_signature; + Tztest.tztest "annotations for pair" `Quick test_annotation_pair; + Tztest.tztest "annotations for or" `Quick test_annotation_or; + Tztest.tztest "annotations for type alias" `Quick test_annotation_type_alias; + Tztest.tztest "annotations for paired ors" `Quick test_annotation_pair_or; + Tztest.tztest "option none" `Quick test_option_none; + Tztest.tztest "option some" `Quick test_option_some; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("ticket balance key", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_lazy_storage_diff.ml b/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_lazy_storage_diff.ml index b15596bd6baf..4e6cfd96380c 100644 --- a/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_lazy_storage_diff.ml +++ b/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_lazy_storage_diff.ml @@ -27,7 +27,8 @@ (** Testing ------- Component: Protocol (Ticket_scanner) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_ticket_lazy_storage_diff.ml Subject: Ticket scanner tests *) @@ -660,38 +661,36 @@ let test_mix_lazy_diffs () = let tests = [ - Tztest.tztest "Test allocate new empty" `Quick test_allocate_new_empty; - Tztest.tztest "Test allocate new" `Quick test_allocate_new; - Tztest.tztest - "Test allocate new no tickets" - `Quick - test_allocate_new_no_tickets; + Tztest.tztest "allocate new empty" `Quick test_allocate_new_empty; + Tztest.tztest "allocate new" `Quick test_allocate_new; + Tztest.tztest "allocate new no tickets" `Quick test_allocate_new_no_tickets; Tztest.tztest "Remove" `Quick test_remove_big_map; Tztest.tztest - "Test no updates to existing" + "no updates to existing" `Quick test_no_updates_to_existing_big_map; + Tztest.tztest "update existing big-map" `Quick test_update_existing_big_map; Tztest.tztest - "Test update existing big-map" - `Quick - test_update_existing_big_map; - Tztest.tztest - "Test update same key multiple times on existing big-map" + "update same key multiple times on existing big-map" `Quick test_update_same_key_multiple_times_existing_big_map; Tztest.tztest - "Test remove same key multiple times on existing big-map" + "remove same key multiple times on existing big-map" `Quick test_remove_same_key_multiple_times_existing_big_map; Tztest.tztest - "Test update and remove same key multiple times on existing big-map" + "update and remove same key multiple times on existing big-map" `Quick test_update_and_remove_same_key_multiple_times_existing_big_map; - Tztest.tztest "Test copy" `Quick test_copy_big_map; - Tztest.tztest "Test copy with updates" `Quick test_copy_big_map_with_updates; + Tztest.tztest "copy" `Quick test_copy_big_map; + Tztest.tztest "copy with updates" `Quick test_copy_big_map_with_updates; Tztest.tztest - "Test copy with multiple updates to same key" + "copy with multiple updates to same key" `Quick test_copy_big_map_with_updates_to_same_key; - Tztest.tztest "Test mix lazy diffs" `Quick test_mix_lazy_diffs; + Tztest.tztest "mix lazy diffs" `Quick test_mix_lazy_diffs; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("ticket lazy storage diff", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_manager.ml b/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_manager.ml index 7c7d7fbd2e71..1d24fa931e23 100644 --- a/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_manager.ml +++ b/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_manager.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (Ticket_balance_key) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_ticket_manager.ml Subject: Tests that compare the ticket-balance table against tickets in the contract storages. The tests include a lot of operations that sends and store tickets. After each operation we check that the @@ -810,3 +811,7 @@ let tests = test_add_remove_from_lazy_storage; Tztest.tztest "Mix of operations" `Quick test_mixed_operations; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("ticket manager", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_operations_diff.ml b/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_operations_diff.ml index d82c926632fb..b2da9d99fb58 100644 --- a/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_operations_diff.ml +++ b/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_operations_diff.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (Ticket_scanner) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_ticket_operations_diff.ml Subject: Ticket scanner tests *) @@ -1241,72 +1242,73 @@ let test_fail_on_zero_amount_tickets () = let tests = [ Tztest.tztest - "Test operations that do not involve tickets" + "operations that do not involve tickets" `Quick test_non_ticket_operations; Tztest.tztest - "Test transfer to non-ticket contract" + "transfer to non-ticket contract" `Quick test_transfer_to_non_ticket_contract; Tztest.tztest - "Test transfer empty ticket list" + "transfer empty ticket list" `Quick test_transfer_empty_ticket_list; - Tztest.tztest "Test transfer one ticket" `Quick test_transfer_one_ticket; + Tztest.tztest "transfer one ticket" `Quick test_transfer_one_ticket; Tztest.tztest - "Test transfer multiple tickets" + "transfer multiple tickets" `Quick test_transfer_multiple_tickets; Tztest.tztest - "Test transfer different tickets" + "transfer different tickets" `Quick test_transfer_different_tickets; Tztest.tztest - "Test transfer to two contracts with different tickets" + "transfer to two contracts with different tickets" `Quick test_transfer_to_two_contracts_with_different_tickets; Tztest.tztest - "Test originate contract that does not contain tickets" + "originate contract that does not contain tickets" `Quick test_originate_non_ticket_contract; Tztest.tztest - "Test originate with empty ticket list" + "originate with empty ticket list" `Quick test_originate_with_empty_tickets_list; Tztest.tztest - "Test originate with one ticket" + "originate with one ticket" `Quick test_originate_with_one_ticket; Tztest.tztest - "Test originate with multiple tickets" + "originate with multiple tickets" `Quick test_originate_with_multiple_tickets; Tztest.tztest - "Test originate with different tickets" + "originate with different tickets" `Quick test_originate_with_different_tickets; Tztest.tztest - "Test originate two contracts with different tickets" + "originate two contracts with different tickets" `Quick test_originate_two_contracts_with_different_tickets; + Tztest.tztest "originate and transfer" `Quick test_originate_and_transfer; Tztest.tztest - "Test originate and transfer" - `Quick - test_originate_and_transfer; - Tztest.tztest - "Test originate big-map with tickets" + "originate big-map with tickets" `Quick test_originate_big_map_with_tickets; Tztest.tztest - "Test transfer big-map with tickets" + "transfer big-map with tickets" `Quick test_transfer_big_map_with_tickets; Tztest.tztest - "Test transfer fails on multiple zero tickets" + "transfer fails on multiple zero tickets" `Quick test_transfer_fails_on_multiple_zero_tickets; Tztest.tztest - "Test fail in zero-amount tickets" + "fail in zero-amount tickets" `Quick test_fail_on_zero_amount_tickets; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("ticket operations diff", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_scanner.ml b/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_scanner.ml index a93daf390818..4d96d28e019a 100644 --- a/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_scanner.ml +++ b/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_scanner.ml @@ -27,7 +27,8 @@ (** Testing ------- Component: Protocol (Ticket_scanner) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_ticket_scanner.ml Subject: Ticket scanner tests *) @@ -632,67 +633,67 @@ let test_tickets_remove_overlay_in_non_empty_in_big_map_ref () = let tests = [ + Tztest.tztest "tickets in unit ticket" `Quick test_tickets_in_unit_ticket; + Tztest.tztest "tickets in list" `Quick test_tickets_in_list; Tztest.tztest - "Test tickets in unit ticket" - `Quick - test_tickets_in_unit_ticket; - Tztest.tztest "Test tickets in list" `Quick test_tickets_in_list; - Tztest.tztest - "Test tickets in list with zero amount" + "tickets in list with zero amount" `Quick test_tickets_in_list_with_zero_amount; - Tztest.tztest "Test tickets in pair" `Quick test_tickets_in_pair; + Tztest.tztest "tickets in pair" `Quick test_tickets_in_pair; Tztest.tztest - "Test tickets in pair with zero amount" + "tickets in pair with zero amount" `Quick test_tickets_in_pair_with_zero_amount; - Tztest.tztest "Test tickets in map" `Quick test_tickets_in_map; + Tztest.tztest "tickets in map" `Quick test_tickets_in_map; Tztest.tztest - "Test tickets in map with zero amount" + "tickets in map with zero amount" `Quick test_tickets_in_map_with_zero_amount; - Tztest.tztest "Test tickets in big map" `Quick test_tickets_in_big_map; + Tztest.tztest "tickets in big map" `Quick test_tickets_in_big_map; Tztest.tztest - "Test tickets in big map with include lazy set to false" + "tickets in big map with include lazy set to false" `Quick test_tickets_in_big_map_strict_only; Tztest.tztest - "Test tickets in list in big map" + "tickets in list in big map" `Quick test_tickets_in_list_in_big_map; Tztest.tztest - "Test tickets in a pair of big-map and list with include lazy set to \ - false" + "tickets in a pair of big-map and list with include lazy set to false" `Quick test_tickets_in_pair_big_map_and_list_strict_only; - Tztest.tztest "Test tickets in or left" `Quick test_tickets_in_or_left; + Tztest.tztest "tickets in or left" `Quick test_tickets_in_or_left; Tztest.tztest - "Test tickets in or left with zero amount" + "tickets in or left with zero amount" `Quick test_tickets_in_or_left_with_zero_amount; - Tztest.tztest "Test tickets in or right" `Quick test_tickets_in_or_right; + Tztest.tztest "tickets in or right" `Quick test_tickets_in_or_right; Tztest.tztest - "Test tickets in empty big-map ref" + "tickets in empty big-map ref" `Quick test_tickets_overlay_in_empty_big_map_ref; Tztest.tztest - "Test tickets in big-map ref" + "tickets in big-map ref" `Quick test_tickets_in_empty_big_map_ref; Tztest.tztest - "Test tickets in non-empty big-map ref" + "tickets in non-empty big-map ref" `Quick test_tickets_in_non_empty_big_map_ref; Tztest.tztest - "Test tickets in non-empty big-map ref with overlay" + "tickets in non-empty big-map ref with overlay" `Quick test_tickets_overlay_in_non_empty_in_big_map_ref; Tztest.tztest - "Test tickets replace existing value from overlay" + "tickets replace existing value from overlay" `Quick test_tickets_replace_overlay_in_non_empty_in_big_map_ref; Tztest.tztest - "Test tickets remove existing value from overlay" + "tickets remove existing value from overlay" `Quick test_tickets_remove_overlay_in_non_empty_in_big_map_ref; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("ticket scanner", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_storage.ml b/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_storage.ml index 543238917093..9ad05b1745d4 100644 --- a/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_storage.ml +++ b/src/proto_alpha/lib_protocol/test/integration/michelson/test_ticket_storage.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (Alpha_context.Ticket_balance) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_ticket_storage.ml Subject: Ticket storage functions tested using the Ticket_balance module in Alpha_context. *) @@ -273,3 +274,7 @@ let tests = test_ticket_balance_different_owners; Tztest.tztest "ticket storage space" `Quick test_storage_space; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("ticket storage", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/michelson/test_typechecking.ml b/src/proto_alpha/lib_protocol/test/integration/michelson/test_typechecking.ml index 6e342d99edaf..e8dcc3b533e9 100644 --- a/src/proto_alpha/lib_protocol/test/integration/michelson/test_typechecking.ml +++ b/src/proto_alpha/lib_protocol/test/integration/michelson/test_typechecking.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (type-checking) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/michelson/main.exe \ + -- --file test_typechecking.ml Subject: Type-checking *) @@ -872,59 +873,63 @@ let test_contract_failure path = let tests = [ - Tztest.tztest "test unparse view" `Quick test_unparse_view; + Tztest.tztest "unparse view" `Quick test_unparse_view; Tztest.tztest - "test typecheck stack overflow error" + "typecheck stack overflow error" `Quick test_typecheck_stack_overflow; - Tztest.tztest "test comb type parsing" `Quick test_parse_comb_type; - Tztest.tztest "test comb type unparsing" `Quick test_unparse_comb_type; + Tztest.tztest "comb type parsing" `Quick test_parse_comb_type; + Tztest.tztest "comb type unparsing" `Quick test_unparse_comb_type; Tztest.tztest - "test comb comparable type unparsing" + "comb comparable type unparsing" `Quick test_unparse_comb_comparable_type; - Tztest.tztest "test comb data parsing" `Quick test_parse_comb_data; - Tztest.tztest "test comb data unparsing" `Quick test_unparse_comb_data; - Tztest.tztest "test optimal comb data unparsing" `Quick test_optimal_comb; - Tztest.tztest "test parse address" `Quick test_parse_address; + Tztest.tztest "comb data parsing" `Quick test_parse_comb_data; + Tztest.tztest "comb data unparsing" `Quick test_unparse_comb_data; + Tztest.tztest "optimal comb data unparsing" `Quick test_optimal_comb; + Tztest.tztest "parse address" `Quick test_parse_address; Tztest.tztest - "test unpackability of the contract type" + "unpackability of the contract type" `Quick test_contract_not_packable; Tztest.tztest - "test forbidden SELF in view" + "forbidden SELF in view" `Quick (test_forbidden_op_in_view "SELF"); Tztest.tztest - "test forbidden SET_DELEGATE in view" + "forbidden SET_DELEGATE in view" `Quick (test_forbidden_op_in_view "SET_DELEGATE"); Tztest.tztest - "test forbidden TRANSFER_TOKENS in view" + "forbidden TRANSFER_TOKENS in view" `Quick (test_forbidden_op_in_view "TRANSFER_TOKENS"); Tztest.tztest - "test forbidden CREATE_CONTRACT in view" + "forbidden CREATE_CONTRACT in view" `Quick (test_forbidden_op_in_view "CREATE_CONTRACT"); Tztest.tztest - "test parse contract data for rollup" + "parse contract data for rollup" `Quick test_parse_contract_data_for_unit_rollup; Tztest.tztest - "test parse contract data for rollup with entrypoint invalid type" + "parse contract data for rollup with entrypoint invalid type" `Quick test_parse_contract_data_for_rollup_with_invalid_type; Tztest.tztest - "test lambda_rec instruction" + "lambda_rec instruction" `Quick (test_contract_success (path // "contracts/rec_fact.tz")); Tztest.tztest - "test lambda_rec instruction with apply" + "lambda_rec instruction with apply" `Quick (test_contract_success (path // "contracts/rec_fact_apply.tz")); Tztest.tztest - "test lambda_rec with type error" + "lambda_rec with type error" `Quick (test_contract_failure (path // "contracts/fail_rec.tz")); ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("typechecking", tests)] + |> Lwt_main.run -- GitLab From e0a7ab765f57dac1b0b00e4898ad74dcbcabc112 Mon Sep 17 00:00:00 2001 From: lykimq Date: Fri, 7 Apr 2023 13:35:48 +0200 Subject: [PATCH 4/8] Alcotezt-UX: fix invocation headers, opt. titles for [operations] in all protocols --- manifest/main.ml | 1 - .../test/integration/operations/dune | 1 - .../integration/operations/test_activation.ml | 7 +- .../operations/test_combined_operations.ml | 6 +- .../operations/test_failing_noop.ml | 7 +- .../test/integration/operations/test_main.ml | 53 ---------- .../operations/test_origination.ml | 7 +- .../operations/test_paid_storage_increase.ml | 7 +- .../integration/operations/test_reveal.ml | 7 +- .../integration/operations/test_sc_rollup.ml | 17 +-- .../operations/test_sc_rollup_transfer.ml | 7 +- .../integration/operations/test_transfer.ml | 6 +- .../operations/test_transfer_ticket.ml | 11 +- .../integration/operations/test_tx_rollup.ml | 100 ++++++++---------- .../integration/operations/test_voting.ml | 6 +- .../integration/operations/test_zk_rollup.ml | 7 +- .../test/integration/operations/dune | 1 - .../integration/operations/test_activation.ml | 9 +- .../operations/test_combined_operations.ml | 8 +- .../operations/test_failing_noop.ml | 9 +- .../test/integration/operations/test_main.ml | 52 --------- .../operations/test_origination.ml | 9 +- .../operations/test_paid_storage_increase.ml | 9 +- .../integration/operations/test_reveal.ml | 9 +- .../integration/operations/test_sc_rollup.ml | 25 +++-- .../operations/test_sc_rollup_transfer.ml | 9 +- .../integration/operations/test_transfer.ml | 8 +- .../operations/test_transfer_ticket.ml | 13 ++- .../integration/operations/test_voting.ml | 8 +- .../integration/operations/test_zk_rollup.ml | 9 +- .../test/integration/operations/dune | 1 - .../integration/operations/test_activation.ml | 7 +- .../operations/test_combined_operations.ml | 6 +- .../operations/test_failing_noop.ml | 7 +- .../test/integration/operations/test_main.ml | 52 --------- .../operations/test_origination.ml | 7 +- .../operations/test_paid_storage_increase.ml | 7 +- .../integration/operations/test_reveal.ml | 7 +- .../integration/operations/test_sc_rollup.ml | 23 ++-- .../operations/test_sc_rollup_transfer.ml | 7 +- .../integration/operations/test_transfer.ml | 6 +- .../operations/test_transfer_ticket.ml | 11 +- .../integration/operations/test_voting.ml | 6 +- .../integration/operations/test_zk_rollup.ml | 7 +- 44 files changed, 281 insertions(+), 301 deletions(-) delete mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_main.ml delete mode 100644 src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_main.ml delete mode 100644 src/proto_alpha/lib_protocol/test/integration/operations/test_main.ml diff --git a/manifest/main.ml b/manifest/main.ml index 79b7c99d548d..9fcdfaf5c0b8 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -4685,7 +4685,6 @@ end = struct let _integration_operations = let modules = [ - ("test_main", true); ("test_activation", true); ("test_combined_operations", true); ("test_failing_noop", true); diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/dune b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/dune index 5efb8044f524..b42195537278 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/dune +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/dune @@ -28,7 +28,6 @@ -open Tezos_base_test_helpers -open Tezos_protocol_plugin_016_PtMumbai) (modules - test_main test_activation test_combined_operations test_failing_noop diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_activation.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_activation.ml index 27aa8829335b..c3caf1c1c0a2 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_activation.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_activation.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (activation) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/operations/main.exe \ + -- --file test_activation.ml Subject: The activation operation creates an implicit contract from a registered commitment present in the context. It is parametrized by a public key hash (pkh) and a secret. @@ -571,3 +572,7 @@ let tests = `Quick test_invalid_transfer_from_unactivated_account; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("activation", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_combined_operations.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_combined_operations.ml index 2574fce2d1a0..13cc2ad379b3 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_combined_operations.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_combined_operations.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (combined operations) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/operations/main.exe \ + -- --file test_combined_operations.ml Subject: Multiple operations can be grouped in one ensuring their deterministic application. @@ -407,3 +408,6 @@ let tests = `Quick test_inconsistent_counters; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("combined", tests)] |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_failing_noop.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_failing_noop.ml index bd51316a7ff7..6f54e5daabcf 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_failing_noop.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_failing_noop.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/operations/main.exe \ + -- --file test_failing_noop.ml Subject: The Failing_noop operation was added bearing in mind the possibility for the end user to sign arbitrary bytes, encapsulate in the operation, with the absolute garanty that @@ -47,3 +48,7 @@ let failing_noop_must_fail_when_injected () = let tests = [Tztest.tztest "injection fails" `Quick failing_noop_must_fail_when_injected] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("failing_noop operation", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_main.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_main.ml deleted file mode 100644 index dcb9b02326ef..000000000000 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_main.ml +++ /dev/null @@ -1,53 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2021 Nomadic Labs *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -(** Testing - ------- - Component: Protocol - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe - Subject: Entrypoint -*) - -let () = - Alcotest_lwt.run - ~__FILE__ - "protocol > integration > operations" - [ - (Protocol.name ^ ": voting", Test_voting.tests); - (Protocol.name ^ ": origination", Test_origination.tests); - (Protocol.name ^ ": revelation", Test_reveal.tests); - (Protocol.name ^ ": transfer", Test_transfer.tests); - (Protocol.name ^ ": activation", Test_activation.tests); - ( Protocol.name ^ ": paid storage increase", - Test_paid_storage_increase.tests ); - (Protocol.name ^ ": combined", Test_combined_operations.tests); - (Protocol.name ^ ": failing_noop operation", Test_failing_noop.tests); - (Protocol.name ^ ": tx rollup", Test_tx_rollup.tests); - (Protocol.name ^ ": sc rollup", Test_sc_rollup.tests); - (Protocol.name ^ ": sc rollup transfer", Test_sc_rollup_transfer.tests); - (Protocol.name ^ ": zk rollup", Test_zk_rollup.tests); - (Protocol.name ^ ": transfer ticket", Test_transfer_ticket.tests); - ] - |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_origination.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_origination.ml index dd4e1bd69f64..40bda2095d36 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_origination.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_origination.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (origination) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/operations/main.exe \ + -- --file test_origination.ml Subject: On originating contracts. *) @@ -324,3 +325,7 @@ let tests = Tztest.tztest "counter" `Quick test_counter; Tztest.tztest "unparsable script" `Quick test_unparsable_script; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("origination", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_paid_storage_increase.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_paid_storage_increase.ml index 8d9944979cf4..8fbdbe53f7de 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_paid_storage_increase.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_paid_storage_increase.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (increase_paid_storage) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/operations/main.exe \ + -- --file test_paid_storage_increase.ml Subject: On increasing a paid amount of contract storage. *) @@ -243,3 +244,7 @@ let tests = Tztest.tztest "no contract to bump its paid storage" `Quick test_no_contract; Tztest.tztest "effectiveness" `Quick test_effectiveness; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("paid storage increase", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_reveal.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_reveal.ml index 4b1a0def373a..b5308a540269 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_reveal.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_reveal.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (revelation) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/operations/main.exe \ + -- --file test_reveal.ml Subject: On the reveal operation. *) @@ -745,3 +746,7 @@ let tests = `Quick test_valid_reveal_after_emptying_balance; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("revelation", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_sc_rollup.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_sc_rollup.ml index 6fd543af77bc..f4f2742b81ae 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_sc_rollup.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_sc_rollup.ml @@ -27,7 +27,8 @@ (** Testing ------- Component: Rollup layer 1 logic - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/operations/main.exe \ + -- --file test_sc_rollup.ml Subject: Test smart contract rollup *) @@ -3228,13 +3229,13 @@ let tests = `Quick test_inbox_max_number_of_messages_per_level; Tztest.tztest - "Test that a player can't timeout another player before timeout period \ - and related timeout value." + "a player can't timeout another player before timeout period and related \ + timeout value." `Quick test_timeout; Tztest.tztest - "Test that a player cannot play more than max_number_of_parallel_games \ - games in parallel." + "a player cannot play more than max_number_of_parallel_games games in \ + parallel." `Quick test_number_of_parallel_games_bounded; Tztest.tztest @@ -3254,7 +3255,7 @@ let tests = `Quick test_refute_invalid_metadata; Tztest.tztest - "Test that SOL/Info_per_level/EOL are added in the inbox" + "SOL/Info_per_level/EOL are added in the inbox" `Quick test_automatically_added_internal_messages; Tztest.tztest @@ -3289,3 +3290,7 @@ let tests = `Quick test_start_game_on_cemented_commitment; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("sc rollup", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_sc_rollup_transfer.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_sc_rollup_transfer.ml index a7fdbc953376..feb0d62a62fb 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_sc_rollup_transfer.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_sc_rollup_transfer.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Sc rollup L1/L2 communication - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/operations/main.exe \ + -- --file test_sc_rollup_transfer.ml Subject: Test transfers from Michelson to smart contract rollups *) @@ -416,3 +417,7 @@ let tests = `Quick test_transfer_non_zero_amount_ticket; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("sc rollup transfer", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_transfer.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_transfer.ml index 58d6be951199..c9c6555de50b 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_transfer.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_transfer.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (transfer) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/operations/main.exe \ + -- --file test_transfer.ml Subject: Quantities transfer between contracts. *) @@ -892,3 +893,6 @@ let tests = `Quick test_storage_fees_and_internal_operation; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("transfer", tests)] |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_transfer_ticket.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_transfer_ticket.ml index 75bf737bce45..a88ee42fffcd 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_transfer_ticket.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_transfer_ticket.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Transfer_ticket logic - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/operations/main.exe \ + -- --file test_transfer_ticket.ml Subject: Test ticket transfers *) @@ -331,11 +332,15 @@ let test_contract_as_ticket_transfer_destination () = let tests = [ Tztest.tztest - "Test ticket transfer operations" + "ticket transfer operations" `Quick test_mint_deposit_withdraw_implicit_transfer; Tztest.tztest - "Test 'contract (ticket cty)' as transfer destination" + "'contract (ticket cty)' as transfer destination" `Quick test_contract_as_ticket_transfer_destination; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("transfer ticket", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_tx_rollup.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_tx_rollup.ml index 710ebe7f2cd9..114f176e8882 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_tx_rollup.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_tx_rollup.ml @@ -28,7 +28,8 @@ (** Testing ------- Component: Tx rollup layer 1 logic - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/operations/main.exe \ + -- --file test_tx_rollup.ml Subject: Test rollup *) @@ -5794,52 +5795,51 @@ module Withdraw = struct let tests = [ - Tztest.tztest "Test withdraw" `Quick test_valid_withdraw; + Tztest.tztest "withdraw" `Quick test_valid_withdraw; Tztest.tztest - "Test reveal withdrawals w/ missing commitment" + "reveal withdrawals w/ missing commitment" `Quick test_invalid_reveal_withdrawals_no_commitment; Tztest.tztest - "Test reveal withdrawals w/ missing withdraw in commitment" + "reveal withdrawals w/ missing withdraw in commitment" `Quick test_invalid_reveal_withdrawals_missing_withdraw_in_commitment; Tztest.tztest - "Test reveal withdrawals w/ incorrect tickets info" + "reveal withdrawals w/ incorrect tickets info" `Quick test_reveal_withdrawals_invalid_tickets_info; Tztest.tztest - "Test to reveal withdrawals twice" + "reveal withdrawals twice" `Quick test_reveal_withdrawals_twice; Tztest.tztest - "Test withdraw w/ an invalid message index" + "withdraw w/ an invalid message index" `Quick test_invalid_index_or_context; - Tztest.tztest "Test withdrawing too late" `Quick test_too_late_withdrawal; + Tztest.tztest "withdrawing too late" `Quick test_too_late_withdrawal; Tztest.tztest - "Test storage clean up" + "storage clean up" `Quick test_withdrawal_accounting_is_cleaned_up_after_removal; Tztest.tztest - "Test deposits overflowing to withdrawals" + "deposits overflowing to withdrawals" `Quick test_deposit_overflow_to_withdrawal; Tztest.tztest - "Test deposit to multiple destinations don't overflow" + "deposit to multiple destinations don't overflow" `Quick test_deposit_multiple_destinations_at_limit; Tztest.tztest - "Test multiple withdrawals from the same batch and from different \ - batches" + "multiple withdrawals from the same batch and from different batches" `Quick test_multiple_withdrawals_multiple_batches; Tztest.tztest - "Test deposit, followed by withdrawal, followed by deposit" + "deposit, followed by withdrawal, followed by deposit" `Quick test_forge_deposit_withdraw_deposit; Tztest.tztest - "Test deposit, followed by withdrawal, followed by transfer to an \ - implicit account" + "deposit, followed by withdrawal, followed by transfer to an implicit \ + account" `Quick test_forge_deposit_withdraw_implicit_transfer; ] @@ -5847,19 +5847,15 @@ end let tests = [ + Tztest.tztest "feature flag is disabled" `Quick test_disable_feature_flag; + Tztest.tztest "sunset" `Quick test_sunset; + Tztest.tztest "tx rollup origination and burn" `Quick test_origination; Tztest.tztest - "check feature flag is disabled" - `Quick - test_disable_feature_flag; - Tztest.tztest "check sunset" `Quick test_sunset; - Tztest.tztest "check tx rollup origination and burn" `Quick test_origination; - Tztest.tztest - "check two originated tx rollup in one operation have different address" + "two originated tx rollup in one operation have different address" `Quick test_two_originations; Tztest.tztest - "check the function that updates the burn per byte rate of a transaction \ - rollup" + "the function that updates the burn per byte rate of a transaction rollup" `Quick test_burn_per_byte_update; Tztest.tztest "add one batch to a rollup" `Quick test_add_batch; @@ -5880,80 +5876,78 @@ let tests = "Try to add several batches to reach the inbox count limit" `Quick test_inbox_count_too_big; - Tztest.tztest "Test deposit with valid contract" `Quick test_valid_deposit; + Tztest.tztest "deposit with valid contract" `Quick test_valid_deposit; Tztest.tztest - "Test deposit with invalid parameter" + "deposit with invalid parameter" `Quick test_invalid_deposit_not_ticket; Tztest.tztest - "Test deposit with too big ticket" + "deposit with too big ticket" `Quick test_invalid_deposit_too_big_ticket; Tztest.tztest - "Test deposit with too big ticket type" + "deposit with too big ticket type" `Quick test_invalid_deposit_too_big_ticket_type; Tztest.tztest - "Test valid deposit with big ticket" + "valid deposit with big ticket" `Quick test_valid_deposit_big_ticket; Tztest.tztest - "Test valid deposit to inexistant rollup" + "valid deposit to inexistant rollup" `Quick test_valid_deposit_inexistant_rollup; - Tztest.tztest "Test invalid entrypoint" `Quick test_invalid_entrypoint; + Tztest.tztest "invalid entrypoint" `Quick test_invalid_entrypoint; Tztest.tztest - "Test valid deposit to invalid L2 address" + "valid deposit to invalid L2 address" `Quick test_invalid_l2_address; Tztest.tztest - "Test valid deposit with non-zero amount" + "valid deposit with non-zero amount" `Quick test_valid_deposit_invalid_amount; Tztest.tztest - "Test depositing too many tickets" + "depositing too many tickets" `Quick test_deposit_too_many_tickets; - Tztest.tztest "Test finalization" `Quick test_finalization; + Tztest.tztest "finalization" `Quick test_finalization; Tztest.tztest "Smoke test commitment" `Quick test_commitment_duplication; Tztest.tztest - "Test commitment predecessor edge cases" + "commitment predecessor edge cases" `Quick test_commitment_predecessor; - Tztest.tztest "Test full inbox" `Quick test_full_inbox; + Tztest.tztest "full inbox" `Quick test_full_inbox; Tztest.tztest - "Test too many finalized commitments" + "too many finalized commitments" `Quick test_too_many_commitments; - Tztest.tztest - "Test finalization edge cases" - `Quick - test_finalization_edge_cases; - Tztest.tztest "Test bond finalization" `Quick test_bond_finalization; - Tztest.tztest "Test state" `Quick test_state; + Tztest.tztest "finalization edge cases" `Quick test_finalization_edge_cases; + Tztest.tztest "bond finalization" `Quick test_bond_finalization; + Tztest.tztest "state" `Quick test_state; Tztest.tztest "Try to commit to the current inbox and fail" `Quick test_commit_current_inbox; + Tztest.tztest "state with deleted commitment" `Quick test_state_with_deleted; Tztest.tztest - "Test state with deleted commitment" - `Quick - test_state_with_deleted; - Tztest.tztest - "Test upfront message preallocation" + "upfront message preallocation" `Quick test_state_message_storage_preallocation; Tztest.tztest - "Test storage burn for submitting batch" + "storage burn for submitting batch" `Quick test_storage_burn_for_adding_batch; Tztest.tztest - "Test additional space allocation for deposit" + "additional space allocation for deposit" `Quick test_additional_space_allocation_for_valid_deposit; Tztest.tztest - "Test additional space allocation for commitment" + "additional space allocation for commitment" `Quick test_storage_burn_for_commitment; ] @ Withdraw.tests @ Rejection.tests @ parsing_tests + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("tx rollup", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_voting.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_voting.ml index 544ce97f3ec1..8897d3985825 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_voting.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_voting.ml @@ -27,7 +27,8 @@ (** Testing ------- Component: Protocol (voting) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/operations/main.exe \ + -- --file test_voting.ml Subject: On the voting process. *) @@ -2100,3 +2101,6 @@ let tests = test_conflicting_ballot; Tztest.tztest "Valid Ballot operations" `Quick test_valid_ballot; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("voting", tests)] |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_zk_rollup.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_zk_rollup.ml index afdecb652646..640449faea0c 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_zk_rollup.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/test_zk_rollup.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Rollup layer 1 logic - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/operations/main.exe \ + -- --file test_zk_rollup.ml Subject: Test zk rollup *) @@ -1259,3 +1260,7 @@ let tests = `Quick test_valid_deposit_and_external_withdrawal; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("zk rollup", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/operations/dune b/src/proto_017_PtNairob/lib_protocol/test/integration/operations/dune index a0d3ffd577a3..1fb2146fd6a0 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/operations/dune +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/operations/dune @@ -28,7 +28,6 @@ -open Tezos_base_test_helpers -open Tezos_protocol_plugin_017_PtNairob) (modules - test_main test_activation test_combined_operations test_failing_noop diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_activation.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_activation.ml index 5f6e34a3046e..0e415f400cfb 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_activation.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_activation.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Protocol (activation) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ - -- test "^activation$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/operations/main.exe \ + -- --file test_activation.ml Subject: The activation operation creates an implicit contract from a registered commitment present in the context. It is parametrized by a public key hash (pkh) and a secret. @@ -573,3 +572,7 @@ let tests = `Quick test_invalid_transfer_from_unactivated_account; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("activation", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_combined_operations.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_combined_operations.ml index 8fc28644d5da..7a60229cf5fc 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_combined_operations.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_combined_operations.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Protocol (combined operations) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ - -- test "^combined$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/operations/main.exe \ + -- --file test_combined_operations.ml Subject: Multiple operations can be grouped in one ensuring their deterministic application. @@ -409,3 +408,6 @@ let tests = `Quick test_inconsistent_counters; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("combined", tests)] |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_failing_noop.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_failing_noop.ml index 917fe3dec5f4..9a254c2f55fc 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_failing_noop.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_failing_noop.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Protocol - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ - -- test "^failing_noop operation$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/operations/main.exe \ + -- --file test_failing_noop.ml Subject: The Failing_noop operation was added bearing in mind the possibility for the end user to sign arbitrary bytes, encapsulate in the operation, with the absolute garanty that @@ -49,3 +48,7 @@ let failing_noop_must_fail_when_injected () = let tests = [Tztest.tztest "injection fails" `Quick failing_noop_must_fail_when_injected] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("failling_noop operation", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_main.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_main.ml deleted file mode 100644 index d0723c88dd7f..000000000000 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_main.ml +++ /dev/null @@ -1,52 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2021 Nomadic Labs *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -(** Testing - ------- - Component: Protocol - Invocation: dune runtest src/proto_alpha/lib_protocol/test/integration/operations - Subject: Entrypoint -*) - -let () = - Alcotest_lwt.run - ~__FILE__ - "protocol > integration > operations" - [ - (Protocol.name ^ ": voting", Test_voting.tests); - (Protocol.name ^ ": origination", Test_origination.tests); - (Protocol.name ^ ": revelation", Test_reveal.tests); - (Protocol.name ^ ": transfer", Test_transfer.tests); - (Protocol.name ^ ": activation", Test_activation.tests); - ( Protocol.name ^ ": paid storage increase", - Test_paid_storage_increase.tests ); - (Protocol.name ^ ": combined", Test_combined_operations.tests); - (Protocol.name ^ ": failing_noop operation", Test_failing_noop.tests); - (Protocol.name ^ ": sc rollup", Test_sc_rollup.tests); - (Protocol.name ^ ": sc rollup transfer", Test_sc_rollup_transfer.tests); - (Protocol.name ^ ": zk rollup", Test_zk_rollup.tests); - (Protocol.name ^ ": transfer ticket", Test_transfer_ticket.tests); - ] - |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_origination.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_origination.ml index 8531dfe0b5d6..f236fafb1fd7 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_origination.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_origination.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Protocol (origination) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ - -- test "^origination$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/operations/main.exe \ + -- --file test_origination.ml Subject: On originating contracts. *) @@ -326,3 +325,7 @@ let tests = Tztest.tztest "counter" `Quick test_counter; Tztest.tztest "unparsable script" `Quick test_unparsable_script; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("origination", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_paid_storage_increase.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_paid_storage_increase.ml index f233834607eb..73401e05237f 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_paid_storage_increase.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_paid_storage_increase.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Protocol (increase_paid_storage) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ - -- test "^paid storage increase$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/operations/main.exe \ + -- --file test_paid_storage_increase.ml Subject: On increasing a paid amount of contract storage. *) @@ -245,3 +244,7 @@ let tests = Tztest.tztest "no contract to bump its paid storage" `Quick test_no_contract; Tztest.tztest "effectiveness" `Quick test_effectiveness; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("paid storage increase", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_reveal.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_reveal.ml index c4179f275bda..71c61091d4c6 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_reveal.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_reveal.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Protocol (revelation) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ - -- test "^revelation$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/operations/main.exe \ + -- --file test_reveal.ml Subject: On the reveal operation. *) @@ -747,3 +746,7 @@ let tests = `Quick test_valid_reveal_after_emptying_balance; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("revelation", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_sc_rollup.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_sc_rollup.ml index 4dafa2e1d739..cd0d4d50cd3d 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_sc_rollup.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_sc_rollup.ml @@ -27,9 +27,8 @@ (** Testing ------- Component: Rollup layer 1 logic - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ - -- test "^sc rollup$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/operations/main.exe \ + -- --file test_sc_rollup.ml Subject: Test smart contract rollup *) @@ -3488,13 +3487,13 @@ let tests = `Quick test_inbox_max_number_of_messages_per_level; Tztest.tztest - "Test that a player can't timeout another player before timeout period \ - and related timeout value." + "a player can't timeout another player before timeout period and related \ + timeout value." `Quick test_timeout; Tztest.tztest - "Test that a player cannot play more than max_number_of_parallel_games \ - games in parallel." + "a player cannot play more than max_number_of_parallel_games games in \ + parallel." `Quick test_number_of_parallel_games_bounded; Tztest.tztest @@ -3518,17 +3517,17 @@ let tests = `Quick test_refute_invalid_reveal; Tztest.tztest - "Test that SOL/Info_per_level/EOL are added in the inbox" + "SOL/Info_per_level/EOL are added in the inbox" `Quick test_automatically_added_internal_messages; Tztest.tztest "0-tick commitments are forbidden" `Quick test_zero_tick_commitment_fails; - Tztest.tztest "check the curfew functionality" `Quick test_curfew; + Tztest.tztest "the curfew functionality" `Quick test_curfew; Tztest.tztest - "check that a commitment can be published after the inbox_level + \ - challenge window is passed." + "a commitment can be published after the inbox_level + challenge window \ + is passed." `Quick test_curfew_period_is_started_only_after_first_publication; Tztest.tztest @@ -3553,3 +3552,7 @@ let tests = `Quick test_start_game_on_cemented_commitment; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("sc rollup", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_sc_rollup_transfer.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_sc_rollup_transfer.ml index 2c9e888f2063..c9bf05adf368 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_sc_rollup_transfer.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_sc_rollup_transfer.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Sc rollup L1/L2 communication - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ - -- test "^sc rollup transfer$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/operations/main.exe \ + -- --file test_sc_rollup_transfer.ml Subject: Test transfers from Michelson to smart contract rollups *) @@ -428,3 +427,7 @@ let tests = `Quick test_transfer_non_zero_amount_ticket; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("sc rollup transfer", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_transfer.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_transfer.ml index 7e593a27adef..b734e3b1fa43 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_transfer.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_transfer.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Protocol (transfer) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ - -- test "^transfer$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/operations/main.exe \ + -- --file test_transfer.ml Subject: Quantities transfer between contracts. *) @@ -906,3 +905,6 @@ let tests = `Quick test_storage_fees_and_internal_operation; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("transfer", tests)] |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_transfer_ticket.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_transfer_ticket.ml index 0da857bb355f..954248ef96e2 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_transfer_ticket.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_transfer_ticket.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Transfer_ticket logic - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ - -- test "^transfer ticket$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/operations/main.exe \ + -- --file test_transfer_ticket.ml Subject: Test ticket transfers *) @@ -318,11 +317,15 @@ let test_contract_as_ticket_transfer_destination () = let tests = [ Tztest.tztest - "Test ticket transfer operations" + "ticket transfer operations" `Quick test_mint_deposit_withdraw_implicit_transfer; Tztest.tztest - "Test 'contract (ticket cty)' as transfer destination" + "'contract (ticket cty)' as transfer destination" `Quick test_contract_as_ticket_transfer_destination; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("transfer ticket", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_voting.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_voting.ml index 46f377155405..426292840eab 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_voting.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_voting.ml @@ -27,9 +27,8 @@ (** Testing ------- Component: Protocol (voting) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ - -- test "^voting$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/operations/main.exe \ + -- --file test_voting.ml Subject: On the voting process. *) @@ -2098,3 +2097,6 @@ let tests = test_conflicting_ballot; Tztest.tztest "Valid Ballot operations" `Quick test_valid_ballot; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("voting", tests)] |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_zk_rollup.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_zk_rollup.ml index 87c9deb1be18..7d15a2ec15ee 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_zk_rollup.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/operations/test_zk_rollup.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Rollup layer 1 logic - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ - -- test "^zk rollup$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/operations/main.exe \ + -- --file test_zk_rollup.ml Subject: Test zk rollup *) @@ -1280,3 +1279,7 @@ let tests = `Quick test_valid_deposit_and_external_withdrawal; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("zk rollup", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/operations/dune b/src/proto_alpha/lib_protocol/test/integration/operations/dune index 3a1f9cd62dc2..e5271ad452ed 100644 --- a/src/proto_alpha/lib_protocol/test/integration/operations/dune +++ b/src/proto_alpha/lib_protocol/test/integration/operations/dune @@ -27,7 +27,6 @@ -open Tezos_base_test_helpers -open Tezos_protocol_plugin_alpha) (modules - test_main test_activation test_combined_operations test_failing_noop diff --git a/src/proto_alpha/lib_protocol/test/integration/operations/test_activation.ml b/src/proto_alpha/lib_protocol/test/integration/operations/test_activation.ml index 01ee9324b576..126a4030233c 100644 --- a/src/proto_alpha/lib_protocol/test/integration/operations/test_activation.ml +++ b/src/proto_alpha/lib_protocol/test/integration/operations/test_activation.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (activation) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ + -- --file test_activation.ml Subject: The activation operation creates an implicit contract from a registered commitment present in the context. It is parametrized by a public key hash (pkh) and a secret. @@ -571,3 +572,7 @@ let tests = `Quick test_invalid_transfer_from_unactivated_account; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("activation", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/operations/test_combined_operations.ml b/src/proto_alpha/lib_protocol/test/integration/operations/test_combined_operations.ml index 9d6cfab43f1f..3fd3dcb5bea0 100644 --- a/src/proto_alpha/lib_protocol/test/integration/operations/test_combined_operations.ml +++ b/src/proto_alpha/lib_protocol/test/integration/operations/test_combined_operations.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (combined operations) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ + -- --file test_combined_operations.ml Subject: Multiple operations can be grouped in one ensuring their deterministic application. @@ -407,3 +408,6 @@ let tests = `Quick test_inconsistent_counters; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("combined", tests)] |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/operations/test_failing_noop.ml b/src/proto_alpha/lib_protocol/test/integration/operations/test_failing_noop.ml index dc6ee310abac..a005ddc34428 100644 --- a/src/proto_alpha/lib_protocol/test/integration/operations/test_failing_noop.ml +++ b/src/proto_alpha/lib_protocol/test/integration/operations/test_failing_noop.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ + -- --file test_failing_noop.ml Subject: The Failing_noop operation was added bearing in mind the possibility for the end user to sign arbitrary bytes, encapsulate in the operation, with the absolute garanty that @@ -47,3 +48,7 @@ let failing_noop_must_fail_when_injected () = let tests = [Tztest.tztest "injection fails" `Quick failing_noop_must_fail_when_injected] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("failing_noop operation", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/operations/test_main.ml b/src/proto_alpha/lib_protocol/test/integration/operations/test_main.ml deleted file mode 100644 index d63ba82de880..000000000000 --- a/src/proto_alpha/lib_protocol/test/integration/operations/test_main.ml +++ /dev/null @@ -1,52 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2021 Nomadic Labs *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -(** Testing - ------- - Component: Protocol - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe - Subject: Entrypoint -*) - -let () = - Alcotest_lwt.run - ~__FILE__ - "protocol > integration > operations" - [ - (Protocol.name ^ ": voting", Test_voting.tests); - (Protocol.name ^ ": origination", Test_origination.tests); - (Protocol.name ^ ": revelation", Test_reveal.tests); - (Protocol.name ^ ": transfer", Test_transfer.tests); - (Protocol.name ^ ": activation", Test_activation.tests); - ( Protocol.name ^ ": paid storage increase", - Test_paid_storage_increase.tests ); - (Protocol.name ^ ": combined", Test_combined_operations.tests); - (Protocol.name ^ ": failing_noop operation", Test_failing_noop.tests); - (Protocol.name ^ ": sc rollup", Test_sc_rollup.tests); - (Protocol.name ^ ": sc rollup transfer", Test_sc_rollup_transfer.tests); - (Protocol.name ^ ": zk rollup", Test_zk_rollup.tests); - (Protocol.name ^ ": transfer ticket", Test_transfer_ticket.tests); - ] - |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/operations/test_origination.ml b/src/proto_alpha/lib_protocol/test/integration/operations/test_origination.ml index 1d607ccc1dc0..6a74f8becd95 100644 --- a/src/proto_alpha/lib_protocol/test/integration/operations/test_origination.ml +++ b/src/proto_alpha/lib_protocol/test/integration/operations/test_origination.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (origination) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ + -- --file test_origination.ml Subject: On originating contracts. *) @@ -324,3 +325,7 @@ let tests = Tztest.tztest "counter" `Quick test_counter; Tztest.tztest "unparsable script" `Quick test_unparsable_script; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("orgination", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/operations/test_paid_storage_increase.ml b/src/proto_alpha/lib_protocol/test/integration/operations/test_paid_storage_increase.ml index 21a88c835019..275a4fe4e853 100644 --- a/src/proto_alpha/lib_protocol/test/integration/operations/test_paid_storage_increase.ml +++ b/src/proto_alpha/lib_protocol/test/integration/operations/test_paid_storage_increase.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (increase_paid_storage) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ + -- --file test_paid_storage_increase.ml Subject: On increasing a paid amount of contract storage. *) @@ -243,3 +244,7 @@ let tests = Tztest.tztest "no contract to bump its paid storage" `Quick test_no_contract; Tztest.tztest "effectiveness" `Quick test_effectiveness; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("paid storage increase", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/operations/test_reveal.ml b/src/proto_alpha/lib_protocol/test/integration/operations/test_reveal.ml index 0f0ef651226b..9784bf9dff17 100644 --- a/src/proto_alpha/lib_protocol/test/integration/operations/test_reveal.ml +++ b/src/proto_alpha/lib_protocol/test/integration/operations/test_reveal.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (revelation) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ + -- --file test_reveal.ml Subject: On the reveal operation. *) @@ -745,3 +746,7 @@ let tests = `Quick test_valid_reveal_after_emptying_balance; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("revelation", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/operations/test_sc_rollup.ml b/src/proto_alpha/lib_protocol/test/integration/operations/test_sc_rollup.ml index aff5add12b52..5526a5e40487 100644 --- a/src/proto_alpha/lib_protocol/test/integration/operations/test_sc_rollup.ml +++ b/src/proto_alpha/lib_protocol/test/integration/operations/test_sc_rollup.ml @@ -27,7 +27,8 @@ (** Testing ------- Component: Rollup layer 1 logic - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ + -- --file test_sc_rollup.ml Subject: Test smart contract rollup *) @@ -3486,13 +3487,13 @@ let tests = `Quick test_inbox_max_number_of_messages_per_level; Tztest.tztest - "Test that a player can't timeout another player before timeout period \ - and related timeout value." + "a player can't timeout another player before timeout period and related \ + timeout value." `Quick test_timeout; Tztest.tztest - "Test that a player cannot play more than max_number_of_parallel_games \ - games in parallel." + "a player cannot play more than max_number_of_parallel_games games in \ + parallel." `Quick test_number_of_parallel_games_bounded; Tztest.tztest @@ -3516,17 +3517,17 @@ let tests = `Quick test_refute_invalid_reveal; Tztest.tztest - "Test that SOL/Info_per_level/EOL are added in the inbox" + "SOL/Info_per_level/EOL are added in the inbox" `Quick test_automatically_added_internal_messages; Tztest.tztest "0-tick commitments are forbidden" `Quick test_zero_tick_commitment_fails; - Tztest.tztest "check the curfew functionality" `Quick test_curfew; + Tztest.tztest "the curfew functionality" `Quick test_curfew; Tztest.tztest - "check that a commitment can be published after the inbox_level + \ - challenge window is passed." + "a commitment can be published after the inbox_level + challenge window \ + is passed." `Quick test_curfew_period_is_started_only_after_first_publication; Tztest.tztest @@ -3551,3 +3552,7 @@ let tests = `Quick test_start_game_on_cemented_commitment; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("sc rollup", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/operations/test_sc_rollup_transfer.ml b/src/proto_alpha/lib_protocol/test/integration/operations/test_sc_rollup_transfer.ml index 8ffb938a8eba..e4d83f86ea56 100644 --- a/src/proto_alpha/lib_protocol/test/integration/operations/test_sc_rollup_transfer.ml +++ b/src/proto_alpha/lib_protocol/test/integration/operations/test_sc_rollup_transfer.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Sc rollup L1/L2 communication - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ + -- --file test_sc_rollup_transfer.ml Subject: Test transfers from Michelson to smart contract rollups *) @@ -426,3 +427,7 @@ let tests = `Quick test_transfer_non_zero_amount_ticket; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("sc rollup transfer", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/operations/test_transfer.ml b/src/proto_alpha/lib_protocol/test/integration/operations/test_transfer.ml index 7416a7eba0c1..1a163b6ab743 100644 --- a/src/proto_alpha/lib_protocol/test/integration/operations/test_transfer.ml +++ b/src/proto_alpha/lib_protocol/test/integration/operations/test_transfer.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (transfer) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ + -- --file test_transfer.ml Subject: Quantities transfer between contracts. *) @@ -904,3 +905,6 @@ let tests = `Quick test_storage_fees_and_internal_operation; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("transfer", tests)] |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/operations/test_transfer_ticket.ml b/src/proto_alpha/lib_protocol/test/integration/operations/test_transfer_ticket.ml index 2a54374ba67b..eac038572a3e 100644 --- a/src/proto_alpha/lib_protocol/test/integration/operations/test_transfer_ticket.ml +++ b/src/proto_alpha/lib_protocol/test/integration/operations/test_transfer_ticket.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Transfer_ticket logic - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ + -- --file test_transfer_ticket.ml Subject: Test ticket transfers *) @@ -316,11 +317,15 @@ let test_contract_as_ticket_transfer_destination () = let tests = [ Tztest.tztest - "Test ticket transfer operations" + "ticket transfer operations" `Quick test_mint_deposit_withdraw_implicit_transfer; Tztest.tztest - "Test 'contract (ticket cty)' as transfer destination" + "'contract (ticket cty)' as transfer destination" `Quick test_contract_as_ticket_transfer_destination; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("transfer ticket", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/operations/test_voting.ml b/src/proto_alpha/lib_protocol/test/integration/operations/test_voting.ml index b08ae525bc20..91ff5d0be2df 100644 --- a/src/proto_alpha/lib_protocol/test/integration/operations/test_voting.ml +++ b/src/proto_alpha/lib_protocol/test/integration/operations/test_voting.ml @@ -27,7 +27,8 @@ (** Testing ------- Component: Protocol (voting) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ + -- --file test_voting.ml Subject: On the voting process. *) @@ -2096,3 +2097,6 @@ let tests = test_conflicting_ballot; Tztest.tztest "Valid Ballot operations" `Quick test_valid_ballot; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("voting", tests)] |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/operations/test_zk_rollup.ml b/src/proto_alpha/lib_protocol/test/integration/operations/test_zk_rollup.ml index 6d62f1e69de1..3d30baa327f2 100644 --- a/src/proto_alpha/lib_protocol/test/integration/operations/test_zk_rollup.ml +++ b/src/proto_alpha/lib_protocol/test/integration/operations/test_zk_rollup.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Rollup layer 1 logic - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/operations/main.exe \ + -- --file test_zk_rollup.ml Subject: Test zk rollup *) @@ -1278,3 +1279,7 @@ let tests = `Quick test_valid_deposit_and_external_withdrawal; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("zk rollup", tests)] + |> Lwt_main.run -- GitLab From 5e66c9673acbccfa0f5ff92ab01c43df40ca4c90 Mon Sep 17 00:00:00 2001 From: lykimq Date: Fri, 7 Apr 2023 15:24:56 +0200 Subject: [PATCH 5/8] Alcotezt-UX: fix invocation headers, opt. titles for [validate] in all protocols --- manifest/main.ml | 1 - .../test/integration/validate/dune | 1 - .../validate/test_1m_restriction.ml | 7 ++- .../integration/validate/test_covalidity.ml | 7 ++- .../test/integration/validate/test_main.ml | 47 ------------------- .../test_manager_operation_validation.ml | 18 +++++-- .../test/integration/validate/test_mempool.ml | 6 ++- .../test/integration/validate/test_sanity.ml | 7 ++- .../validate/test_validation_batch.ml | 10 +++- .../test/integration/validate/dune | 1 - .../validate/test_1m_restriction.ml | 9 ++-- .../integration/validate/test_covalidity.ml | 9 ++-- .../test/integration/validate/test_main.ml | 47 ------------------- .../test_manager_operation_validation.ml | 20 +++++--- .../test/integration/validate/test_mempool.ml | 8 ++-- .../test/integration/validate/test_sanity.ml | 9 ++-- .../validate/test_validation_batch.ml | 12 +++-- .../test/integration/validate/dune | 1 - .../validate/test_1m_restriction.ml | 7 ++- .../integration/validate/test_covalidity.ml | 7 ++- .../test/integration/validate/test_main.ml | 47 ------------------- .../test_manager_operation_validation.ml | 18 +++++-- .../test/integration/validate/test_mempool.ml | 6 ++- .../test/integration/validate/test_sanity.ml | 7 ++- .../validate/test_validation_batch.ml | 10 +++- 25 files changed, 135 insertions(+), 187 deletions(-) delete mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_main.ml delete mode 100644 src/proto_017_PtNairob/lib_protocol/test/integration/validate/test_main.ml delete mode 100644 src/proto_alpha/lib_protocol/test/integration/validate/test_main.ml diff --git a/manifest/main.ml b/manifest/main.ml index 9fcdfaf5c0b8..385c361a219f 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -4723,7 +4723,6 @@ end = struct only_if N.(number >= 014) @@ fun () -> tezt [ - "test_main"; "generator_descriptors"; "generators"; "manager_operation_helpers"; diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/dune b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/dune index 8c3f81382687..c4da91d164aa 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/dune +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/dune @@ -30,7 +30,6 @@ -open Tezos_base_test_helpers -open Tezos_protocol_plugin_016_PtMumbai) (modules - test_main generator_descriptors generators manager_operation_helpers diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_1m_restriction.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_1m_restriction.ml index 42817533c8b2..83fa785f50cd 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_1m_restriction.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_1m_restriction.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (validate manager) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/validate/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/validate/main.exe \ + -- --file test_1m_restriction.ml Subject: 1M restriction in validation of manager operation. *) @@ -225,3 +226,7 @@ let tests : (string * [`Quick | `Slow] * (unit -> unit Lwt.t)) trace = batch_is_not_singles_tests; conflict_free_tests; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("one-manager restriction", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_covalidity.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_covalidity.ml index 5a67b17588a7..0ae6fda9032f 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_covalidity.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_covalidity.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (validate manager) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/validate/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/validate/main.exe \ + -- --file test_covalidity.ml Subject: Validation of operation. *) open Validate_helpers @@ -153,3 +154,7 @@ let tests = [] voting_periods |> Qcheck2_helpers.qcheck_wrap_lwt + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("covalidity", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_main.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_main.ml deleted file mode 100644 index f4b9908fd886..000000000000 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_main.ml +++ /dev/null @@ -1,47 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2022 Nomadic Labs *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -(** Testing - ------- - Component: Protocol - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/validate/main.exe - Subject: Integration > Validate -*) - -let () = - Alcotest_lwt.run - ~__FILE__ - "protocol > integration > validate" - [ - (Protocol.name ^ ": sanity checks", Test_sanity.tests); - (Protocol.name ^ ": mempool", Test_mempool.tests); - ( Protocol.name ^ ": single manager validation", - Test_manager_operation_validation.tests ); - ( Protocol.name ^ ": batched managers validation", - Test_validation_batch.tests ); - (Protocol.name ^ ": one-manager restriction", Test_1m_restriction.tests); - (Protocol.name ^ ": covalidity", Test_covalidity.tests); - ] - |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_manager_operation_validation.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_manager_operation_validation.ml index cc1e81a8fcfa..1278c0c9df07 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_manager_operation_validation.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_manager_operation_validation.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (validate manager) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/validate/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/validate/main.exe \ + -- --file test_manager_operation_validation.ml Subject: Validation of manager operation. *) @@ -615,8 +616,15 @@ let tests = mk_gas ); ("empty undelegated source", test_empty_undelegate, all, mk_default); ("minimal gas for manager", test_low_gas_limit, gas_consum, mk_default); - ("check dal disabled", test_feature_flags, all, mk_flags disabled_dal); - ("check toru disabled", test_feature_flags, all, mk_flags disabled_toru); - ("check scoru disabled", test_feature_flags, all, mk_flags disabled_scoru); - ("check zkru disabled", test_feature_flags, all, mk_flags disabled_zkru); + ("dal disabled", test_feature_flags, all, mk_flags disabled_dal); + ("toru disabled", test_feature_flags, all, mk_flags disabled_toru); + ("scoru disabled", test_feature_flags, all, mk_flags disabled_scoru); + ("zkru disabled", test_feature_flags, all, mk_flags disabled_zkru); ] + +let () = + Alcotest_lwt.run + ~__FILE__ + Protocol.name + [("single manager validation", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_mempool.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_mempool.ml index bcfc020ddbb7..a7c0b2d57ac6 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_mempool.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_mempool.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/validate/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/validate/main.exe \ + -- --file test_mempool.ml Subject: Integration > Validate > Mempool mode *) @@ -383,3 +384,6 @@ let tests = test_add_and_replace; Tztest.tztest "remove operations" `Quick test_remove_operation; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("mempool", tests)] |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_sanity.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_sanity.ml index 1177a2593858..8a254e097e3c 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_sanity.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_sanity.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (validate manager) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/validate/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/validate/main.exe \ + -- --file test_sanity.ml Subject: Validation of operation. *) @@ -172,3 +173,7 @@ let tests = ("manager operation coverage", ensure_manager_operation_coverage); ("covalidation coverage", covalidation_sanity); ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("sanity checks", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_validation_batch.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_validation_batch.ml index 6d6a10ecb481..74fb43740082 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_validation_batch.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/test_validation_batch.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (validate manager) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/validate/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/validate/main.exe \ + -- --file test_validation_batch.ml Subject: Validation of batched manager operation. *) @@ -620,3 +621,10 @@ let tests = revealed, mk_high_gas_limit ); ] + +let () = + Alcotest_lwt.run + ~__FILE__ + Protocol.name + [("batched managers validation", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/validate/dune b/src/proto_017_PtNairob/lib_protocol/test/integration/validate/dune index 69f7236c7b9a..7583e561a113 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/validate/dune +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/validate/dune @@ -30,7 +30,6 @@ -open Tezos_base_test_helpers -open Tezos_protocol_plugin_017_PtNairob) (modules - test_main generator_descriptors generators manager_operation_helpers diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/validate/test_1m_restriction.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/validate/test_1m_restriction.ml index cd1590d1d39d..96d3bbbd977d 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/validate/test_1m_restriction.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/validate/test_1m_restriction.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Protocol (validate manager) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/validate/main.exe \ - -- test "^one-manager" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/validate/main.exe \ + -- --file test_1m_restriction.ml Subject: 1M restriction in validation of manager operation. *) @@ -226,3 +225,7 @@ let tests : (string * [`Quick | `Slow] * (unit -> unit Lwt.t)) trace = batch_is_not_singles_tests; conflict_free_tests; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("one-manager restriction", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/validate/test_covalidity.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/validate/test_covalidity.ml index 9752975129d3..2cda742b4ee7 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/validate/test_covalidity.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/validate/test_covalidity.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Protocol (validate manager) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/validate/main.exe \ - -- test "^covalidity" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/validate/main.exe \ + -- --file test_covalidity.ml Subject: Validation of operation. *) open Validate_helpers @@ -155,3 +154,7 @@ let tests = [] voting_periods |> Qcheck2_helpers.qcheck_wrap_lwt + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("covalidity", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/validate/test_main.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/validate/test_main.ml deleted file mode 100644 index dcb0d3d1e6b8..000000000000 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/validate/test_main.ml +++ /dev/null @@ -1,47 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2022 Nomadic Labs *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -(** Testing - ------- - Component: Protocol - Invocation: dune runtest src/proto_alpha/lib_protocol/test/integration/validate - Subject: Integration > Validate -*) - -let () = - Alcotest_lwt.run - ~__FILE__ - "protocol > integration > validate" - [ - (Protocol.name ^ ": sanity checks", Test_sanity.tests); - (Protocol.name ^ ": mempool", Test_mempool.tests); - ( Protocol.name ^ ": single manager validation", - Test_manager_operation_validation.tests ); - ( Protocol.name ^ ": batched managers validation", - Test_validation_batch.tests ); - (Protocol.name ^ ": one-manager restriction", Test_1m_restriction.tests); - (Protocol.name ^ ": covalidity", Test_covalidity.tests); - ] - |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/validate/test_manager_operation_validation.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/validate/test_manager_operation_validation.ml index 75af381ae66f..3a35c446bae0 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/validate/test_manager_operation_validation.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/validate/test_manager_operation_validation.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Protocol (validate manager) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/validate/main.exe \ - -- test "^single" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/validate/main.exe \ + -- --file test_manager_operation_validation.ml Subject: Validation of manager operation. *) @@ -613,8 +612,15 @@ let tests = test_low_gas_limit_no_consumer, not_gas_consum, mk_default ); - ("check dal disabled", test_feature_flags, all, mk_flags disabled_dal); - ("check toru disabled", test_feature_flags, all, mk_flags disabled_toru); - ("check scoru disabled", test_feature_flags, all, mk_flags disabled_scoru); - ("check zkru disabled", test_feature_flags, all, mk_flags disabled_zkru); + ("dal disabled", test_feature_flags, all, mk_flags disabled_dal); + ("toru disabled", test_feature_flags, all, mk_flags disabled_toru); + ("scoru disabled", test_feature_flags, all, mk_flags disabled_scoru); + ("zkru disabled", test_feature_flags, all, mk_flags disabled_zkru); ] + +let () = + Alcotest_lwt.run + ~__FILE__ + Protocol.name + [("single manager validation", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/validate/test_mempool.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/validate/test_mempool.ml index b4a3ca83dd5f..180f7cbbc9db 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/validate/test_mempool.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/validate/test_mempool.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Protocol - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/validate/main.exe \ - -- test "^Mempool" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/validate/main.exe \ + -- --file test_mempool.ml Subject: Integration > Validate > Mempool mode *) @@ -391,3 +390,6 @@ let tests = test_add_and_replace; Tztest.tztest "remove operations" `Quick test_remove_operation; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("mempool", tests)] |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/validate/test_sanity.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/validate/test_sanity.ml index e0b900b8c105..356a68c3d4a6 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/validate/test_sanity.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/validate/test_sanity.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Protocol (validate manager) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/validate/main.exe \ - -- test "sanity checks" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/validate/main.exe \ + -- --file test_sanity.ml Subject: Validation of operation. *) @@ -162,3 +161,7 @@ let tests = ("manager operation coverage", ensure_manager_operation_coverage); ("covalidation coverage", covalidation_sanity); ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("sanity checks", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/validate/test_validation_batch.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/validate/test_validation_batch.ml index 6632e3a421b7..c84a8e59f1f9 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/validate/test_validation_batch.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/validate/test_validation_batch.ml @@ -26,9 +26,8 @@ (** Testing ------- Component: Protocol (validate manager) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/validate/main.exe \ - -- test "^batched" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/integration/validate/main.exe \ + -- --file test_validation_batch.ml Subject: Validation of batched manager operation. *) @@ -622,3 +621,10 @@ let tests = revealed, mk_high_gas_limit ); ] + +let () = + Alcotest_lwt.run + ~__FILE__ + Protocol.name + [("batched managers validation", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/validate/dune b/src/proto_alpha/lib_protocol/test/integration/validate/dune index 712841be8ca4..5aa689d327af 100644 --- a/src/proto_alpha/lib_protocol/test/integration/validate/dune +++ b/src/proto_alpha/lib_protocol/test/integration/validate/dune @@ -30,7 +30,6 @@ -open Tezos_base_test_helpers -open Tezos_protocol_plugin_alpha) (modules - test_main generator_descriptors generators manager_operation_helpers diff --git a/src/proto_alpha/lib_protocol/test/integration/validate/test_1m_restriction.ml b/src/proto_alpha/lib_protocol/test/integration/validate/test_1m_restriction.ml index 515316cd07a2..8aeb60837774 100644 --- a/src/proto_alpha/lib_protocol/test/integration/validate/test_1m_restriction.ml +++ b/src/proto_alpha/lib_protocol/test/integration/validate/test_1m_restriction.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (validate manager) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/validate/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/validate/main.exe \ + -- --file test_1m_restriction.ml Subject: 1M restriction in validation of manager operation. *) @@ -224,3 +225,7 @@ let tests : (string * [`Quick | `Slow] * (unit -> unit Lwt.t)) trace = batch_is_not_singles_tests; conflict_free_tests; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("one-manager restriction", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/validate/test_covalidity.ml b/src/proto_alpha/lib_protocol/test/integration/validate/test_covalidity.ml index 26c932e21f80..ba203fe8242d 100644 --- a/src/proto_alpha/lib_protocol/test/integration/validate/test_covalidity.ml +++ b/src/proto_alpha/lib_protocol/test/integration/validate/test_covalidity.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (validate manager) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/validate/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/validate/main.exe \ + -- --file test_covalidity.ml Subject: Validation of operation. *) open Validate_helpers @@ -153,3 +154,7 @@ let tests = [] voting_periods |> Qcheck2_helpers.qcheck_wrap_lwt + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("covalidity", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/validate/test_main.ml b/src/proto_alpha/lib_protocol/test/integration/validate/test_main.ml deleted file mode 100644 index 031eadd44399..000000000000 --- a/src/proto_alpha/lib_protocol/test/integration/validate/test_main.ml +++ /dev/null @@ -1,47 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2022 Nomadic Labs *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -(** Testing - ------- - Component: Protocol - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/validate/main.exe - Subject: Integration > Validate -*) - -let () = - Alcotest_lwt.run - ~__FILE__ - "protocol > integration > validate" - [ - (Protocol.name ^ ": sanity checks", Test_sanity.tests); - (Protocol.name ^ ": mempool", Test_mempool.tests); - ( Protocol.name ^ ": single manager validation", - Test_manager_operation_validation.tests ); - ( Protocol.name ^ ": batched managers validation", - Test_validation_batch.tests ); - (Protocol.name ^ ": one-manager restriction", Test_1m_restriction.tests); - (Protocol.name ^ ": covalidity", Test_covalidity.tests); - ] - |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/validate/test_manager_operation_validation.ml b/src/proto_alpha/lib_protocol/test/integration/validate/test_manager_operation_validation.ml index e31a5d37990e..24022dab4895 100644 --- a/src/proto_alpha/lib_protocol/test/integration/validate/test_manager_operation_validation.ml +++ b/src/proto_alpha/lib_protocol/test/integration/validate/test_manager_operation_validation.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (validate manager) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/validate/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/validate/main.exe \ + -- --file test_manager_operation_validation.ml Subject: Validation of manager operation. *) @@ -611,8 +612,15 @@ let tests = test_low_gas_limit_no_consumer, not_gas_consum, mk_default ); - ("check dal disabled", test_feature_flags, all, mk_flags disabled_dal); - ("check toru disabled", test_feature_flags, all, mk_flags disabled_toru); - ("check scoru disabled", test_feature_flags, all, mk_flags disabled_scoru); - ("check zkru disabled", test_feature_flags, all, mk_flags disabled_zkru); + ("dal disabled", test_feature_flags, all, mk_flags disabled_dal); + ("toru disabled", test_feature_flags, all, mk_flags disabled_toru); + ("scoru disabled", test_feature_flags, all, mk_flags disabled_scoru); + ("zkru disabled", test_feature_flags, all, mk_flags disabled_zkru); ] + +let () = + Alcotest_lwt.run + ~__FILE__ + Protocol.name + [("single manager validation", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/validate/test_mempool.ml b/src/proto_alpha/lib_protocol/test/integration/validate/test_mempool.ml index 0855ef73b268..2349c5e08e70 100644 --- a/src/proto_alpha/lib_protocol/test/integration/validate/test_mempool.ml +++ b/src/proto_alpha/lib_protocol/test/integration/validate/test_mempool.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/validate/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/validate/main.exe \ + -- --file test_mempool.ml Subject: Integration > Validate > Mempool mode *) @@ -389,3 +390,6 @@ let tests = test_add_and_replace; Tztest.tztest "remove operations" `Quick test_remove_operation; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("mempool", tests)] |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/validate/test_sanity.ml b/src/proto_alpha/lib_protocol/test/integration/validate/test_sanity.ml index 39976e0a71c8..3d0aaa65df45 100644 --- a/src/proto_alpha/lib_protocol/test/integration/validate/test_sanity.ml +++ b/src/proto_alpha/lib_protocol/test/integration/validate/test_sanity.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (validate manager) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/validate/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/validate/main.exe \ + -- --file test_sanity.ml Subject: Validation of operation. *) @@ -160,3 +161,7 @@ let tests = ("manager operation coverage", ensure_manager_operation_coverage); ("covalidation coverage", covalidation_sanity); ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("sanity checks", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/validate/test_validation_batch.ml b/src/proto_alpha/lib_protocol/test/integration/validate/test_validation_batch.ml index 75deeef51eb5..0b7445cb07ef 100644 --- a/src/proto_alpha/lib_protocol/test/integration/validate/test_validation_batch.ml +++ b/src/proto_alpha/lib_protocol/test/integration/validate/test_validation_batch.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (validate manager) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/validate/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/validate/main.exe \ + -- --file test_validation_batch.ml Subject: Validation of batched manager operation. *) @@ -620,3 +621,10 @@ let tests = revealed, mk_high_gas_limit ); ] + +let () = + Alcotest_lwt.run + ~__FILE__ + Protocol.name + [("batched managers validation", tests)] + |> Lwt_main.run -- GitLab From ad22b2a0ded49949b20743628455c387841e93e4 Mon Sep 17 00:00:00 2001 From: lykimq Date: Fri, 7 Apr 2023 15:52:01 +0200 Subject: [PATCH 6/8] Alcotezt-UX: fix invocation headers, opt. titles for [integration] in all protocols --- manifest/main.ml | 1 - .../lib_protocol/test/integration/dune | 1 - .../test/integration/test_constants.ml | 7 +- .../test/integration/test_frozen_bonds.ml | 19 ++-- .../test/integration/test_liquidity_baking.ml | 85 +++++++++--------- .../test/integration/test_main.ml | 45 ---------- .../test/integration/test_storage.ml | 7 +- .../integration/test_storage_functions.ml | 7 +- .../test/integration/test_token.ml | 7 +- .../lib_protocol/test/integration/dune | 1 - .../test/integration/test_constants.ml | 11 ++- .../test/integration/test_frozen_bonds.ml | 20 +++-- .../test/integration/test_liquidity_baking.ml | 86 ++++++++++--------- .../test/integration/test_main.ml | 45 ---------- .../test/integration/test_storage.ml | 8 +- .../integration/test_storage_functions.ml | 8 +- .../test/integration/test_token.ml | 8 +- .../lib_protocol/test/integration/dune | 1 - .../test/integration/test_constants.ml | 7 +- .../test/integration/test_frozen_bonds.ml | 19 ++-- .../test/integration/test_liquidity_baking.ml | 85 +++++++++--------- .../test/integration/test_main.ml | 45 ---------- .../test/integration/test_storage.ml | 7 +- .../integration/test_storage_functions.ml | 7 +- .../test/integration/test_token.ml | 7 +- 25 files changed, 244 insertions(+), 300 deletions(-) delete mode 100644 src/proto_016_PtMumbai/lib_protocol/test/integration/test_main.ml delete mode 100644 src/proto_017_PtNairob/lib_protocol/test/integration/test_main.ml delete mode 100644 src/proto_alpha/lib_protocol/test/integration/test_main.ml diff --git a/manifest/main.ml b/manifest/main.ml index 385c361a219f..d1a6ce6b716f 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -4755,7 +4755,6 @@ end = struct let _integration = let modules = [ - ("test_main", true); ("test_constants", true); ("test_frozen_bonds", true); ("test_liquidity_baking", true); diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/dune b/src/proto_016_PtMumbai/lib_protocol/test/integration/dune index e5965e61a9f6..182c5ac90be7 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/dune +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/dune @@ -29,7 +29,6 @@ -open Tezos_016_PtMumbai_test_helpers -open Tezos_base_test_helpers) (modules - test_main test_constants test_frozen_bonds test_liquidity_baking diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/test_constants.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/test_constants.ml index 907efa6ed56b..2416594a63a2 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/test_constants.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/test_constants.ml @@ -27,7 +27,8 @@ (** Testing ------- Component: Protocol (baking) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe \ + -- --file test_constants.ml Subject: the consistency of parametric constants *) @@ -213,3 +214,7 @@ let tests = `Quick liquidity_baking_subsidy_param; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("constants", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/test_frozen_bonds.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/test_frozen_bonds.ml index 08ed2f8b6f32..3262512af586 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/test_frozen_bonds.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/test_frozen_bonds.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (token) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe \ + -- --file test_frozen_bonds.ml Subject: Frozen bonds applicable to contracts and part of their stake. *) @@ -671,27 +672,31 @@ let tests = tztest "frozen bonds - delegated balance" `Quick test_delegated_balance; tztest "frozen bonds - test rpcs" `Quick test_rpcs; tztest - "test: delegate, freeze, unfreeze, undelegate" + "delegate, freeze, unfreeze, undelegate" `Quick test_delegate_freeze_unfreeze_undelegate; tztest - "test: delegate, freeze, undelegate, unfreeze" + "delegate, freeze, undelegate, unfreeze" `Quick test_delegate_freeze_undelegate_unfreeze; tztest - "test: delegate, double freeze, undelegate, unfreeze" + "delegate, double freeze, undelegate, unfreeze" `Quick test_delegate_double_freeze_undelegate_unfreeze; tztest - "test: delegate, freeze, redelegate, unfreeze" + "delegate, freeze, redelegate, unfreeze" `Quick test_delegate_freeze_redelegate_unfreeze; tztest - "test: delegate, freeze, unfreeze, freeze, redelegate" + "delegate, freeze, unfreeze, freeze, redelegate" `Quick test_delegate_freeze_unfreeze_freeze_redelegate; tztest - "test: delegate, freeze, slash, undelegate" + "delegate, freeze, slash, undelegate" `Quick test_delegate_freeze_slash_undelegate; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("frozen bonds", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/test_liquidity_baking.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/test_liquidity_baking.ml index 19cdffd74406..7c887470dd22 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/test_liquidity_baking.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/test_liquidity_baking.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: liquidity baking - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe \ + -- --file test_liquidity_baking.ml Subject: Test liquidity baking subsidies, CPMM storage updates, and toggle vote. *) @@ -428,116 +429,120 @@ let liquidity_baking_origination_no_tzBTC_mainnet_migration () = let tests = [ Tztest.tztest - "test liquidity baking script hashes" + "liquidity baking script hashes" `Quick liquidity_baking_origination; Tztest.tztest - "test liquidity baking cpmm is originated at the expected address" + "liquidity baking cpmm is originated at the expected address" `Quick liquidity_baking_cpmm_address; Tztest.tztest "Init Context" `Quick generate_init_state; Tztest.tztest - "test liquidity baking subsidy is correct" + "liquidity baking subsidy is correct" `Quick (liquidity_baking_subsidies 64); Tztest.tztest - "test liquidity baking toggle vote with 100% of bakers voting LB_off \ - baking one block longer" + "liquidity baking toggle vote with 100% of bakers voting LB_off baking \ + one block longer" `Quick (liquidity_baking_toggle_100 1); Tztest.tztest - "test liquidity baking toggle vote with 100% of bakers voting LB_off \ - baking two blocks longer" + "liquidity baking toggle vote with 100% of bakers voting LB_off baking \ + two blocks longer" `Quick (liquidity_baking_toggle_100 2); Tztest.tztest - "test liquidity baking toggle vote with 100% of bakers voting LB_off \ - baking 100 blocks longer" + "liquidity baking toggle vote with 100% of bakers voting LB_off baking \ + 100 blocks longer" `Quick (liquidity_baking_toggle_100 100); Tztest.tztest - "test liquidity baking toggle vote with 80% of bakers voting LB_off \ - baking one block longer" + "liquidity baking toggle vote with 80% of bakers voting LB_off baking \ + one block longer" `Quick (liquidity_baking_toggle_80 1); Tztest.tztest - "test liquidity baking toggle vote with 80% of bakers voting LB_off \ - baking two blocks longer" + "liquidity baking toggle vote with 80% of bakers voting LB_off baking \ + two blocks longer" `Quick (liquidity_baking_toggle_80 2); Tztest.tztest - "test liquidity baking toggle vote with 80% of bakers voting LB_off \ - baking 100 blocks longer" + "liquidity baking toggle vote with 80% of bakers voting LB_off baking \ + 100 blocks longer" `Quick (liquidity_baking_toggle_80 100); Tztest.tztest - "test liquidity baking toggle vote with 60% of bakers voting LB_off \ - baking one block longer" + "liquidity baking toggle vote with 60% of bakers voting LB_off baking \ + one block longer" `Quick (liquidity_baking_toggle_60 1); Tztest.tztest - "test liquidity baking toggle vote with 60% of bakers voting LB_off \ - baking two blocks longer" + "liquidity baking toggle vote with 60% of bakers voting LB_off baking \ + two blocks longer" `Quick (liquidity_baking_toggle_60 2); Tztest.tztest - "test liquidity baking toggle vote with 60% of bakers voting LB_off \ - baking 100 blocks longer" + "liquidity baking toggle vote with 60% of bakers voting LB_off baking \ + 100 blocks longer" `Quick (liquidity_baking_toggle_60 100); Tztest.tztest - "test liquidity baking does not shut off with toggle vote at 50% and \ - baking 100 blocks longer than sunset level in previous protocols" + "liquidity baking does not shut off with toggle vote at 50% and baking \ + 100 blocks longer than sunset level in previous protocols" `Quick liquidity_baking_toggle_50; Tztest.tztest - "test a liquidity baking restart with 100% of bakers voting off, then \ - pass, then on" + "liquidity baking restart with 100% of bakers voting off, then pass, \ + then on" `Quick (liquidity_baking_restart 2000 1); Tztest.tztest - "test liquidity baking toggle ema in block metadata is zero with no \ - bakers voting LB_off." + "liquidity baking toggle ema in block metadata is zero with no bakers \ + voting LB_off." `Quick liquidity_baking_toggle_ema_zero; Tztest.tztest - "test liquidity baking toggle ema is equal to the threshold after the \ - subsidy has been stopped by a toggle vote" + "liquidity baking toggle ema is equal to the threshold after the subsidy \ + has been stopped by a toggle vote" `Quick liquidity_baking_toggle_ema_threshold; Tztest.tztest - "test liquidity baking storage is updated" + "liquidity baking storage is updated" `Quick (liquidity_baking_storage 64); Tztest.tztest - "test liquidity baking balance updates" + "liquidity baking balance updates" `Quick liquidity_baking_balance_update; Tztest.tztest - "test liquidity baking CPMM address in storage matches address in the \ + "liquidity baking CPMM address in storage matches address in the \ origination result" `Quick liquidity_baking_origination_result_cpmm_address; Tztest.tztest - "test liquidity baking CPMM balance in origination result is 100 mutez" + "liquidity baking CPMM balance in origination result is 100 mutez" `Quick liquidity_baking_origination_result_cpmm_balance; Tztest.tztest - "test liquidity baking LQT contract is originated at expected address" + "liquidity baking LQT contract is originated at expected address" `Quick liquidity_baking_origination_result_lqt_address; Tztest.tztest - "test liquidity baking LQT balance in origination result is 0 mutez" + "liquidity baking LQT balance in origination result is 0 mutez" `Quick liquidity_baking_origination_result_lqt_balance; Tztest.tztest - "test liquidity baking originates three contracts when tzBTC does not \ - exist and level indicates we are not on mainnet" + "liquidity baking originates three contracts when tzBTC does not exist \ + and level indicates we are not on mainnet" `Quick liquidity_baking_origination_test_migration; Tztest.tztest - "test liquidity baking originates three contracts when tzBTC does not \ - exist and level indicates we might be on mainnet" + "liquidity baking originates three contracts when tzBTC does not exist \ + and level indicates we might be on mainnet" `Quick liquidity_baking_origination_no_tzBTC_mainnet_migration; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("liquidity baking", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/test_main.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/test_main.ml deleted file mode 100644 index 534f0e4dba95..000000000000 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/test_main.ml +++ /dev/null @@ -1,45 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2021 Nomadic Labs *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -(** Testing - ------- - Component: Protocol - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe - Subject: Entrypoint -*) - -let () = - Alcotest_lwt.run - ~__FILE__ - "protocol > integration" - [ - (Protocol.name ^ ": constants", Test_constants.tests); - (Protocol.name ^ ": liquidity baking", Test_liquidity_baking.tests); - (Protocol.name ^ ": storage description", Test_storage.tests); - (Protocol.name ^ ": storage tests", Test_storage_functions.tests); - (Protocol.name ^ ": token movements", Test_token.tests); - (Protocol.name ^ ": frozen bonds", Test_frozen_bonds.tests); - ] - |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/test_storage.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/test_storage.ml index ad1873f559da..5ba607a46c13 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/test_storage.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/test_storage.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Context Storage - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe \ + -- --file test_storage.ml Subject: Test the correctnesss of debug message from storage_functor *) @@ -235,3 +236,7 @@ let tests = `Quick (fun _ -> test_register_indexed_subcontext_2); ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("storage description", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/test_storage_functions.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/test_storage_functions.ml index 899c7b540e5c..9a0778c6a6ad 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/test_storage_functions.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/test_storage_functions.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Context Storage - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe \ + -- --file test_storage_functions.ml Subject: Test storage functions. *) @@ -175,3 +176,7 @@ let tests = test_fold_keys_unaccounted; Tztest.tztest "length test" `Quick test_length; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("storage tests", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/test_token.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/test_token.ml index c2c1ea7d119e..0baf9ed407fd 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/test_token.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/test_token.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (token) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/integration/main.exe \ + -- --file test_token.ml Subject: Token movements in the protocol. *) @@ -752,3 +753,7 @@ let tests = `Quick test_transfer_n_with_non_empty_source; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("token movements", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/dune b/src/proto_017_PtNairob/lib_protocol/test/integration/dune index b28585b764f8..b693985a9757 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/dune +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/dune @@ -29,7 +29,6 @@ -open Tezos_017_PtNairob_test_helpers -open Tezos_base_test_helpers) (modules - test_main test_constants test_frozen_bonds test_liquidity_baking diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/test_constants.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/test_constants.ml index 02169955d6e6..0a2a2e4e0b9b 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/test_constants.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/test_constants.ml @@ -28,8 +28,8 @@ ------- Component: Protocol (baking) Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/main.exe \ - -- test "^constants$" + src/proto_017_PtNairob/lib_protocol/test/integration/main.exe \ + -- --file test_constants.ml Subject: the consistency of parametric constants *) @@ -210,8 +210,11 @@ let tests = `Quick test_sc_rollup_max_commitment_storage_size; Tztest.tztest - "test liquidity_baking_subsidy parameter is 1/16th of total baking \ - rewards" + "liquidity_baking_subsidy parameter is 1/16th of total baking rewards" `Quick liquidity_baking_subsidy_param; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("constants", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/test_frozen_bonds.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/test_frozen_bonds.ml index e094d2e082a6..bd07edfd342e 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/test_frozen_bonds.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/test_frozen_bonds.ml @@ -27,8 +27,8 @@ ------- Component: Protocol (token) Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/main.exe \ - -- test "^frozen bonds" + src/proto_017_PtNairob/lib_protocol/test/integration/main.exe \ + -- --file test_frozen_bonds.ml Subject: Frozen bonds applicable to contracts and part of their stake. *) @@ -673,27 +673,31 @@ let tests = tztest "frozen bonds - delegated balance" `Quick test_delegated_balance; tztest "frozen bonds - test rpcs" `Quick test_rpcs; tztest - "test: delegate, freeze, unfreeze, undelegate" + "delegate, freeze, unfreeze, undelegate" `Quick test_delegate_freeze_unfreeze_undelegate; tztest - "test: delegate, freeze, undelegate, unfreeze" + "delegate, freeze, undelegate, unfreeze" `Quick test_delegate_freeze_undelegate_unfreeze; tztest - "test: delegate, double freeze, undelegate, unfreeze" + "delegate, double freeze, undelegate, unfreeze" `Quick test_delegate_double_freeze_undelegate_unfreeze; tztest - "test: delegate, freeze, redelegate, unfreeze" + "delegate, freeze, redelegate, unfreeze" `Quick test_delegate_freeze_redelegate_unfreeze; tztest - "test: delegate, freeze, unfreeze, freeze, redelegate" + "delegate, freeze, unfreeze, freeze, redelegate" `Quick test_delegate_freeze_unfreeze_freeze_redelegate; tztest - "test: delegate, freeze, slash, undelegate" + "delegate, freeze, slash, undelegate" `Quick test_delegate_freeze_slash_undelegate; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("frozen bonds", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/test_liquidity_baking.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/test_liquidity_baking.ml index 44a37f8fdc50..8775217e279b 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/test_liquidity_baking.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/test_liquidity_baking.ml @@ -27,8 +27,8 @@ ------- Component: liquidity baking Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/main.exe \ - -- test "^liquidity baking$" + src/proto_017_PtNairob/lib_protocol/test/integration/main.exe \ + -- --file test_liquidity_baking.ml Subject: Test liquidity baking subsidies, CPMM storage updates, and toggle vote. *) @@ -430,116 +430,120 @@ let liquidity_baking_origination_no_tzBTC_mainnet_migration () = let tests = [ Tztest.tztest - "test liquidity baking script hashes" + "liquidity baking script hashes" `Quick liquidity_baking_origination; Tztest.tztest - "test liquidity baking cpmm is originated at the expected address" + "liquidity baking cpmm is originated at the expected address" `Quick liquidity_baking_cpmm_address; Tztest.tztest "Init Context" `Quick generate_init_state; Tztest.tztest - "test liquidity baking subsidy is correct" + "liquidity baking subsidy is correct" `Quick (liquidity_baking_subsidies 64); Tztest.tztest - "test liquidity baking toggle vote with 100% of bakers voting LB_off \ - baking one block longer" + "liquidity baking toggle vote with 100% of bakers voting LB_off baking \ + one block longer" `Quick (liquidity_baking_toggle_100 1); Tztest.tztest - "test liquidity baking toggle vote with 100% of bakers voting LB_off \ - baking two blocks longer" + "liquidity baking toggle vote with 100% of bakers voting LB_off baking \ + two blocks longer" `Quick (liquidity_baking_toggle_100 2); Tztest.tztest - "test liquidity baking toggle vote with 100% of bakers voting LB_off \ - baking 100 blocks longer" + "liquidity baking toggle vote with 100% of bakers voting LB_off baking \ + 100 blocks longer" `Quick (liquidity_baking_toggle_100 100); Tztest.tztest - "test liquidity baking toggle vote with 80% of bakers voting LB_off \ - baking one block longer" + "liquidity baking toggle vote with 80% of bakers voting LB_off baking \ + one block longer" `Quick (liquidity_baking_toggle_80 1); Tztest.tztest - "test liquidity baking toggle vote with 80% of bakers voting LB_off \ - baking two blocks longer" + "liquidity baking toggle vote with 80% of bakers voting LB_off baking \ + two blocks longer" `Quick (liquidity_baking_toggle_80 2); Tztest.tztest - "test liquidity baking toggle vote with 80% of bakers voting LB_off \ - baking 100 blocks longer" + "liquidity baking toggle vote with 80% of bakers voting LB_off baking \ + 100 blocks longer" `Quick (liquidity_baking_toggle_80 100); Tztest.tztest - "test liquidity baking toggle vote with 60% of bakers voting LB_off \ - baking one block longer" + "liquidity baking toggle vote with 60% of bakers voting LB_off baking \ + one block longer" `Quick (liquidity_baking_toggle_60 1); Tztest.tztest - "test liquidity baking toggle vote with 60% of bakers voting LB_off \ - baking two blocks longer" + "liquidity baking toggle vote with 60% of bakers voting LB_off baking \ + two blocks longer" `Quick (liquidity_baking_toggle_60 2); Tztest.tztest - "test liquidity baking toggle vote with 60% of bakers voting LB_off \ - baking 100 blocks longer" + "liquidity baking toggle vote with 60% of bakers voting LB_off baking \ + 100 blocks longer" `Quick (liquidity_baking_toggle_60 100); Tztest.tztest - "test liquidity baking does not shut off with toggle vote at 50% and \ - baking 100 blocks longer than sunset level in previous protocols" + "liquidity baking does not shut off with toggle vote at 50% and baking \ + 100 blocks longer than sunset level in previous protocols" `Quick liquidity_baking_toggle_50; Tztest.tztest - "test a liquidity baking restart with 100% of bakers voting off, then \ - pass, then on" + "liquidity baking restart with 100% of bakers voting off, then pass, \ + then on" `Quick (liquidity_baking_restart 2000 1); Tztest.tztest - "test liquidity baking toggle ema in block metadata is zero with no \ - bakers voting LB_off." + "liquidity baking toggle ema in block metadata is zero with no bakers \ + voting LB_off." `Quick liquidity_baking_toggle_ema_zero; Tztest.tztest - "test liquidity baking toggle ema is equal to the threshold after the \ - subsidy has been stopped by a toggle vote" + "liquidity baking toggle ema is equal to the threshold after the subsidy \ + has been stopped by a toggle vote" `Quick liquidity_baking_toggle_ema_threshold; Tztest.tztest - "test liquidity baking storage is updated" + "liquidity baking storage is updated" `Quick (liquidity_baking_storage 64); Tztest.tztest - "test liquidity baking balance updates" + "liquidity baking balance updates" `Quick liquidity_baking_balance_update; Tztest.tztest - "test liquidity baking CPMM address in storage matches address in the \ + "liquidity baking CPMM address in storage matches address in the \ origination result" `Quick liquidity_baking_origination_result_cpmm_address; Tztest.tztest - "test liquidity baking CPMM balance in origination result is 100 mutez" + "liquidity baking CPMM balance in origination result is 100 mutez" `Quick liquidity_baking_origination_result_cpmm_balance; Tztest.tztest - "test liquidity baking LQT contract is originated at expected address" + "liquidity baking LQT contract is originated at expected address" `Quick liquidity_baking_origination_result_lqt_address; Tztest.tztest - "test liquidity baking LQT balance in origination result is 0 mutez" + "liquidity baking LQT balance in origination result is 0 mutez" `Quick liquidity_baking_origination_result_lqt_balance; Tztest.tztest - "test liquidity baking originates three contracts when tzBTC does not \ - exist and level indicates we are not on mainnet" + "liquidity baking originates three contracts when tzBTC does not exist \ + and level indicates we are not on mainnet" `Quick liquidity_baking_origination_test_migration; Tztest.tztest - "test liquidity baking originates three contracts when tzBTC does not \ - exist and level indicates we might be on mainnet" + "liquidity baking originates three contracts when tzBTC does not exist \ + and level indicates we might be on mainnet" `Quick liquidity_baking_origination_no_tzBTC_mainnet_migration; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("liquidity baking", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/test_main.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/test_main.ml deleted file mode 100644 index 6472da6e3c0a..000000000000 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/test_main.ml +++ /dev/null @@ -1,45 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2021 Nomadic Labs *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -(** Testing - ------- - Component: Protocol - Invocation: dune build @@src/proto_alpha/lib_protocol/test/integration/runtest - Subject: Entrypoint -*) - -let () = - Alcotest_lwt.run - ~__FILE__ - "protocol > integration" - [ - (Protocol.name ^ ": constants", Test_constants.tests); - (Protocol.name ^ ": liquidity baking", Test_liquidity_baking.tests); - (Protocol.name ^ ": storage description", Test_storage.tests); - (Protocol.name ^ ": storage tests", Test_storage_functions.tests); - (Protocol.name ^ ": token movements", Test_token.tests); - (Protocol.name ^ ": frozen bonds", Test_frozen_bonds.tests); - ] - |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/test_storage.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/test_storage.ml index 03485707c3ef..ff25e3fb8678 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/test_storage.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/test_storage.ml @@ -27,8 +27,8 @@ ------- Component: Context Storage Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/main.exe \ - -- test storage + src/proto_017_PtNairob/lib_protocol/test/integration/main.exe \ + -- --file test_storage.ml Subject: Test the correctnesss of debug message from storage_functor *) @@ -237,3 +237,7 @@ let tests = `Quick (fun _ -> test_register_indexed_subcontext_2); ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("storage description", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/test_storage_functions.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/test_storage_functions.ml index ddec42a5ded7..a6cebdc4f725 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/test_storage_functions.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/test_storage_functions.ml @@ -27,8 +27,8 @@ ------- Component: Context Storage Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/main.exe \ - -- test "storage tests" + src/proto_017_PtNairob/lib_protocol/test/integration/main.exe \ + -- --file test_storage_functions.ml Subject: Test storage functions. *) @@ -175,3 +175,7 @@ let tests = test_fold_keys_unaccounted; Tztest.tztest "length test" `Quick test_length; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("storage tests", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/test_token.ml b/src/proto_017_PtNairob/lib_protocol/test/integration/test_token.ml index edf122f6c957..cb84b16f0ca4 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/test_token.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/test_token.ml @@ -27,8 +27,8 @@ ------- Component: Protocol (token) Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/integration/main.exe \ - -- test "^token" + src/proto_017_PtNairob/lib_protocol/test/integration/main.exe \ + -- --file test_token.ml Subject: Token movements in the protocol. *) @@ -777,3 +777,7 @@ let tests = `Quick test_transfer_n_with_several_givers; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("token movements", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/dune b/src/proto_alpha/lib_protocol/test/integration/dune index 0954df49cb7a..ce2cc809c2d4 100644 --- a/src/proto_alpha/lib_protocol/test/integration/dune +++ b/src/proto_alpha/lib_protocol/test/integration/dune @@ -29,7 +29,6 @@ -open Tezos_alpha_test_helpers -open Tezos_base_test_helpers) (modules - test_main test_constants test_frozen_bonds test_liquidity_baking diff --git a/src/proto_alpha/lib_protocol/test/integration/test_constants.ml b/src/proto_alpha/lib_protocol/test/integration/test_constants.ml index 21e3c8cd7eda..994de8af62df 100644 --- a/src/proto_alpha/lib_protocol/test/integration/test_constants.ml +++ b/src/proto_alpha/lib_protocol/test/integration/test_constants.ml @@ -27,7 +27,8 @@ (** Testing ------- Component: Protocol (baking) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe \ + -- --file test_constants.ml Subject: the consistency of parametric constants *) @@ -213,3 +214,7 @@ let tests = `Quick liquidity_baking_subsidy_param; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("test constants", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/test_frozen_bonds.ml b/src/proto_alpha/lib_protocol/test/integration/test_frozen_bonds.ml index 2cfe0d139588..8aeeee5514e0 100644 --- a/src/proto_alpha/lib_protocol/test/integration/test_frozen_bonds.ml +++ b/src/proto_alpha/lib_protocol/test/integration/test_frozen_bonds.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (token) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe \ + -- --file test_frozen_bonds.ml Subject: Frozen bonds applicable to contracts and part of their stake. *) @@ -671,27 +672,31 @@ let tests = tztest "frozen bonds - delegated balance" `Quick test_delegated_balance; tztest "frozen bonds - test rpcs" `Quick test_rpcs; tztest - "test: delegate, freeze, unfreeze, undelegate" + "delegate, freeze, unfreeze, undelegate" `Quick test_delegate_freeze_unfreeze_undelegate; tztest - "test: delegate, freeze, undelegate, unfreeze" + "delegate, freeze, undelegate, unfreeze" `Quick test_delegate_freeze_undelegate_unfreeze; tztest - "test: delegate, double freeze, undelegate, unfreeze" + "delegate, double freeze, undelegate, unfreeze" `Quick test_delegate_double_freeze_undelegate_unfreeze; tztest - "test: delegate, freeze, redelegate, unfreeze" + "delegate, freeze, redelegate, unfreeze" `Quick test_delegate_freeze_redelegate_unfreeze; tztest - "test: delegate, freeze, unfreeze, freeze, redelegate" + "delegate, freeze, unfreeze, freeze, redelegate" `Quick test_delegate_freeze_unfreeze_freeze_redelegate; tztest - "test: delegate, freeze, slash, undelegate" + "delegate, freeze, slash, undelegate" `Quick test_delegate_freeze_slash_undelegate; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("frozen bonds", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/test_liquidity_baking.ml b/src/proto_alpha/lib_protocol/test/integration/test_liquidity_baking.ml index 54b1dcf54351..248429335df3 100644 --- a/src/proto_alpha/lib_protocol/test/integration/test_liquidity_baking.ml +++ b/src/proto_alpha/lib_protocol/test/integration/test_liquidity_baking.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: liquidity baking - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe \ + -- --file test_liquidity_baking.ml Subject: Test liquidity baking subsidies, CPMM storage updates, and toggle vote. *) @@ -428,116 +429,120 @@ let liquidity_baking_origination_no_tzBTC_mainnet_migration () = let tests = [ Tztest.tztest - "test liquidity baking script hashes" + "liquidity baking script hashes" `Quick liquidity_baking_origination; Tztest.tztest - "test liquidity baking cpmm is originated at the expected address" + "liquidity baking cpmm is originated at the expected address" `Quick liquidity_baking_cpmm_address; Tztest.tztest "Init Context" `Quick generate_init_state; Tztest.tztest - "test liquidity baking subsidy is correct" + "liquidity baking subsidy is correct" `Quick (liquidity_baking_subsidies 64); Tztest.tztest - "test liquidity baking toggle vote with 100% of bakers voting LB_off \ - baking one block longer" + "liquidity baking toggle vote with 100% of bakers voting LB_off baking \ + one block longer" `Quick (liquidity_baking_toggle_100 1); Tztest.tztest - "test liquidity baking toggle vote with 100% of bakers voting LB_off \ - baking two blocks longer" + "liquidity baking toggle vote with 100% of bakers voting LB_off baking \ + two blocks longer" `Quick (liquidity_baking_toggle_100 2); Tztest.tztest - "test liquidity baking toggle vote with 100% of bakers voting LB_off \ - baking 100 blocks longer" + "liquidity baking toggle vote with 100% of bakers voting LB_off baking \ + 100 blocks longer" `Quick (liquidity_baking_toggle_100 100); Tztest.tztest - "test liquidity baking toggle vote with 80% of bakers voting LB_off \ - baking one block longer" + "liquidity baking toggle vote with 80% of bakers voting LB_off baking \ + one block longer" `Quick (liquidity_baking_toggle_80 1); Tztest.tztest - "test liquidity baking toggle vote with 80% of bakers voting LB_off \ - baking two blocks longer" + "liquidity baking toggle vote with 80% of bakers voting LB_off baking \ + two blocks longer" `Quick (liquidity_baking_toggle_80 2); Tztest.tztest - "test liquidity baking toggle vote with 80% of bakers voting LB_off \ - baking 100 blocks longer" + "liquidity baking toggle vote with 80% of bakers voting LB_off baking \ + 100 blocks longer" `Quick (liquidity_baking_toggle_80 100); Tztest.tztest - "test liquidity baking toggle vote with 60% of bakers voting LB_off \ - baking one block longer" + "liquidity baking toggle vote with 60% of bakers voting LB_off baking \ + one block longer" `Quick (liquidity_baking_toggle_60 1); Tztest.tztest - "test liquidity baking toggle vote with 60% of bakers voting LB_off \ - baking two blocks longer" + "liquidity baking toggle vote with 60% of bakers voting LB_off baking \ + two blocks longer" `Quick (liquidity_baking_toggle_60 2); Tztest.tztest - "test liquidity baking toggle vote with 60% of bakers voting LB_off \ - baking 100 blocks longer" + "liquidity baking toggle vote with 60% of bakers voting LB_off baking \ + 100 blocks longer" `Quick (liquidity_baking_toggle_60 100); Tztest.tztest - "test liquidity baking does not shut off with toggle vote at 50% and \ - baking 100 blocks longer than sunset level in previous protocols" + "liquidity baking does not shut off with toggle vote at 50% and baking \ + 100 blocks longer than sunset level in previous protocols" `Quick liquidity_baking_toggle_50; Tztest.tztest - "test a liquidity baking restart with 100% of bakers voting off, then \ - pass, then on" + "liquidity baking restart with 100% of bakers voting off, then pass, \ + then on" `Quick (liquidity_baking_restart 2000 1); Tztest.tztest - "test liquidity baking toggle ema in block metadata is zero with no \ - bakers voting LB_off." + "liquidity baking toggle ema in block metadata is zero with no bakers \ + voting LB_off." `Quick liquidity_baking_toggle_ema_zero; Tztest.tztest - "test liquidity baking toggle ema is equal to the threshold after the \ - subsidy has been stopped by a toggle vote" + "liquidity baking toggle ema is equal to the threshold after the subsidy \ + has been stopped by a toggle vote" `Quick liquidity_baking_toggle_ema_threshold; Tztest.tztest - "test liquidity baking storage is updated" + "liquidity baking storage is updated" `Quick (liquidity_baking_storage 64); Tztest.tztest - "test liquidity baking balance updates" + "liquidity baking balance updates" `Quick liquidity_baking_balance_update; Tztest.tztest - "test liquidity baking CPMM address in storage matches address in the \ + "liquidity baking CPMM address in storage matches address in the \ origination result" `Quick liquidity_baking_origination_result_cpmm_address; Tztest.tztest - "test liquidity baking CPMM balance in origination result is 100 mutez" + "liquidity baking CPMM balance in origination result is 100 mutez" `Quick liquidity_baking_origination_result_cpmm_balance; Tztest.tztest - "test liquidity baking LQT contract is originated at expected address" + "liquidity baking LQT contract is originated at expected address" `Quick liquidity_baking_origination_result_lqt_address; Tztest.tztest - "test liquidity baking LQT balance in origination result is 0 mutez" + "liquidity baking LQT balance in origination result is 0 mutez" `Quick liquidity_baking_origination_result_lqt_balance; Tztest.tztest - "test liquidity baking originates three contracts when tzBTC does not \ - exist and level indicates we are not on mainnet" + "liquidity baking originates three contracts when tzBTC does not exist \ + and level indicates we are not on mainnet" `Quick liquidity_baking_origination_test_migration; Tztest.tztest - "test liquidity baking originates three contracts when tzBTC does not \ - exist and level indicates we might be on mainnet" + "liquidity baking originates three contracts when tzBTC does not exist \ + and level indicates we might be on mainnet" `Quick liquidity_baking_origination_no_tzBTC_mainnet_migration; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("liquidity baking", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/test_main.ml b/src/proto_alpha/lib_protocol/test/integration/test_main.ml deleted file mode 100644 index 9cd546cafea9..000000000000 --- a/src/proto_alpha/lib_protocol/test/integration/test_main.ml +++ /dev/null @@ -1,45 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2021 Nomadic Labs *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -(** Testing - ------- - Component: Protocol - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe - Subject: Entrypoint -*) - -let () = - Alcotest_lwt.run - ~__FILE__ - "protocol > integration" - [ - (Protocol.name ^ ": constants", Test_constants.tests); - (Protocol.name ^ ": liquidity baking", Test_liquidity_baking.tests); - (Protocol.name ^ ": storage description", Test_storage.tests); - (Protocol.name ^ ": storage tests", Test_storage_functions.tests); - (Protocol.name ^ ": token movements", Test_token.tests); - (Protocol.name ^ ": frozen bonds", Test_frozen_bonds.tests); - ] - |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/test_storage.ml b/src/proto_alpha/lib_protocol/test/integration/test_storage.ml index 860edc3e562f..1918110dc65a 100644 --- a/src/proto_alpha/lib_protocol/test/integration/test_storage.ml +++ b/src/proto_alpha/lib_protocol/test/integration/test_storage.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Context Storage - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe \ + -- --file test_storage.ml Subject: Test the correctnesss of debug message from storage_functor *) @@ -235,3 +236,7 @@ let tests = `Quick (fun _ -> test_register_indexed_subcontext_2); ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("storage description", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/test_storage_functions.ml b/src/proto_alpha/lib_protocol/test/integration/test_storage_functions.ml index b73c99786913..28376c10fc71 100644 --- a/src/proto_alpha/lib_protocol/test/integration/test_storage_functions.ml +++ b/src/proto_alpha/lib_protocol/test/integration/test_storage_functions.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Context Storage - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe \ + -- --file test_storage_functions.ml Subject: Test storage functions. *) @@ -173,3 +174,7 @@ let tests = test_fold_keys_unaccounted; Tztest.tztest "length test" `Quick test_length; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("storage tests", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/test_token.ml b/src/proto_alpha/lib_protocol/test/integration/test_token.ml index 7b6f80f9fd87..e76293abe326 100644 --- a/src/proto_alpha/lib_protocol/test/integration/test_token.ml +++ b/src/proto_alpha/lib_protocol/test/integration/test_token.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (token) - Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/integration/main.exe \ + -- --file test_token.ml Subject: Token movements in the protocol. *) @@ -726,3 +727,7 @@ let tests = `Quick test_transfer_n_with_several_givers; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("token movements", tests)] + |> Lwt_main.run -- GitLab From 9d91455778660332ded34b47fd795c62ba227a7d Mon Sep 17 00:00:00 2001 From: lykimq Date: Fri, 7 Apr 2023 16:14:16 +0200 Subject: [PATCH 7/8] Alcotezt-UX: fix invocation headers, opt. titles for [pbt] in all protocols --- .../test/pbt/liquidity_baking_pbt.ml | 10 +++++----- .../test/pbt/saturation_fuzzing.ml | 17 ++++++++-------- .../lib_protocol/test/pbt/test_bitset.ml | 7 ++++--- .../test/pbt/test_bytes_conversion.ml | 6 +++--- .../test/pbt/test_carbonated_map.ml | 8 +++----- .../test/pbt/test_compare_operations.ml | 9 ++++----- .../test/pbt/test_dal_slot_proof.ml | 3 ++- .../test/pbt/test_gas_properties.ml | 8 +++----- .../lib_protocol/test/pbt/test_merkle_list.ml | 9 +++++---- .../test/pbt/test_operation_encoding.ml | 7 ++++--- .../test/pbt/test_refutation_game.ml | 3 ++- .../lib_protocol/test/pbt/test_sampler.ml | 10 ++++------ .../test/pbt/test_sc_rollup_encoding.ml | 7 ++++--- .../test/pbt/test_sc_rollup_tick_repr.ml | 7 ++++--- .../test/pbt/test_script_comparison.ml | 19 +++++++++--------- .../lib_protocol/test/pbt/test_tez_repr.ml | 7 ++++--- .../test/pbt/test_tx_rollup_l2_encoding.ml | 9 +++++---- .../test/pbt/test_zk_rollup_encoding.ml | 9 +++++---- .../test/pbt/liquidity_baking_pbt.ml | 11 +++++----- .../test/pbt/saturation_fuzzing.ml | 18 ++++++++--------- .../lib_protocol/test/pbt/test_bitset.ml | 7 ++++--- .../test/pbt/test_bytes_conversion.ml | 7 +++---- .../test/pbt/test_carbonated_map.ml | 9 +++------ .../test/pbt/test_compare_operations.ml | 10 ++++------ .../test/pbt/test_dal_slot_proof.ml | 4 ++-- .../test/pbt/test_gas_properties.ml | 9 +++------ .../lib_protocol/test/pbt/test_merkle_list.ml | 10 +++++----- .../test/pbt/test_operation_encoding.ml | 8 ++++---- .../test/pbt/test_refutation_game.ml | 4 ++-- .../lib_protocol/test/pbt/test_sampler.ml | 11 ++++------ .../test/pbt/test_sc_rollup_encoding.ml | 8 ++++---- .../test/pbt/test_sc_rollup_inbox.ml | 10 +++------- .../test/pbt/test_sc_rollup_tick_repr.ml | 8 ++++---- .../test/pbt/test_script_comparison.ml | 20 +++++++++---------- .../lib_protocol/test/pbt/test_tez_repr.ml | 8 ++++---- .../test/pbt/test_zk_rollup_encoding.ml | 10 +++++----- .../test/pbt/liquidity_baking_pbt.ml | 10 +++++----- .../test/pbt/saturation_fuzzing.ml | 17 ++++++++-------- .../lib_protocol/test/pbt/test_bitset.ml | 7 ++++--- .../test/pbt/test_bytes_conversion.ml | 6 +++--- .../test/pbt/test_carbonated_map.ml | 8 +++----- .../test/pbt/test_compare_operations.ml | 9 ++++----- .../test/pbt/test_dal_slot_proof.ml | 3 ++- .../test/pbt/test_gas_properties.ml | 8 +++----- .../lib_protocol/test/pbt/test_merkle_list.ml | 9 +++++---- .../test/pbt/test_operation_encoding.ml | 7 ++++--- .../test/pbt/test_refutation_game.ml | 3 ++- .../lib_protocol/test/pbt/test_sampler.ml | 10 ++++------ .../test/pbt/test_sc_rollup_encoding.ml | 7 ++++--- .../test/pbt/test_sc_rollup_inbox.ml | 9 +++------ .../test/pbt/test_sc_rollup_tick_repr.ml | 7 ++++--- .../test/pbt/test_script_comparison.ml | 19 +++++++++--------- .../lib_protocol/test/pbt/test_tez_repr.ml | 7 ++++--- .../test/pbt/test_zk_rollup_encoding.ml | 9 +++++---- 54 files changed, 233 insertions(+), 249 deletions(-) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/liquidity_baking_pbt.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/liquidity_baking_pbt.ml index 6eb71eb3d7bf..46d32c6894e4 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/pbt/liquidity_baking_pbt.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/liquidity_baking_pbt.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: pbt for liquidity baking - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe \ + -- --file liquidity_baking_pbt.ml Subject: Test liquidity baking contracts using randomly generated inputs. *) @@ -319,9 +320,8 @@ let () = let open Qcheck2_helpers in Alcotest.run ~__FILE__ - "protocol > pbt > liquidity baking" + Protocol.name [ - ( Protocol.name ^ ": Machines Cross-Validation", - qcheck_wrap machine_validation_tests ); - (Protocol.name ^ ": Economic Properties", qcheck_wrap economic_tests); + ("Machines Cross-Validation", qcheck_wrap machine_validation_tests); + ("Economic Properties", qcheck_wrap economic_tests); ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/saturation_fuzzing.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/saturation_fuzzing.ml index d18d88741a79..bd68e73fae58 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/pbt/saturation_fuzzing.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/saturation_fuzzing.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol Library - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe \ + -- --file saturation_fuzzing.ml Subject: Operations in Saturation_repr *) @@ -190,12 +191,12 @@ let tests_sqrt = [test_sqrt_squared; test_squared_sqrt] let () = Alcotest.run ~__FILE__ - "protocol > pbt > saturation" + Protocol.name [ - (Protocol.name ^ ": add", qcheck_wrap tests_add); - (Protocol.name ^ ": mul", qcheck_wrap tests_mul); - (Protocol.name ^ ": sub", qcheck_wrap tests_sub); - (Protocol.name ^ ": add and sub", qcheck_wrap tests_add_sub); - (Protocol.name ^ ": sqrt", qcheck_wrap tests_sqrt); - (Protocol.name ^ ": <= and >=", qcheck_wrap tests_boundaries); + ("add", qcheck_wrap tests_add); + ("mul", qcheck_wrap tests_mul); + ("sub", qcheck_wrap tests_sub); + ("add and sub", qcheck_wrap tests_add_sub); + ("sqrt", qcheck_wrap tests_sqrt); + ("<= and >=", qcheck_wrap tests_boundaries); ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_bitset.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_bitset.ml index 2adf84a1978a..e63fd96ed110 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_bitset.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_bitset.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol Library - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe \ + -- --file test_bitset.ml Subject: Bitset structure *) @@ -97,9 +98,9 @@ let test_fill = let () = Alcotest.run ~__FILE__ - "bits" + Protocol.name [ - ( Protocol.name ^ ": quantity", + ( "quantity", qcheck_wrap [ QCheck2.Test.make diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_bytes_conversion.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_bytes_conversion.ml index ac0001cba731..2c3479b69879 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_bytes_conversion.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_bytes_conversion.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: pbt for bytes <=> nat/int conversions - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe \ + -- --file test_bytes_conversion.ml Subject: Test the conversions between bytes and int/nat *) @@ -210,6 +211,5 @@ let tests = let () = Alcotest.run ~__FILE__ - ("protocol > script_bytes > " ^ Protocol.name - ^ ": bytes and int/nat conversion ") + (Protocol.name ^ ": bytes and int/nat conversion ") tests diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_carbonated_map.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_carbonated_map.ml index ce22c3c42008..078c8258ba51 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_carbonated_map.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_carbonated_map.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol Library - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe \ + -- --file test_carbonated_map.ml Subject: Operations in Carbonated_map *) @@ -548,7 +549,4 @@ let tests ~rand = qcheck_wrap ~rand qcheck_tests @ unit_tests let () = (* Ensure deterministic results. *) let rand = Random.State.make [|0x1337533D; 71287309; 397060904|] in - Alcotest.run - ~__FILE__ - "protocol > pbt > carbonated map" - [(Protocol.name ^ ": Carbonated map", tests ~rand)] + Alcotest.run ~__FILE__ Protocol.name [("Carbonated map", tests ~rand)] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_compare_operations.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_compare_operations.ml index 1512fa32bc6d..8014f6b6028b 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_compare_operations.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_compare_operations.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (Operation compare) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe \ + -- --file test_compare_operations.ml Subject: Valid operations Comparison *) @@ -97,7 +98,5 @@ let tests = [test_compare_is_strorder] let () = Alcotest.run ~__FILE__ - "Compare operations" - [ - (Protocol.name ^ ": Compare_operations", Qcheck2_helpers.qcheck_wrap tests); - ] + Protocol.name + [("Compare_operations", Qcheck2_helpers.qcheck_wrap tests)] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_dal_slot_proof.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_dal_slot_proof.ml index 5e1a35744d5a..3e5bfcec0228 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_dal_slot_proof.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_dal_slot_proof.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: PBT for refutation proofs of Dal - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe \ + -- --file test_dal_slot_proof.ml Subject: Refutation proof-related functions of Dal *) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_gas_properties.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_gas_properties.ml index 9ec8f40e2d8f..328719471854 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_gas_properties.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_gas_properties.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (gas properties) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe \ + -- --file test_gas_properties.ml Subject: Arithmetic properties around gas. *) @@ -140,7 +141,4 @@ let tests = ] let () = - Alcotest.run - ~__FILE__ - "protocol > pbt > gas" - [(Protocol.name ^ ": gas properties", qcheck_wrap tests)] + Alcotest.run ~__FILE__ Protocol.name [("gas properties", qcheck_wrap tests)] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_merkle_list.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_merkle_list.ml index 6c47f0582bb0..4fd8d5b25d76 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_merkle_list.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_merkle_list.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol Library - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe \ + -- --file test_merkle_list.ml Subject: Tx rollup l2 encoding *) @@ -111,15 +112,15 @@ let () = let qcheck_wrap = qcheck_wrap ~rand:(Random.State.make_self_init ()) in Alcotest.run ~__FILE__ - "Merkle list" + Protocol.name [ - ( Protocol.name ^ ": scons_equiv", + ( "scons_equiv", qcheck_wrap [ test_scons_scons_tr_equiv ~count:1000; test_scons_compute_equiv ~count:1000; ] ); - ( Protocol.name ^ ": check_path", + ( "check_path", qcheck_wrap [test_check_path ~count:1000; test_check_path_wrong ~count:1000] ); ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_operation_encoding.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_operation_encoding.ml index 3e86031acca1..8f348c9102c3 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_operation_encoding.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_operation_encoding.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol Library - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe \ + -- --file test_operation_encoding.ml Subject: Encoding for operations *) @@ -62,5 +63,5 @@ let () = let qcheck_wrap = qcheck_wrap ~rand:(Random.State.make_self_init ()) in Alcotest.run ~__FILE__ - "Operation_encoding" - [(Protocol.name ^ ": roundtrip", qcheck_wrap [test_operation])] + (Protocol.name ^ ": Operation_encoding") + [(": roundtrip", qcheck_wrap [test_operation])] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_refutation_game.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_refutation_game.ml index 5883c3aab5d2..469bc235e488 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_refutation_game.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_refutation_game.ml @@ -27,7 +27,8 @@ (** Testing ------- Component: PBT for the SCORU refutation game - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe \ + -- --file test_refutation_game.ml Subject: SCORU refutation game *) open Protocol diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_sampler.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_sampler.ml index cd2b634592f8..90f327aab137 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_sampler.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_sampler.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol Library - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe \ + -- --file test_sampler.ml Subject: Operations in Saturation_repr *) @@ -266,8 +267,5 @@ let alias_z_test = let () = Alcotest.run ~__FILE__ - "protocol > pbt > sampling" - [ - ( Protocol.name ^ ": sampling", - qcheck_wrap [alias_float_test; alias_z_test] ); - ] + Protocol.name + [("sampling", qcheck_wrap [alias_float_test; alias_z_test])] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_sc_rollup_encoding.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_sc_rollup_encoding.ml index 998d8ab4d6cc..dc8c55fdedd9 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_sc_rollup_encoding.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_sc_rollup_encoding.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol Library - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe \ + -- --file test_sc_rollup_encoding.ml Subject: SC rollup encoding *) @@ -290,5 +291,5 @@ let tests = let () = Alcotest.run ~__FILE__ - "SC rollup encoding" - [(Protocol.name ^ ": roundtrip", qcheck_wrap tests)] + (Protocol.name ^ ": SC rollup encoding") + [(": roundtrip", qcheck_wrap tests)] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_sc_rollup_tick_repr.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_sc_rollup_tick_repr.ml index 9f556f905684..af44a23d49ab 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_sc_rollup_tick_repr.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_sc_rollup_tick_repr.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol Library - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe \ + -- --file test_sc_rollup_tick_repr.ml Subject: Operations in Tick_repr *) @@ -105,5 +106,5 @@ let tests = let () = Alcotest.run ~__FILE__ - "Tick_repr" - [(Protocol.name ^ ": Tick_repr", Qcheck2_helpers.qcheck_wrap tests)] + Protocol.name + [("Tick_repr", Qcheck2_helpers.qcheck_wrap tests)] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_script_comparison.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_script_comparison.ml index 64f5e8550195..19a852dc8bd3 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_script_comparison.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_script_comparison.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Script_comparison - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe \ + -- --file test_script_comparison.ml Subject: PBT of the Script_comparable.compare_comparable function. *) @@ -344,14 +345,12 @@ let test_pack_unpack = let () = Alcotest.run ~__FILE__ - "protocol > pbt > script_comparison" + Protocol.name [ - ( Protocol.name ^ ": compatible_with_reference", - qcheck_wrap [test_compatible_with_reference] ); - ( Protocol.name ^ ": compatible_with_packing", - qcheck_wrap [test_compatible_with_packing] ); - (Protocol.name ^ ": reflexivity", qcheck_wrap [test_reflexivity]); - (Protocol.name ^ ": symmetry", qcheck_wrap [test_symmetry]); - (Protocol.name ^ ": transitivity", qcheck_wrap [test_transitivity]); - (Protocol.name ^ ": pack_unpack", qcheck_wrap [test_pack_unpack]); + ("compatible_with_reference", qcheck_wrap [test_compatible_with_reference]); + ("compatible_with_packing", qcheck_wrap [test_compatible_with_packing]); + ("reflexivity", qcheck_wrap [test_reflexivity]); + ("symmetry", qcheck_wrap [test_symmetry]); + ("transitivity", qcheck_wrap [test_transitivity]); + ("pack_unpack", qcheck_wrap [test_pack_unpack]); ] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_tez_repr.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_tez_repr.ml index b08c2775fee3..2c4f25cd2a0b 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_tez_repr.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_tez_repr.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol Library - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe \ + -- --file test_tez_repr.ml Subject: Operations in Tez_repr *) @@ -132,5 +133,5 @@ let tests = let () = Alcotest.run ~__FILE__ - "protocol > pbt > tez_repr" - [(Protocol.name ^ ": Tez_repr", Qcheck2_helpers.qcheck_wrap tests)] + Protocol.name + [("Tez_repr", Qcheck2_helpers.qcheck_wrap tests)] diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_tx_rollup_l2_encoding.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_tx_rollup_l2_encoding.ml index 9c78e11d4f9c..2abdd72e9272 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_tx_rollup_l2_encoding.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_tx_rollup_l2_encoding.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol Library - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe \ + -- --file test_tx_rollup_l2_encoding.ml Subject: Tx rollup l2 encoding *) @@ -278,10 +279,10 @@ let () = let qcheck_wrap = qcheck_wrap ~rand:(Random.State.make_self_init ()) in Alcotest.run ~__FILE__ - "Compact_encoding" + (Protocol.name ^ ": Compact_encoding") [ - (Protocol.name ^ ": quantity", qcheck_wrap [test_quantity ~count:100_000]); - ( Protocol.name ^ ": roundtrip", + (": quantity", qcheck_wrap [test_quantity ~count:100_000]); + ( ": roundtrip", qcheck_wrap [ test_roundtrip diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_zk_rollup_encoding.ml b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_zk_rollup_encoding.ml index fa638fffe4b7..dc439eafe385 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_zk_rollup_encoding.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/test_zk_rollup_encoding.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol Library - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/pbt/main.exe \ + -- --file test_zk_rollup_encoding.ml Subject: Zk rollup encodings *) @@ -222,8 +223,8 @@ let tests_to_scalar = [test_address_to_scalar; test_operation_to_scalar] let () = Alcotest.run ~__FILE__ - "ZK rollup encoding" + (Protocol.name ^ ": ZK rollup encoding") [ - (Protocol.name ^ ": roundtrip", qcheck_wrap tests_roundtrip); - (Protocol.name ^ ": to_scalar", qcheck_wrap tests_to_scalar); + (": roundtrip", qcheck_wrap tests_roundtrip); + (": to_scalar", qcheck_wrap tests_to_scalar); ] diff --git a/src/proto_017_PtNairob/lib_protocol/test/pbt/liquidity_baking_pbt.ml b/src/proto_017_PtNairob/lib_protocol/test/pbt/liquidity_baking_pbt.ml index 8e1a74c0d755..5da5752cd547 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/pbt/liquidity_baking_pbt.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/pbt/liquidity_baking_pbt.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: pbt for liquidity baking - Invocation: [QCHECK_SEED=] dune exec \ - src/proto_alpha/lib_protocol/test/pbt/liquidity_baking_pbt.exe + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/pbt/main.exe \ + -- --file liquidity_baking_pbt.ml Subject: Test liquidity baking contracts using randomly generated inputs. *) @@ -320,9 +320,8 @@ let () = let open Qcheck2_helpers in Alcotest.run ~__FILE__ - "protocol > pbt > liquidity baking" + Protocol.name [ - ( Protocol.name ^ ": Machines Cross-Validation", - qcheck_wrap machine_validation_tests ); - (Protocol.name ^ ": Economic Properties", qcheck_wrap economic_tests); + ("Machines Cross-Validation", qcheck_wrap machine_validation_tests); + ("Economic Properties", qcheck_wrap economic_tests); ] diff --git a/src/proto_017_PtNairob/lib_protocol/test/pbt/saturation_fuzzing.ml b/src/proto_017_PtNairob/lib_protocol/test/pbt/saturation_fuzzing.ml index 88783970686d..535dc427ff61 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/pbt/saturation_fuzzing.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/pbt/saturation_fuzzing.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Protocol Library - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/pbt/saturation_fuzzing.exe + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/pbt/main.exe \ + -- --file saturation_fuzzing.ml Subject: Operations in Saturation_repr *) @@ -191,12 +191,12 @@ let tests_sqrt = [test_sqrt_squared; test_squared_sqrt] let () = Alcotest.run ~__FILE__ - "protocol > pbt > saturation" + Protocol.name [ - (Protocol.name ^ ": add", qcheck_wrap tests_add); - (Protocol.name ^ ": mul", qcheck_wrap tests_mul); - (Protocol.name ^ ": sub", qcheck_wrap tests_sub); - (Protocol.name ^ ": add and sub", qcheck_wrap tests_add_sub); - (Protocol.name ^ ": sqrt", qcheck_wrap tests_sqrt); - (Protocol.name ^ ": <= and >=", qcheck_wrap tests_boundaries); + ("add", qcheck_wrap tests_add); + ("mul", qcheck_wrap tests_mul); + ("sub", qcheck_wrap tests_sub); + ("add and sub", qcheck_wrap tests_add_sub); + ("sqrt", qcheck_wrap tests_sqrt); + ("<= and >=", qcheck_wrap tests_boundaries); ] diff --git a/src/proto_017_PtNairob/lib_protocol/test/pbt/test_bitset.ml b/src/proto_017_PtNairob/lib_protocol/test/pbt/test_bitset.ml index ee7c3cdeaec3..f7a58ba52e56 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/pbt/test_bitset.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/pbt/test_bitset.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol Library - Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/test_bitset.exe + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/pbt/main.exe \ + -- --file test_bitset.ml Subject: Bitset structure *) @@ -95,9 +96,9 @@ let test_fill = let () = Alcotest.run ~__FILE__ - "bits" + Protocol.name [ - ( Protocol.name ^ ": quantity", + ( "quantity", qcheck_wrap [ QCheck2.Test.make diff --git a/src/proto_017_PtNairob/lib_protocol/test/pbt/test_bytes_conversion.ml b/src/proto_017_PtNairob/lib_protocol/test/pbt/test_bytes_conversion.ml index da52abe39208..3e0c3762fca1 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/pbt/test_bytes_conversion.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/pbt/test_bytes_conversion.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: pbt for bytes <=> nat/int conversions - Invocation: [QCHECK_SEED=] dune exec \ - src/proto_alpha/lib_protocol/test/pbt/test_bytes_conversion.exe + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/pbt/main.exe \ + -- --file test_bytes_conversion.ml Subject: Test the conversions between bytes and int/nat *) @@ -211,6 +211,5 @@ let tests = let () = Alcotest.run ~__FILE__ - ("protocol > script_bytes > " ^ Protocol.name - ^ ": bytes and int/nat conversion ") + (Protocol.name ^ ": bytes and int/nat conversion ") tests diff --git a/src/proto_017_PtNairob/lib_protocol/test/pbt/test_carbonated_map.ml b/src/proto_017_PtNairob/lib_protocol/test/pbt/test_carbonated_map.ml index 7e89d99381d9..568ec816747d 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/pbt/test_carbonated_map.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/pbt/test_carbonated_map.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Protocol Library - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/pbt/test_carbonated_map.exe + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/pbt/main.exe \ + -- --file test_carbonated_map.ml Subject: Operations in Carbonated_map *) @@ -545,7 +545,4 @@ let tests ~rand = qcheck_wrap ~rand qcheck_tests @ unit_tests let () = (* Ensure deterministic results. *) let rand = Random.State.make [|0x1337533D; 71287309; 397060904|] in - Alcotest.run - ~__FILE__ - "protocol > pbt > carbonated map" - [(Protocol.name ^ ": Carbonated map", tests ~rand)] + Alcotest.run ~__FILE__ Protocol.name [("Carbonated map", tests ~rand)] diff --git a/src/proto_017_PtNairob/lib_protocol/test/pbt/test_compare_operations.ml b/src/proto_017_PtNairob/lib_protocol/test/pbt/test_compare_operations.ml index 78498a7a4201..456cc6d92555 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/pbt/test_compare_operations.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/pbt/test_compare_operations.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Protocol (Operation compare) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/pbt/test_compare_operations.exe + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/pbt/main.exe \ + -- --file test_compare_operations.ml Subject: Valid operations Comparison *) @@ -98,7 +98,5 @@ let tests = [test_compare_is_strorder] let () = Alcotest.run ~__FILE__ - "Compare operations" - [ - (Protocol.name ^ ": Compare_operations", Qcheck2_helpers.qcheck_wrap tests); - ] + Protocol.name + [("Compare_operations", Qcheck2_helpers.qcheck_wrap tests)] diff --git a/src/proto_017_PtNairob/lib_protocol/test/pbt/test_dal_slot_proof.ml b/src/proto_017_PtNairob/lib_protocol/test/pbt/test_dal_slot_proof.ml index 7025ae79006f..398a6735105f 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/pbt/test_dal_slot_proof.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/pbt/test_dal_slot_proof.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: PBT for refutation proofs of Dal - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/pbt/test_dal_slot_proof.exe + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/pbt/main.exe \ + -- --file test_dal_slot_proof.ml Subject: Refutation proof-related functions of Dal *) diff --git a/src/proto_017_PtNairob/lib_protocol/test/pbt/test_gas_properties.ml b/src/proto_017_PtNairob/lib_protocol/test/pbt/test_gas_properties.ml index eeae15b63056..cfa59556041f 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/pbt/test_gas_properties.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/pbt/test_gas_properties.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Protocol (gas properties) - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/pbt/test_gas_properties.exe + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/pbt/main.exe \ + -- --file test_gas_properties.ml Subject: Arithmetic properties around gas. *) @@ -141,7 +141,4 @@ let tests = ] let () = - Alcotest.run - ~__FILE__ - "protocol > pbt > gas" - [(Protocol.name ^ ": gas properties", qcheck_wrap tests)] + Alcotest.run ~__FILE__ Protocol.name [("gas properties", qcheck_wrap tests)] diff --git a/src/proto_017_PtNairob/lib_protocol/test/pbt/test_merkle_list.ml b/src/proto_017_PtNairob/lib_protocol/test/pbt/test_merkle_list.ml index 89d1a690ad6b..ec0acc9039a6 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/pbt/test_merkle_list.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/pbt/test_merkle_list.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Protocol Library - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/pbt/test_merkle_list.exe + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/pbt/main.exe \ + -- --file test_merkle_list.ml Subject: Tx rollup l2 encoding *) @@ -112,15 +112,15 @@ let () = let qcheck_wrap = qcheck_wrap ~rand:(Random.State.make_self_init ()) in Alcotest.run ~__FILE__ - "Merkle list" + Protocol.name [ - ( Protocol.name ^ ": scons_equiv", + ( "scons_equiv", qcheck_wrap [ test_scons_scons_tr_equiv ~count:1000; test_scons_compute_equiv ~count:1000; ] ); - ( Protocol.name ^ ": check_path", + ( "check_path", qcheck_wrap [test_check_path ~count:1000; test_check_path_wrong ~count:1000] ); ] diff --git a/src/proto_017_PtNairob/lib_protocol/test/pbt/test_operation_encoding.ml b/src/proto_017_PtNairob/lib_protocol/test/pbt/test_operation_encoding.ml index 3ebebfc687a2..0fac8a9e3666 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/pbt/test_operation_encoding.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/pbt/test_operation_encoding.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Protocol Library - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/pbt/test_operation_encoding.exe + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/pbt/main.exe \ + -- --file test_operation_encoding.ml Subject: Encoding for operations *) @@ -63,5 +63,5 @@ let () = let qcheck_wrap = qcheck_wrap ~rand:(Random.State.make_self_init ()) in Alcotest.run ~__FILE__ - "Operation_encoding" - [(Protocol.name ^ ": roundtrip", qcheck_wrap [test_operation])] + (Protocol.name ^ ": Operation_encoding") + [(": roundtrip", qcheck_wrap [test_operation])] diff --git a/src/proto_017_PtNairob/lib_protocol/test/pbt/test_refutation_game.ml b/src/proto_017_PtNairob/lib_protocol/test/pbt/test_refutation_game.ml index 100a001375e8..a7ddfeeb2333 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/pbt/test_refutation_game.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/pbt/test_refutation_game.ml @@ -27,8 +27,8 @@ (** Testing ------- Component: PBT for the SCORU refutation game - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/pbt/test_refutation_game.exe + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/pbt/main.exe \ + -- --file test_refutation_game.ml Subject: SCORU refutation game *) open Protocol diff --git a/src/proto_017_PtNairob/lib_protocol/test/pbt/test_sampler.ml b/src/proto_017_PtNairob/lib_protocol/test/pbt/test_sampler.ml index 86c4d5410f8a..e33e7d9746c7 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/pbt/test_sampler.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/pbt/test_sampler.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Protocol Library - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/pbt/test_sampler.exe + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/pbt/main.exe \ + -- --file test_sampler.ml Subject: Operations in Saturation_repr *) @@ -267,8 +267,5 @@ let alias_z_test = let () = Alcotest.run ~__FILE__ - "protocol > pbt > sampling" - [ - ( Protocol.name ^ ": sampling", - qcheck_wrap [alias_float_test; alias_z_test] ); - ] + Protocol.name + [("sampling", qcheck_wrap [alias_float_test; alias_z_test])] diff --git a/src/proto_017_PtNairob/lib_protocol/test/pbt/test_sc_rollup_encoding.ml b/src/proto_017_PtNairob/lib_protocol/test/pbt/test_sc_rollup_encoding.ml index ec4def22ec51..be7d755a9c35 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/pbt/test_sc_rollup_encoding.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/pbt/test_sc_rollup_encoding.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Protocol Library - Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe \ - -- -f 'SC rollup encoding' + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/pbt/main.exe \ + -- --file test_sc_rollup_encoding.ml Subject: SC rollup encoding *) @@ -293,5 +293,5 @@ let tests = let () = Alcotest.run ~__FILE__ - "SC rollup encoding" - [(Protocol.name ^ ": roundtrip", qcheck_wrap tests)] + (Protocol.name ^ ": SC rollup encoding") + [(": roundtrip", qcheck_wrap tests)] diff --git a/src/proto_017_PtNairob/lib_protocol/test/pbt/test_sc_rollup_inbox.ml b/src/proto_017_PtNairob/lib_protocol/test/pbt/test_sc_rollup_inbox.ml index 3bcfae8f37e3..b14dc29d449c 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/pbt/test_sc_rollup_inbox.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/pbt/test_sc_rollup_inbox.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Protocol Library - Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe \ - -- -f 'Smart rollup inbox' + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/pbt/main.exe \ + -- --file test_sc_rollup_inbox.ml Subject: Smart rollup inbox *) @@ -74,8 +74,4 @@ let test_add_info_per_level = let tests = [test_add_info_per_level] -let () = - Alcotest.run - ~__FILE__ - "Smart rollup inbox" - [(Protocol.name ^ ": safety", qcheck_wrap tests)] +let () = Alcotest.run ~__FILE__ Protocol.name [("safety", qcheck_wrap tests)] diff --git a/src/proto_017_PtNairob/lib_protocol/test/pbt/test_sc_rollup_tick_repr.ml b/src/proto_017_PtNairob/lib_protocol/test/pbt/test_sc_rollup_tick_repr.ml index 7b26b7b5e915..65196293dc47 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/pbt/test_sc_rollup_tick_repr.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/pbt/test_sc_rollup_tick_repr.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Protocol Library - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/pbt/test_sc_rollup_tick_repr.exe + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/pbt/main.exe \ + -- --file test_sc_rollup_tick_repr.ml Subject: Operations in Tick_repr *) @@ -106,5 +106,5 @@ let tests = let () = Alcotest.run ~__FILE__ - "Tick_repr" - [(Protocol.name ^ ": Tick_repr", Qcheck2_helpers.qcheck_wrap tests)] + Protocol.name + [("Tick_repr", Qcheck2_helpers.qcheck_wrap tests)] diff --git a/src/proto_017_PtNairob/lib_protocol/test/pbt/test_script_comparison.ml b/src/proto_017_PtNairob/lib_protocol/test/pbt/test_script_comparison.ml index a9a533021d9e..e8c9c3266913 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/pbt/test_script_comparison.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/pbt/test_script_comparison.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Script_comparison - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/pbt/test_script_comparison.exe + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/pbt/main.exe \ + -- --file test_script_comparison.ml Subject: PBT of the Script_comparable.compare_comparable function. *) @@ -344,14 +344,12 @@ let test_pack_unpack = let () = Alcotest.run ~__FILE__ - "protocol > pbt > script_comparison" + Protocol.name [ - ( Protocol.name ^ ": compatible_with_reference", - qcheck_wrap [test_compatible_with_reference] ); - ( Protocol.name ^ ": compatible_with_packing", - qcheck_wrap [test_compatible_with_packing] ); - (Protocol.name ^ ": reflexivity", qcheck_wrap [test_reflexivity]); - (Protocol.name ^ ": symmetry", qcheck_wrap [test_symmetry]); - (Protocol.name ^ ": transitivity", qcheck_wrap [test_transitivity]); - (Protocol.name ^ ": pack_unpack", qcheck_wrap [test_pack_unpack]); + ("compatible_with_reference", qcheck_wrap [test_compatible_with_reference]); + ("compatible_with_packing", qcheck_wrap [test_compatible_with_packing]); + ("reflexivity", qcheck_wrap [test_reflexivity]); + ("symmetry", qcheck_wrap [test_symmetry]); + ("transitivity", qcheck_wrap [test_transitivity]); + ("pack_unpack", qcheck_wrap [test_pack_unpack]); ] diff --git a/src/proto_017_PtNairob/lib_protocol/test/pbt/test_tez_repr.ml b/src/proto_017_PtNairob/lib_protocol/test/pbt/test_tez_repr.ml index 14078be4c1d3..c02de8b0313e 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/pbt/test_tez_repr.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/pbt/test_tez_repr.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Protocol Library - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/pbt/test_tez_repr.exe + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/pbt/main.exe \ + -- --file test_tez_repr.ml Subject: Operations in Tez_repr *) @@ -133,5 +133,5 @@ let tests = let () = Alcotest.run ~__FILE__ - "protocol > pbt > tez_repr" - [(Protocol.name ^ ": Tez_repr", Qcheck2_helpers.qcheck_wrap tests)] + Protocol.name + [("Tez_repr", Qcheck2_helpers.qcheck_wrap tests)] diff --git a/src/proto_017_PtNairob/lib_protocol/test/pbt/test_zk_rollup_encoding.ml b/src/proto_017_PtNairob/lib_protocol/test/pbt/test_zk_rollup_encoding.ml index 586822aea6d5..564eb08eba7f 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/pbt/test_zk_rollup_encoding.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/pbt/test_zk_rollup_encoding.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Protocol Library - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/pbt/test_zk_rollup_encoding.exe + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/pbt/main.exe \ + -- --file test_zk_rollup_encoding.ml Subject: Zk rollup encodings *) @@ -223,8 +223,8 @@ let tests_to_scalar = [test_address_to_scalar; test_operation_to_scalar] let () = Alcotest.run ~__FILE__ - "ZK rollup encoding" + (Protocol.name ^ ": ZK rollup encoding") [ - (Protocol.name ^ ": roundtrip", qcheck_wrap tests_roundtrip); - (Protocol.name ^ ": to_scalar", qcheck_wrap tests_to_scalar); + (": roundtrip", qcheck_wrap tests_roundtrip); + (": to_scalar", qcheck_wrap tests_to_scalar); ] diff --git a/src/proto_alpha/lib_protocol/test/pbt/liquidity_baking_pbt.ml b/src/proto_alpha/lib_protocol/test/pbt/liquidity_baking_pbt.ml index f1a80e207cb7..0a891ece0139 100644 --- a/src/proto_alpha/lib_protocol/test/pbt/liquidity_baking_pbt.ml +++ b/src/proto_alpha/lib_protocol/test/pbt/liquidity_baking_pbt.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: pbt for liquidity baking - Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe \ + -- --file liquidity_baking_pbt.ml Subject: Test liquidity baking contracts using randomly generated inputs. *) @@ -319,9 +320,8 @@ let () = let open Qcheck2_helpers in Alcotest.run ~__FILE__ - "protocol > pbt > liquidity baking" + Protocol.name [ - ( Protocol.name ^ ": Machines Cross-Validation", - qcheck_wrap machine_validation_tests ); - (Protocol.name ^ ": Economic Properties", qcheck_wrap economic_tests); + ("Machines Cross-Validation", qcheck_wrap machine_validation_tests); + ("Economic Properties", qcheck_wrap economic_tests); ] diff --git a/src/proto_alpha/lib_protocol/test/pbt/saturation_fuzzing.ml b/src/proto_alpha/lib_protocol/test/pbt/saturation_fuzzing.ml index 12c54af32b5c..c792f2048eb7 100644 --- a/src/proto_alpha/lib_protocol/test/pbt/saturation_fuzzing.ml +++ b/src/proto_alpha/lib_protocol/test/pbt/saturation_fuzzing.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol Library - Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe \ + -- --file saturation_fuzzing.ml Subject: Operations in Saturation_repr *) @@ -190,12 +191,12 @@ let tests_sqrt = [test_sqrt_squared; test_squared_sqrt] let () = Alcotest.run ~__FILE__ - "protocol > pbt > saturation" + Protocol.name [ - (Protocol.name ^ ": add", qcheck_wrap tests_add); - (Protocol.name ^ ": mul", qcheck_wrap tests_mul); - (Protocol.name ^ ": sub", qcheck_wrap tests_sub); - (Protocol.name ^ ": add and sub", qcheck_wrap tests_add_sub); - (Protocol.name ^ ": sqrt", qcheck_wrap tests_sqrt); - (Protocol.name ^ ": <= and >=", qcheck_wrap tests_boundaries); + ("add", qcheck_wrap tests_add); + ("mul", qcheck_wrap tests_mul); + ("sub", qcheck_wrap tests_sub); + ("add and sub", qcheck_wrap tests_add_sub); + ("sqrt", qcheck_wrap tests_sqrt); + ("<= and >=", qcheck_wrap tests_boundaries); ] diff --git a/src/proto_alpha/lib_protocol/test/pbt/test_bitset.ml b/src/proto_alpha/lib_protocol/test/pbt/test_bitset.ml index dcb57ea9c953..d37c9f5e9287 100644 --- a/src/proto_alpha/lib_protocol/test/pbt/test_bitset.ml +++ b/src/proto_alpha/lib_protocol/test/pbt/test_bitset.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol Library - Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe \ + -- --file test_bitset.ml Subject: Bitset structure *) @@ -95,9 +96,9 @@ let test_fill = let () = Alcotest.run ~__FILE__ - "bits" + Protocol.name [ - ( Protocol.name ^ ": quantity", + ( "quantity", qcheck_wrap [ QCheck2.Test.make diff --git a/src/proto_alpha/lib_protocol/test/pbt/test_bytes_conversion.ml b/src/proto_alpha/lib_protocol/test/pbt/test_bytes_conversion.ml index e3ed8f47340a..59ebebfd7b77 100644 --- a/src/proto_alpha/lib_protocol/test/pbt/test_bytes_conversion.ml +++ b/src/proto_alpha/lib_protocol/test/pbt/test_bytes_conversion.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: pbt for bytes <=> nat/int conversions - Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe \ + -- --file test_bytes_conversion.ml Subject: Test the conversions between bytes and int/nat *) @@ -210,6 +211,5 @@ let tests = let () = Alcotest.run ~__FILE__ - ("protocol > script_bytes > " ^ Protocol.name - ^ ": bytes and int/nat conversion ") + (Protocol.name ^ ": bytes and int/nat conversion ") tests diff --git a/src/proto_alpha/lib_protocol/test/pbt/test_carbonated_map.ml b/src/proto_alpha/lib_protocol/test/pbt/test_carbonated_map.ml index 797fbfde0d9f..718d442daa97 100644 --- a/src/proto_alpha/lib_protocol/test/pbt/test_carbonated_map.ml +++ b/src/proto_alpha/lib_protocol/test/pbt/test_carbonated_map.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol Library - Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe \ + -- --file test_carbonated_map.ml Subject: Operations in Carbonated_map *) @@ -544,7 +545,4 @@ let tests ~rand = qcheck_wrap ~rand qcheck_tests @ unit_tests let () = (* Ensure deterministic results. *) let rand = Random.State.make [|0x1337533D; 71287309; 397060904|] in - Alcotest.run - ~__FILE__ - "protocol > pbt > carbonated map" - [(Protocol.name ^ ": Carbonated map", tests ~rand)] + Alcotest.run ~__FILE__ Protocol.name [("Carbonated map", tests ~rand)] diff --git a/src/proto_alpha/lib_protocol/test/pbt/test_compare_operations.ml b/src/proto_alpha/lib_protocol/test/pbt/test_compare_operations.ml index 97d862a2e9c5..b4bbb0db3e44 100644 --- a/src/proto_alpha/lib_protocol/test/pbt/test_compare_operations.ml +++ b/src/proto_alpha/lib_protocol/test/pbt/test_compare_operations.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (Operation compare) - Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe \ + -- --file test_compare_operations.ml Subject: Valid operations Comparison *) @@ -97,7 +98,5 @@ let tests = [test_compare_is_strorder] let () = Alcotest.run ~__FILE__ - "Compare operations" - [ - (Protocol.name ^ ": Compare_operations", Qcheck2_helpers.qcheck_wrap tests); - ] + Protocol.name + [("Compare_operations", Qcheck2_helpers.qcheck_wrap tests)] diff --git a/src/proto_alpha/lib_protocol/test/pbt/test_dal_slot_proof.ml b/src/proto_alpha/lib_protocol/test/pbt/test_dal_slot_proof.ml index 8072df01b76c..5b47374a0687 100644 --- a/src/proto_alpha/lib_protocol/test/pbt/test_dal_slot_proof.ml +++ b/src/proto_alpha/lib_protocol/test/pbt/test_dal_slot_proof.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: PBT for refutation proofs of Dal - Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe \ + -- --file test_dal_slot_proof.ml Subject: Refutation proof-related functions of Dal *) diff --git a/src/proto_alpha/lib_protocol/test/pbt/test_gas_properties.ml b/src/proto_alpha/lib_protocol/test/pbt/test_gas_properties.ml index ca9d505ab698..53e28d23bf7b 100644 --- a/src/proto_alpha/lib_protocol/test/pbt/test_gas_properties.ml +++ b/src/proto_alpha/lib_protocol/test/pbt/test_gas_properties.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (gas properties) - Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe \ + -- --file test_gas_properties.ml Subject: Arithmetic properties around gas. *) @@ -140,7 +141,4 @@ let tests = ] let () = - Alcotest.run - ~__FILE__ - "protocol > pbt > gas" - [(Protocol.name ^ ": gas properties", qcheck_wrap tests)] + Alcotest.run ~__FILE__ Protocol.name [("gas properties", qcheck_wrap tests)] diff --git a/src/proto_alpha/lib_protocol/test/pbt/test_merkle_list.ml b/src/proto_alpha/lib_protocol/test/pbt/test_merkle_list.ml index 56c824bd1ca6..7be5c740903d 100644 --- a/src/proto_alpha/lib_protocol/test/pbt/test_merkle_list.ml +++ b/src/proto_alpha/lib_protocol/test/pbt/test_merkle_list.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol Library - Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe \ + -- --file test_merkle_list.ml Subject: Tx rollup l2 encoding *) @@ -111,15 +112,15 @@ let () = let qcheck_wrap = qcheck_wrap ~rand:(Random.State.make_self_init ()) in Alcotest.run ~__FILE__ - "Merkle list" + Protocol.name [ - ( Protocol.name ^ ": scons_equiv", + ( "scons_equiv", qcheck_wrap [ test_scons_scons_tr_equiv ~count:1000; test_scons_compute_equiv ~count:1000; ] ); - ( Protocol.name ^ ": check_path", + ( "check_path", qcheck_wrap [test_check_path ~count:1000; test_check_path_wrong ~count:1000] ); ] diff --git a/src/proto_alpha/lib_protocol/test/pbt/test_operation_encoding.ml b/src/proto_alpha/lib_protocol/test/pbt/test_operation_encoding.ml index 08bd36fcfcea..b08de8c3ded9 100644 --- a/src/proto_alpha/lib_protocol/test/pbt/test_operation_encoding.ml +++ b/src/proto_alpha/lib_protocol/test/pbt/test_operation_encoding.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol Library - Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe \ + -- --file test_operation_encoding.ml Subject: Encoding for operations *) @@ -62,5 +63,5 @@ let () = let qcheck_wrap = qcheck_wrap ~rand:(Random.State.make_self_init ()) in Alcotest.run ~__FILE__ - "Operation_encoding" - [(Protocol.name ^ ": roundtrip", qcheck_wrap [test_operation])] + (Protocol.name ^ ": Operation_encoding") + [(": roundtrip", qcheck_wrap [test_operation])] diff --git a/src/proto_alpha/lib_protocol/test/pbt/test_refutation_game.ml b/src/proto_alpha/lib_protocol/test/pbt/test_refutation_game.ml index 7f0a6b92c670..1dd2c12b1d5b 100644 --- a/src/proto_alpha/lib_protocol/test/pbt/test_refutation_game.ml +++ b/src/proto_alpha/lib_protocol/test/pbt/test_refutation_game.ml @@ -27,7 +27,8 @@ (** Testing ------- Component: PBT for the SCORU refutation game - Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe \ + -- --file test_refutation_game.ml Subject: SCORU refutation game *) open Protocol diff --git a/src/proto_alpha/lib_protocol/test/pbt/test_sampler.ml b/src/proto_alpha/lib_protocol/test/pbt/test_sampler.ml index e1c507d1f5dd..e2bd8547d4b0 100644 --- a/src/proto_alpha/lib_protocol/test/pbt/test_sampler.ml +++ b/src/proto_alpha/lib_protocol/test/pbt/test_sampler.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol Library - Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe \ + -- --file test_sampler.ml Subject: Operations in Saturation_repr *) @@ -266,8 +267,5 @@ let alias_z_test = let () = Alcotest.run ~__FILE__ - "protocol > pbt > sampling" - [ - ( Protocol.name ^ ": sampling", - qcheck_wrap [alias_float_test; alias_z_test] ); - ] + Protocol.name + [("sampling", qcheck_wrap [alias_float_test; alias_z_test])] diff --git a/src/proto_alpha/lib_protocol/test/pbt/test_sc_rollup_encoding.ml b/src/proto_alpha/lib_protocol/test/pbt/test_sc_rollup_encoding.ml index 51f7d0f32046..480090e0fe59 100644 --- a/src/proto_alpha/lib_protocol/test/pbt/test_sc_rollup_encoding.ml +++ b/src/proto_alpha/lib_protocol/test/pbt/test_sc_rollup_encoding.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol Library - Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe \ + -- --file test_sc_rollup_encoding.ml Subject: SC rollup encoding *) @@ -292,5 +293,5 @@ let tests = let () = Alcotest.run ~__FILE__ - "SC rollup encoding" - [(Protocol.name ^ ": roundtrip", qcheck_wrap tests)] + (Protocol.name ^ ": SC rollup encoding") + [(": roundtrip", qcheck_wrap tests)] diff --git a/src/proto_alpha/lib_protocol/test/pbt/test_sc_rollup_inbox.ml b/src/proto_alpha/lib_protocol/test/pbt/test_sc_rollup_inbox.ml index 58f36f75288b..d35400e4bed5 100644 --- a/src/proto_alpha/lib_protocol/test/pbt/test_sc_rollup_inbox.ml +++ b/src/proto_alpha/lib_protocol/test/pbt/test_sc_rollup_inbox.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol Library - Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe \ + -- --file test_sc_rollup_inbox.ml Subject: Smart rollup inbox *) @@ -73,8 +74,4 @@ let test_add_info_per_level = let tests = [test_add_info_per_level] -let () = - Alcotest.run - ~__FILE__ - "Smart rollup inbox" - [(Protocol.name ^ ": safety", qcheck_wrap tests)] +let () = Alcotest.run ~__FILE__ Protocol.name [("safety", qcheck_wrap tests)] diff --git a/src/proto_alpha/lib_protocol/test/pbt/test_sc_rollup_tick_repr.ml b/src/proto_alpha/lib_protocol/test/pbt/test_sc_rollup_tick_repr.ml index fd09d78ec0d9..e5114fa4f94d 100644 --- a/src/proto_alpha/lib_protocol/test/pbt/test_sc_rollup_tick_repr.ml +++ b/src/proto_alpha/lib_protocol/test/pbt/test_sc_rollup_tick_repr.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol Library - Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe \ + -- --file test_sc_rollup_tick_repr.ml Subject: Operations in Tick_repr *) @@ -105,5 +106,5 @@ let tests = let () = Alcotest.run ~__FILE__ - "Tick_repr" - [(Protocol.name ^ ": Tick_repr", Qcheck2_helpers.qcheck_wrap tests)] + Protocol.name + [("Tick_repr", Qcheck2_helpers.qcheck_wrap tests)] diff --git a/src/proto_alpha/lib_protocol/test/pbt/test_script_comparison.ml b/src/proto_alpha/lib_protocol/test/pbt/test_script_comparison.ml index 74c16fe5d08b..6319854c71c9 100644 --- a/src/proto_alpha/lib_protocol/test/pbt/test_script_comparison.ml +++ b/src/proto_alpha/lib_protocol/test/pbt/test_script_comparison.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Script_comparison - Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe \ + -- --file test_script_comparison.ml Subject: PBT of the Script_comparable.compare_comparable function. *) @@ -343,14 +344,12 @@ let test_pack_unpack = let () = Alcotest.run ~__FILE__ - "protocol > pbt > script_comparison" + Protocol.name [ - ( Protocol.name ^ ": compatible_with_reference", - qcheck_wrap [test_compatible_with_reference] ); - ( Protocol.name ^ ": compatible_with_packing", - qcheck_wrap [test_compatible_with_packing] ); - (Protocol.name ^ ": reflexivity", qcheck_wrap [test_reflexivity]); - (Protocol.name ^ ": symmetry", qcheck_wrap [test_symmetry]); - (Protocol.name ^ ": transitivity", qcheck_wrap [test_transitivity]); - (Protocol.name ^ ": pack_unpack", qcheck_wrap [test_pack_unpack]); + ("compatible_with_reference", qcheck_wrap [test_compatible_with_reference]); + ("compatible_with_packing", qcheck_wrap [test_compatible_with_packing]); + ("reflexivity", qcheck_wrap [test_reflexivity]); + ("symmetry", qcheck_wrap [test_symmetry]); + ("transitivity", qcheck_wrap [test_transitivity]); + ("pack_unpack", qcheck_wrap [test_pack_unpack]); ] diff --git a/src/proto_alpha/lib_protocol/test/pbt/test_tez_repr.ml b/src/proto_alpha/lib_protocol/test/pbt/test_tez_repr.ml index 167d79de53e3..fa4ccce2b73c 100644 --- a/src/proto_alpha/lib_protocol/test/pbt/test_tez_repr.ml +++ b/src/proto_alpha/lib_protocol/test/pbt/test_tez_repr.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol Library - Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe \ + -- --file test_tez_repr.ml Subject: Operations in Tez_repr *) @@ -132,5 +133,5 @@ let tests = let () = Alcotest.run ~__FILE__ - "protocol > pbt > tez_repr" - [(Protocol.name ^ ": Tez_repr", Qcheck2_helpers.qcheck_wrap tests)] + Protocol.name + [("Tez_repr", Qcheck2_helpers.qcheck_wrap tests)] diff --git a/src/proto_alpha/lib_protocol/test/pbt/test_zk_rollup_encoding.ml b/src/proto_alpha/lib_protocol/test/pbt/test_zk_rollup_encoding.ml index 8db8cd119c4c..cc9b20635e1a 100644 --- a/src/proto_alpha/lib_protocol/test/pbt/test_zk_rollup_encoding.ml +++ b/src/proto_alpha/lib_protocol/test/pbt/test_zk_rollup_encoding.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol Library - Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/pbt/main.exe \ + -- --file test_zk_rollup_encoding.ml Subject: Zk rollup encodings *) @@ -222,8 +223,8 @@ let tests_to_scalar = [test_address_to_scalar; test_operation_to_scalar] let () = Alcotest.run ~__FILE__ - "ZK rollup encoding" + (Protocol.name ^ ": ZK rollup encoding") [ - (Protocol.name ^ ": roundtrip", qcheck_wrap tests_roundtrip); - (Protocol.name ^ ": to_scalar", qcheck_wrap tests_to_scalar); + (": roundtrip", qcheck_wrap tests_roundtrip); + (": to_scalar", qcheck_wrap tests_to_scalar); ] -- GitLab From 06ce23e9f2801ffe3d44ed5e7493495bd1c03897 Mon Sep 17 00:00:00 2001 From: lykimq Date: Fri, 7 Apr 2023 17:00:56 +0200 Subject: [PATCH 8/8] Alcotezt-UX: fix invocation headers, opt. titles for [unit] in all protocols --- manifest/main.ml | 1 - .../lib_protocol/test/unit/dune | 1 - .../test/unit/test_alpha_context.ml | 7 +- .../test/unit/test_bond_id_repr.ml | 7 +- .../test/unit/test_consensus_key.ml | 7 +- .../test/unit/test_contract_repr.ml | 7 +- .../test/unit/test_dal_slot_proof.ml | 7 +- .../test/unit/test_destination_repr.ml | 7 +- .../lib_protocol/test/unit/test_fitness.ml | 6 +- .../test/unit/test_fixed_point.ml | 7 +- .../lib_protocol/test/unit/test_gas_monad.ml | 21 +++--- .../unit/test_global_constants_storage.ml | 7 +- .../test/unit/test_level_module.ml | 7 +- .../test/unit/test_liquidity_baking_repr.ml | 36 +++++----- .../test/unit/test_local_contexts.ml | 7 +- .../lib_protocol/test/unit/test_main.ml | 66 ------------------- .../test/unit/test_merkle_list.ml | 34 +++++----- .../test/unit/test_operation_repr.ml | 7 +- .../lib_protocol/test/unit/test_qty.ml | 6 +- .../test/unit/test_raw_level_repr.ml | 7 +- .../lib_protocol/test/unit/test_receipt.ml | 7 +- .../lib_protocol/test/unit/test_round_repr.ml | 12 ++-- .../lib_protocol/test/unit/test_saturation.ml | 7 +- .../test/unit/test_sc_rollup_arith.ml | 7 +- .../test/unit/test_sc_rollup_game.ml | 17 +++-- .../test/unit/test_sc_rollup_inbox.ml | 7 +- .../test/unit/test_sc_rollup_inbox_legacy.ml | 2 +- .../test_sc_rollup_management_protocol.ml | 10 ++- .../test/unit/test_sc_rollup_storage.ml | 9 ++- .../test/unit/test_sc_rollup_wasm.ml | 9 ++- .../test/unit/test_skip_list_repr.ml | 7 +- .../lib_protocol/test/unit/test_tez_repr.ml | 7 +- .../lib_protocol/test/unit/test_time_repr.ml | 6 +- .../test/unit/test_tx_rollup_l2.ml | 14 ++-- .../test/unit/test_tx_rollup_l2_apply.ml | 27 ++++---- .../test/unit/test_zk_rollup_storage.ml | 12 ++-- .../lib_protocol/test/unit/dune | 1 - .../test/unit/test_alpha_context.ml | 8 ++- .../test/unit/test_bond_id_repr.ml | 8 ++- .../test/unit/test_consensus_key.ml | 8 ++- .../test/unit/test_contract_repr.ml | 7 +- .../test/unit/test_dal_slot_proof.ml | 8 ++- .../test/unit/test_destination_repr.ml | 8 ++- .../lib_protocol/test/unit/test_fitness.ml | 7 +- .../test/unit/test_fixed_point.ml | 8 ++- .../lib_protocol/test/unit/test_gas_monad.ml | 22 ++++--- .../unit/test_global_constants_storage.ml | 11 +++- .../test/unit/test_level_module.ml | 8 ++- .../test/unit/test_liquidity_baking_repr.ml | 37 +++++------ .../test/unit/test_local_contexts.ml | 7 +- .../lib_protocol/test/unit/test_main.ml | 62 ----------------- .../test/unit/test_merkle_list.ml | 35 +++++----- .../test/unit/test_operation_repr.ml | 7 +- .../lib_protocol/test/unit/test_qty.ml | 7 +- .../test/unit/test_raw_level_repr.ml | 8 ++- .../lib_protocol/test/unit/test_receipt.ml | 7 +- .../lib_protocol/test/unit/test_round_repr.ml | 13 ++-- .../lib_protocol/test/unit/test_saturation.ml | 8 ++- .../test/unit/test_sc_rollup_arith.ml | 8 ++- .../test/unit/test_sc_rollup_game.ml | 18 ++--- .../test/unit/test_sc_rollup_inbox.ml | 8 ++- .../test/unit/test_sc_rollup_inbox_legacy.ml | 3 +- .../test_sc_rollup_management_protocol.ml | 11 +++- .../test/unit/test_sc_rollup_storage.ml | 10 ++- .../test/unit/test_sc_rollup_wasm.ml | 13 ++-- .../test/unit/test_skip_list_repr.ml | 8 ++- .../lib_protocol/test/unit/test_tez_repr.ml | 7 +- .../lib_protocol/test/unit/test_time_repr.ml | 7 +- .../test/unit/test_zk_rollup_storage.ml | 15 +++-- src/proto_alpha/lib_protocol/test/unit/dune | 1 - .../test/unit/test_alpha_context.ml | 7 +- .../test/unit/test_bond_id_repr.ml | 7 +- .../test/unit/test_consensus_key.ml | 7 +- .../test/unit/test_contract_repr.ml | 7 +- .../test/unit/test_dal_slot_proof.ml | 7 +- .../test/unit/test_destination_repr.ml | 7 +- .../lib_protocol/test/unit/test_fitness.ml | 6 +- .../test/unit/test_fixed_point.ml | 7 +- .../lib_protocol/test/unit/test_gas_monad.ml | 21 +++--- .../unit/test_global_constants_storage.ml | 7 +- .../test/unit/test_level_module.ml | 7 +- .../test/unit/test_liquidity_baking_repr.ml | 36 +++++----- .../test/unit/test_local_contexts.ml | 7 +- .../lib_protocol/test/unit/test_main.ml | 62 ----------------- .../test/unit/test_merkle_list.ml | 34 +++++----- .../test/unit/test_operation_repr.ml | 7 +- .../lib_protocol/test/unit/test_qty.ml | 6 +- .../test/unit/test_raw_level_repr.ml | 7 +- .../lib_protocol/test/unit/test_receipt.ml | 6 +- .../lib_protocol/test/unit/test_round_repr.ml | 12 ++-- .../lib_protocol/test/unit/test_saturation.ml | 7 +- .../test/unit/test_sc_rollup_arith.ml | 7 +- .../test/unit/test_sc_rollup_game.ml | 17 +++-- .../test/unit/test_sc_rollup_inbox.ml | 7 +- .../test_sc_rollup_management_protocol.ml | 10 ++- .../test/unit/test_sc_rollup_storage.ml | 11 +++- .../test/unit/test_sc_rollup_wasm.ml | 11 +++- .../test/unit/test_skip_list_repr.ml | 7 +- .../lib_protocol/test/unit/test_tez_repr.ml | 7 +- .../lib_protocol/test/unit/test_time_repr.ml | 6 +- .../test/unit/test_zk_rollup_storage.ml | 14 ++-- 101 files changed, 688 insertions(+), 502 deletions(-) delete mode 100644 src/proto_016_PtMumbai/lib_protocol/test/unit/test_main.ml delete mode 100644 src/proto_017_PtNairob/lib_protocol/test/unit/test_main.ml delete mode 100644 src/proto_alpha/lib_protocol/test/unit/test_main.ml diff --git a/manifest/main.ml b/manifest/main.ml index d1a6ce6b716f..ae2e5718fbd6 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -4847,7 +4847,6 @@ end = struct let _unit = let modules = [ - ("test_main", true); ("test_bond_id_repr", true); ("test_consensus_key", true); ("test_contract_repr", true); diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/dune b/src/proto_016_PtMumbai/lib_protocol/test/unit/dune index 138dd6abfa79..ff995683c840 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/dune +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/dune @@ -43,7 +43,6 @@ -open Tezos_crypto_dal -open Tezos_webassembly_interpreter_extra) (modules - test_main test_bond_id_repr test_consensus_key test_contract_repr diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_alpha_context.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_alpha_context.ml index 7a3c059c5ff5..f144c6441969 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_alpha_context.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_alpha_context.ml @@ -29,7 +29,8 @@ open Alpha_context (** Testing ------- Component: Alpha_context - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe \ + -- --file test_alpha_context.ml Dependencies: helpers/block.ml Subject: To test the modules (including the top-level) in alpha_context.ml as individual units, particularly @@ -284,3 +285,7 @@ let tests = `Quick Test_Big_map.test_list_key_values_parameters; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("alpha context", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_bond_id_repr.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_bond_id_repr.ml index 8edf228bfd03..a29deb8fdc73 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_bond_id_repr.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_bond_id_repr.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Bond_id_repr - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe \ + -- --file test_bond_id_repr.ml Dependencies: -- Subject: Test bond id representations for RPC definitions. *) @@ -144,3 +145,7 @@ let tests = test_destruct_invalid_bond_id_repr; Tztest.tztest "Deserialize/serialize roundtrip" `Quick test_roundtrip; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("bond_id_repr", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_consensus_key.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_consensus_key.ml index f4ba78ac243b..7b348607a9cc 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_consensus_key.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_consensus_key.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (delegate_consensus_key) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe \ + -- --file test_consensus_key.ml Subject: Functions from the module `Delegate_consensus_key` *) @@ -237,3 +238,7 @@ let test_consensus_key_storage () = let tests = [Tztest.tztest "consensus_key_storage" `Quick test_consensus_key_storage] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("Delegate consensus key", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_contract_repr.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_contract_repr.ml index 54f24386c51d..87a85511b79b 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_contract_repr.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_contract_repr.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Contract_repr - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe \ + -- --file test_contract_repr.ml Dependencies: contract_hash.ml Subject: To test the modules (including the top-level) in contract_repr.ml as individual units, particularly @@ -118,3 +119,7 @@ let tests = `Quick Test_contract_repr.test_to_b58check_originated; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("Contract_repr", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_dal_slot_proof.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_dal_slot_proof.ml index dcb8f9a94dc2..12cd3ea2f5af 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_dal_slot_proof.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_dal_slot_proof.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (dal slot proof) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe \ + -- --file test_dal_slot_proof.ml Subject: These unit tests check proof-related functions of Dal slots. *) @@ -438,3 +439,7 @@ let tests = let dal_parameters = constants_test.dal end) in Test.tests + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("dal slot proof", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_destination_repr.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_destination_repr.ml index 201e9f42fb3d..b562b5298bea 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_destination_repr.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_destination_repr.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Destination_repr - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe \ + -- --file test_destination_repr.ml Subject: To test the encoding of [Destination_repr] and assert it is compatible with [Contract_repr.encoding]. *) @@ -222,3 +223,7 @@ let tests = @@ test_encoding_json_compat; tztest "Comparison of destinations" `Quick test_compare_destination; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("Destination_repr.ml", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_fitness.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_fitness.ml index 741d59239894..eb483e02e2a1 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_fitness.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_fitness.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (committee selection) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe \ + -- --file test_fitness.ml Subject: test the fitness module *) @@ -155,3 +156,6 @@ let tests = `Quick test_compare_all; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("fitness", tests)] |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_fixed_point.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_fixed_point.ml index 7821335eb10b..d9e47363088f 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_fixed_point.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_fixed_point.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (fixed-point decimals) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe \ + -- --file test_fixed_point.ml Subject: On fixed-point decimal numbers. *) @@ -172,3 +173,7 @@ let tests = Tztest.tztest "FP tests (3 decimals)" `Quick fp_nonzero; Tztest.tztest "FP pp tests (3 decimals)" `Quick fp_pp; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("fixed point computation", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_gas_monad.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_gas_monad.ml index bd364efbf41c..85debca835ce 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_gas_monad.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_gas_monad.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol Gas_monad - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe \ + -- --file test_gas_monad.ml Subject: Tests for the gas monad module *) @@ -195,20 +196,24 @@ let test_syntax_module () = let tests = [ - Tztest.tztest "Test exhaustion" `Quick test_gas_exhaustion; + Tztest.tztest "exhaustion" `Quick test_gas_exhaustion; Tztest.tztest - "Test exhaustion before error" + "exhaustion before error" `Quick test_gas_exhaustion_before_error; Tztest.tztest - "Test successful result with remaining gas" + "successful result with remaining gas" `Quick test_successful_with_remaining_gas; Tztest.tztest - "Test successful result with spare gas" + "successful result with spare gas" `Quick test_successful_with_spare_gas; - Tztest.tztest "Test inner error" `Quick test_inner_error; - Tztest.tztest "Test unlimited" `Quick test_unlimited; - Tztest.tztest "Test syntax module" `Quick test_syntax_module; + Tztest.tztest "inner error" `Quick test_inner_error; + Tztest.tztest "unlimited" `Quick test_unlimited; + Tztest.tztest "syntax module" `Quick test_syntax_module; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("gas monad", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_global_constants_storage.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_global_constants_storage.ml index 5cc39768875f..b757e712952e 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_global_constants_storage.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_global_constants_storage.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Global table of constants - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe \ + -- --file test_global_constants_storage.ml Dependencies: contract_hash.ml Subject: Test the global table of constants *) @@ -410,3 +411,7 @@ let tests = test_expand_is_idempotent; test_fold_does_not_stack_overflow; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("Global_constants_storage", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_level_module.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_level_module.ml index c44e81fe8779..1e7137347d42 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_level_module.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_level_module.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (baking) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe \ + -- --file test_level_module.ml Subject: some functions in the Level module *) @@ -276,3 +277,7 @@ let tests = Tztest.tztest "level_from_raw" `Quick test_level_from_raw; Tztest.tztest "first_level_in_cycle" `Quick test_first_level_in_cycle; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("level module", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_liquidity_baking_repr.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_liquidity_baking_repr.ml index ade13826dacd..70ab4d32682b 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_liquidity_baking_repr.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_liquidity_baking_repr.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol Liquidity_baking_repr module - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe \ + -- --file test_liquidity_baking_repr.ml Subject: Tests for the Liquidity_baking_repr module *) @@ -216,44 +217,39 @@ let test_ema_symmetry () = let tests = [ + Tztest.tztest "EMA does not change when vote is Pass" `Quick test_ema_pass; Tztest.tztest - "Test EMA does not change when vote is Pass" - `Quick - test_ema_pass; - Tztest.tztest - "Test EMA remains in bounds when vote is Off" + "EMA remains in bounds when vote is Off" `Quick test_ema_in_bound_off; + Tztest.tztest "EMA increases when vote is Off" `Quick test_ema_increases_off; Tztest.tztest - "Test EMA increases when vote is Off" - `Quick - test_ema_increases_off; - Tztest.tztest - "Test EMA does not increase too much when vote is Off" + "EMA does not increase too much when vote is Off" `Quick test_ema_increases_off_bound; Tztest.tztest - "Test EMA remains in bounds when vote is On" + "EMA remains in bounds when vote is On" `Quick test_ema_in_bound_on; + Tztest.tztest "EMA decreases when vote is On" `Quick test_ema_decreases_on; Tztest.tztest - "Test EMA decreases when vote is On" - `Quick - test_ema_decreases_on; - Tztest.tztest - "Test EMA does not decrease too much when vote is On" + "EMA does not decrease too much when vote is On" `Quick test_ema_decreases_on_bound; Tztest.tztest - "Test EMA goes from 0 to one billion in 1386 Off votes" + "EMA goes from 0 to one billion in 1386 Off votes" `Quick test_ema_many_off; Tztest.tztest - "Test EMA goes from two billions to one billion in 1386 On votes" + "EMA goes from two billions to one billion in 1386 On votes" `Quick test_ema_many_on; Tztest.tztest - "Test that voting On and Off have symmetric effects on the EMA" + "voting On and Off have symmetric effects on the EMA" `Quick test_ema_symmetry; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("liquidity baking", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_local_contexts.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_local_contexts.ml index 28e3b876ee22..197e0bb6e1d2 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_local_contexts.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_local_contexts.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Local context storages by functors - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe \ + -- --file test_local_contexts.ml Dependencies: helpers/block.ml Subject: Tests for local contexts @@ -132,3 +133,7 @@ let tests = `Quick test_local_remove_existing; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("local_contexts", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_main.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_main.ml deleted file mode 100644 index 90b3ac74143c..000000000000 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_main.ml +++ /dev/null @@ -1,66 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2022 Marigold *) -(* Copyright (c) 2022 Nomadic Labs *) -(* Copyright (c) 2022 Oxhead Alpha *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -let () = - Alcotest_lwt.run - ~__FILE__ - (Protocol.name ^ " > unit") - [ - ("Tez_repr.ml", Test_tez_repr.tests); - ("Contract_repr.ml", Test_contract_repr.tests); - ("Destination_repr.ml", Test_destination_repr.tests); - ("Operation_repr.ml", Test_operation_repr.tests); - ( Protocol.name ^ ": Global_constants_storage.ml", - Test_global_constants_storage.tests ); - ("fitness", Test_fitness.tests); - ("fixed point computation", Test_fixed_point.tests); - ("level module", Test_level_module.tests); - ("qty", Test_qty.tests); - ("round", Test_round_repr.tests); - ("time", Test_time_repr.tests); - ("receipt encodings", Test_receipt.tests); - ("saturation arithmetic", Test_saturation.tests); - ("gas monad", Test_gas_monad.tests); - ("sc rollup storage", Test_sc_rollup_storage.tests); - ("sc rollup game", Test_sc_rollup_game.tests); - ("tx rollup l2", Test_tx_rollup_l2.tests); - ("tx rollup l2 apply", Test_tx_rollup_l2_apply.tests); - ("liquidity baking", Test_liquidity_baking_repr.tests); - ("sc rollup wasm", Test_sc_rollup_wasm.tests); - ("sc rollup arith", Test_sc_rollup_arith.tests); - ("merkle list", Test_merkle_list.tests); - ("sc rollup inbox", Test_sc_rollup_inbox.tests); - ("skip list", Test_skip_list_repr.tests); - ( Protocol.name ^ ": sc rollup management protocol", - Test_sc_rollup_management_protocol.tests ); - ("Bond_id_repr.ml", Test_bond_id_repr.tests); - ("zk rollup storage", Test_zk_rollup_storage.tests); - ("Delegate_consensus_key.ml", Test_consensus_key.tests); - ("local_contexts", Test_local_contexts.tests); - ("dal slot proof", Test_dal_slot_proof.tests); - ] - |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_merkle_list.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_merkle_list.ml index 246998c19d26..c0c1f7b97ca7 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_merkle_list.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_merkle_list.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (Merkle list) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe \ + -- --file test_merkle_list.ml Subject: test the ad-hoc merkle tree structure implemented to encode lists *) @@ -234,20 +235,19 @@ let test_path_encoding () = let valid_tests = [ - ("test_compute", test_compute); - ("test_snoc", test_snoc); - ("test_snoc_non_tr", test_snoc_non_tr); - ("test_compute_path", test_compute_path); - ("test_check_path", test_check_path); - ("test_path_encoding", test_path_encoding); - ("test_compute_path_negative_pos", test_compute_path_negative_pos); - ("test_compute_path_out_of_bounds", test_compute_path_out_of_bounds); - ("test_check_path_negative_pos", test_check_path_negative_pos); - ("test_check_path_out_of_bounds", test_check_path_out_of_bounds); - ( "test_compute_path_out_of_bounds_full", - test_compute_path_out_of_bounds_full ); - ("test_check_path_wrong_pos", test_check_path_wrong_pos); - ("test_check_invalidated_path", test_check_invalidated_path); + ("compute", test_compute); + ("snoc", test_snoc); + ("snoc_non_tr", test_snoc_non_tr); + ("compute_path", test_compute_path); + ("check_path", test_check_path); + ("path_encoding", test_path_encoding); + ("compute_path_negative_pos", test_compute_path_negative_pos); + ("compute_path_out_of_bounds", test_compute_path_out_of_bounds); + ("check_path_negative_pos", test_check_path_negative_pos); + ("check_path_out_of_bounds", test_check_path_out_of_bounds); + ("compute_path_out_of_bounds_full", test_compute_path_out_of_bounds_full); + ("check_path_wrong_pos", test_check_path_wrong_pos); + ("check_invalidated_path", test_check_invalidated_path); ] let wrap (n, f) = @@ -255,3 +255,7 @@ let wrap (n, f) = Lwt.return (f ()) >|= function Ok () -> () | Error _ -> assert false) let tests = List.map wrap valid_tests + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("merkle list", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_operation_repr.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_operation_repr.ml index 6dd387fda9a3..564e6f5c40e5 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_operation_repr.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_operation_repr.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Operation_repr - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe \ + -- --file test_operation_repr.ml Dependencies: -- Subject: To test the modules (including the top-level) in operation_repr.ml as individual units, particularly @@ -187,3 +188,7 @@ let tests = `Quick Test_operation_repr.test_multiple_non_manager; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("Operation_repr.ml", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_qty.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_qty.ml index cf87a90e266a..8dd0771421d6 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_qty.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_qty.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (quantities) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe \ + -- --file test_qty.ml Subject: On tez quantities. *) @@ -157,3 +158,6 @@ let wrap (n, f) = Format.kasprintf Stdlib.failwith "%a" pp_print_trace error) let tests = List.map wrap tests + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("qty", tests)] |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_raw_level_repr.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_raw_level_repr.ml index 2a5de4139bcd..195668eda1bb 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_raw_level_repr.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_raw_level_repr.ml @@ -29,7 +29,8 @@ open Tztest (** Testing ------- Component: Raw_level_repr - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe \ + -- --file test_raw_level_repr.ml Dependencies: -- Subject: To test the modules (including the top-level) in raw_level_repr.ml as individual units, particularly @@ -173,3 +174,7 @@ let skipped_tests = `Quick Test_raw_level_repr.test_skip_succ; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("raw_level_repr", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_receipt.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_receipt.ml index 8525b57be7ac..4ae9a47de3a2 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_receipt.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_receipt.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (token) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe \ + -- --file test_receipt.ml Subject: Test receipt endocings. *) @@ -99,3 +100,7 @@ let test_encodings () = test_encodings Sc_rollup_refutation_rewards let tests = Tztest.[tztest "receipt - encoding" `Quick test_encodings] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("receipt encodings", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_round_repr.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_round_repr.ml index 346dec1a1188..269485b416a5 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_round_repr.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_round_repr.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: protocol - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe \ + -- --file test_round_repr.ml Subject: test the Round_repr module *) @@ -616,13 +617,13 @@ let test_round_and_offset_correction = let tests = Tztest. [ - tztest "test_level_offset_of_round" `Quick test_level_offset_of_round; - tztest "test Round_duration" `Quick test_round; + tztest "level_offset_of_round" `Quick test_level_offset_of_round; + tztest "Round_duration" `Quick test_round; tztest "round_of_timestamp" `Quick test_round_of_timestamp; tztest "round_of_timestamp_perf" `Quick test_round_of_timestamp_perf; tztest "timestamp_of_round_perf" `Quick test_timestamp_of_round_perf; tztest - "test level offset too high error is triggered" + "level offset too high error is triggered" `Quick test_error_is_triggered_for_too_high_timestamp; tztest "round_of_ts (ts_of_round r) = r" `Quick test_ts_of_round_inverse; @@ -632,3 +633,6 @@ let tests = test_round_of_ts_inverse; test_round_and_offset_correction; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("round", tests)] |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_saturation.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_saturation.ml index 7eea6d69787d..67e8e32f89a4 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_saturation.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_saturation.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (saturated arithmetic) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe \ + -- --file test_saturation.ml Subject: The gas is represented using saturated arithmetic. These unit tests check that saturated arithmetic operations are correctly implemented. @@ -233,3 +234,7 @@ let tests = `Quick (encoding Saturation_repr.n_encoding); ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("saturation arithmetic", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_arith.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_arith.ml index f5cfa5d17c31..e21863793861 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_arith.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_arith.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (saturated arithmetic) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe \ + -- --file test_sc_rollup_arith.ml Subject: Basic testing of the arithmetic rollup example *) @@ -545,3 +546,7 @@ let tests = test_initial_state_hash_arith_pvm; Tztest.tztest "Filter internal message" `Quick test_filter_internal_message; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("sc rollup arith", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_game.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_game.ml index c4ca7ebc1dc3..b73ad8430618 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_game.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_game.ml @@ -27,7 +27,8 @@ (** Testing ------- Component: Protocol Sc_rollup_refutation_storage - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe \ + -- --file test_sc_rollup_game.ml Subject: Tests for the SCORU refutation game *) @@ -456,21 +457,23 @@ let tests = `Quick test_invalid_serialized_inbox_proof; Tztest.tztest - "Test to start a game with invalid commitment hash (swap commitment)." + "start a game with invalid commitment hash (swap commitment)." `Quick test_first_move_with_swapped_commitment; Tztest.tztest - "Test to start a game with invalid commitment hash (op from outsider)." + "start a game with invalid commitment hash (op from outsider)." `Quick test_first_move_from_invalid_player; Tztest.tztest - "Test to start a game with invalid commitment hash (opponent is not in \ - game)." + "start a game with invalid commitment hash (opponent is not in game)." `Quick test_first_move_with_invalid_opponent; Tztest.tztest - "Test to start a game with commitment hash that are not the first \ - conflict." + "start a game with commitment hash that are not the first conflict." `Quick test_first_move_with_invalid_ancestor; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("sc rollup game", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_inbox.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_inbox.ml index df8f73a55bb3..ae4a42bab062 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_inbox.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_inbox.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (smart contract rollup inbox) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe \ + -- --file test_sc_rollup_inbox.ml Subject: These unit tests check the off-line inbox implementation for smart contract rollups *) @@ -691,3 +692,7 @@ let inbox_tests = let tests = merkelized_payload_hashes_tests @ inbox_tests @ Test_sc_rollup_inbox_legacy.tests + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("sc rollup inbox", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_inbox_legacy.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_inbox_legacy.ml index 303df6dcaf03..acc485f02c49 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_inbox_legacy.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_inbox_legacy.ml @@ -26,7 +26,7 @@ (** Testing ------- Component: Protocol (smart contract rollup inbox) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe Subject: These unit tests check the off-line inbox implementation for smart contract rollups *) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_management_protocol.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_management_protocol.ml index 424bcd1c12e8..6711bd7c418d 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_management_protocol.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_management_protocol.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (Rollup Management Protocol) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe \ + -- --file test_sc_rollup_management_protocol.ml Subject: Sanity checks for the Rollup Management Protocol module. *) @@ -341,3 +342,10 @@ let tests = `Quick test_encode_decode_outbox_message; ] + +let () = + Alcotest_lwt.run + ~__FILE__ + Protocol.name + [("sc rollup management protocol", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_storage.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_storage.ml index 303c86d3f860..d1cb0c38ebe9 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_storage.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_storage.ml @@ -27,7 +27,8 @@ (** Testing ------- Component: Protocol Sc_rollup_storage - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe \ + -- --file test_sc_rollup_storage.ml Subject: Tests for the SCORU storage module *) @@ -2871,7 +2872,7 @@ module Stake_storage_tests = struct `Quick test_unrelated_commitments; Tztest.tztest - "test fresh index is correcly incremented" + "fresh index is correcly incremented" `Quick test_fresh_index_correctly_increment; ] @@ -2925,3 +2926,7 @@ let tests = Stake_storage_tests.tests @ Rollup_storage_tests.tests (* FIXME: https://gitlab.com/tezos/tezos/-/issues/2460 Further tests to be added. *) + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("sc rollup storage", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_wasm.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_wasm.ml index 3dd715464ec9..837e3a4fa938 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_wasm.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_sc_rollup_wasm.ml @@ -27,7 +27,8 @@ (** Testing ------- Component: Rollup layer 1 logic - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe \ + -- --file test_sc_rollup_wasm.ml Subject: Unit test for the Wasm PVM *) @@ -311,5 +312,9 @@ let tests = test_initial_state_hash_wasm_pvm; Tztest.tztest "size of a rollup metadata" `Quick test_metadata_size; Tztest.tztest "l1 input kind" `Quick test_l1_input_kind; - Tztest.tztest "test output proofs" `Quick test_output; + Tztest.tztest "output proofs" `Quick test_output; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("sc rollup wasm", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_skip_list_repr.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_skip_list_repr.ml index 9b6a18f946fb..ab1bc76ff76f 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_skip_list_repr.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_skip_list_repr.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (skip lists) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe \ + -- --file test_skip_list_repr.ml Subject: Test skip list implementation *) @@ -674,3 +675,7 @@ let tests = `Quick test_skip_list_proof_size; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("skip list", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_tez_repr.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_tez_repr.ml index a013acf4a566..3424a5fa72cc 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_tez_repr.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_tez_repr.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Tez_repr - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe \ + -- --file test_tez_repr.ml Dependencies: -- Subject: To test the modules (including the top-level) in tez_repr.ml as individual units, particularly @@ -196,3 +197,7 @@ let tests = `Quick Test_tez_repr.test_data_encoding; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("Tez_repr.ml", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_time_repr.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_time_repr.ml index a1cc50d3d0d9..ac998637c863 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_time_repr.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_time_repr.ml @@ -1,7 +1,8 @@ (** Testing ------- Component: Protocol (time repr) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe \ + -- --file test_time_repr.ml Subject: Error handling of time operations *) @@ -42,3 +43,6 @@ let tests = Tztest.tztest "non-overflowing addition" `Quick test_nominal_add; Tztest.tztest "overflowing addition" `Quick test_overflow_add; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("time", tests)] |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_tx_rollup_l2.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_tx_rollup_l2.ml index a76115613b59..91544172784d 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_tx_rollup_l2.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_tx_rollup_l2.ml @@ -28,7 +28,8 @@ (** Testing ------- Component: Protocol (tx rollup l2) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe \ + -- --file test_tx_rollup_l2.ml Subject: test the layer-2 implementation of transaction rollup *) @@ -560,12 +561,7 @@ module Test_batch_encodings = struct return_unit let tests = - [ - tztest - "test layer-2 transaction encoding size" - `Quick - test_l2_transaction_size; - ] + [tztest "layer-2 transaction encoding size" `Quick test_l2_transaction_size] end let tests = @@ -573,3 +569,7 @@ let tests = @ Test_Address_index.tests @ Test_Ticket_index.tests @ Test_Address_medata.tests @ Test_Ticket_ledger.tests @ Test_batch_encodings.tests + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("tx rollup l2", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_tx_rollup_l2_apply.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_tx_rollup_l2_apply.ml index 528df6b0789c..24107b2d187b 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_tx_rollup_l2_apply.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_tx_rollup_l2_apply.ml @@ -28,7 +28,8 @@ (** Testing ------- Component: Protocol (tx rollup l2) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe \ + -- --file test_tx_rollup_l2_apply.ml Subject: test the layer-2 apply implementation of transaction rollup *) @@ -1762,20 +1763,20 @@ let tests = ([ ("simple transaction", test_simple_deposit); ("returned transaction", test_returned_deposit); - ("test simple l1 transaction", test_simple_l1_transaction); - ( "test simple l1 transaction: inexistant ticket", + ("simple l1 transaction", test_simple_l1_transaction); + ( "simple l1 transaction: inexistant ticket", test_l1_transaction_inexistant_ticket ); - ( "test simple l1 transaction: inexistant signer", + ( "simple l1 transaction: inexistant signer", test_l1_transaction_inexistant_signer ); - ("test simple l1 transaction: overdraft", test_l1_transaction_overdraft); - ("test simple l1 transaction: zero", test_l1_transaction_zero); - ("test simple l1 transaction: partial", test_l1_transaction_partial); - ("test simple l2 transaction", test_simple_l2_transaction); - ( "test l2 transaction with l2 addr: good", + ("simple l1 transaction: overdraft", test_l1_transaction_overdraft); + ("simple l1 transaction: zero", test_l1_transaction_zero); + ("simple l1 transaction: partial", test_l1_transaction_partial); + ("simple l2 transaction", test_simple_l2_transaction); + ( "l2 transaction with l2 addr: good", test_l2_transaction_l2_addr_signer_good ); ( "test l2 transaction with l2 addr: bad", test_l2_transaction_l2_addr_signer_bad ); - ( "test simple transaction with indexes and values", + ( "simple transaction with indexes and values", test_transaction_with_unknown_indexable ); ("invalid transaction", test_invalid_transaction); ("invalid counter", test_invalid_counter); @@ -1786,7 +1787,7 @@ let tests = test_apply_message_batch_withdrawals ); ("apply deposit from message", test_apply_message_deposit); ("apply unparseable message", test_apply_message_unparsable); - ("test transfer to self fail", test_transfer_to_self); + ("transfer to self fail", test_transfer_to_self); ( "nb withdrawals per batch below limit", nb_withdrawals_per_batch_below_limit ); ( "nb withdrawals per batch equals limit", @@ -1795,3 +1796,7 @@ let tests = nb_withdrawals_per_batch_above_limit ); ] @ Indexes.tests) + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("tx rollup l2 apply", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_zk_rollup_storage.ml b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_zk_rollup_storage.ml index 98afba3634ab..8302047acef1 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_zk_rollup_storage.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_zk_rollup_storage.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (Zk_rollup) - Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_016_PtMumbai/lib_protocol/test/unit/main.exe \ + -- --file test_zk_rollup_storage.ml Subject: On ZK Rollup storage *) @@ -389,8 +390,9 @@ let tests = `Quick Raw_context_tests.pending_list_errors; Tztest.tztest "test_update" `Quick Raw_context_tests.test_update; - Tztest.tztest - "test_update errors" - `Quick - Raw_context_tests.test_update_errors; + Tztest.tztest "update errors" `Quick Raw_context_tests.test_update_errors; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("zk rollup storage", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/unit/dune b/src/proto_017_PtNairob/lib_protocol/test/unit/dune index 738d17f237a7..b509ba76ebf6 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/unit/dune +++ b/src/proto_017_PtNairob/lib_protocol/test/unit/dune @@ -43,7 +43,6 @@ -open Tezos_crypto_dal -open Tezos_webassembly_interpreter_extra) (modules - test_main test_bond_id_repr test_consensus_key test_contract_repr diff --git a/src/proto_017_PtNairob/lib_protocol/test/unit/test_alpha_context.ml b/src/proto_017_PtNairob/lib_protocol/test/unit/test_alpha_context.ml index 77cda1e31232..16e5f15b5432 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/unit/test_alpha_context.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/unit/test_alpha_context.ml @@ -29,8 +29,8 @@ open Alpha_context (** Testing ------- Component: Alpha_context - Invocation: dune exec ./src/proto_alpha/lib_protocol/test/unit/main.exe \ - -- test Alpha_context + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/unit/main.exe \ + -- --file test_alpha_context.ml Dependencies: helpers/block.ml Subject: To test the modules (including the top-level) in alpha_context.ml as individual units, particularly @@ -285,3 +285,7 @@ let tests = `Quick Test_Big_map.test_list_key_values_parameters; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("alpha context", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/unit/test_bond_id_repr.ml b/src/proto_017_PtNairob/lib_protocol/test/unit/test_bond_id_repr.ml index e1dc6aa50e4b..cf0d549c71b5 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/unit/test_bond_id_repr.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/unit/test_bond_id_repr.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Bond_id_repr - Invocation: dune exec ./src/proto_alpha/lib_protocol/test/unit/main.exe \ - -- test Bond_id_repr + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/unit/main.exe \ + -- --file test_bond_id_repr.ml Dependencies: -- Subject: Test bond id representations for RPC definitions. *) @@ -112,3 +112,7 @@ let tests = test_destruct_invalid_bond_id_repr; Tztest.tztest "Deserialize/serialize roundtrip" `Quick test_roundtrip; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("Bond_id_repr.ml", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/unit/test_consensus_key.ml b/src/proto_017_PtNairob/lib_protocol/test/unit/test_consensus_key.ml index 1b3c2b7cdbbc..e5035303e543 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/unit/test_consensus_key.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/unit/test_consensus_key.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Protocol (delegate_consensus_key) - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ - -- test "^\[Unit\] Delegate_consensus_key.ml" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/unit/main.exe \ + -- --file test_consensus_key.ml Subject: Functions from the module `Delegate_consensus_key` *) @@ -238,3 +238,7 @@ let test_consensus_key_storage () = let tests = [Tztest.tztest "consensus_key_storage" `Quick test_consensus_key_storage] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("Delegate consensus key", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/unit/test_contract_repr.ml b/src/proto_017_PtNairob/lib_protocol/test/unit/test_contract_repr.ml index 1f7f33a7cfa6..accd616ea54d 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/unit/test_contract_repr.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/unit/test_contract_repr.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Contract_repr - Invocation: dune exec ./src/proto_alpha/lib_protocol/test/unit/main.exe -- test Contract_repr + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/unit/main.exe \ + -- --file test_contract_repr.ml Dependencies: contract_hash.ml Subject: To test the modules (including the top-level) in contract_repr.ml as individual units, particularly @@ -117,3 +118,7 @@ let tests = `Quick Test_contract_repr.test_to_b58check_originated; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("Contract_repr.ml", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/unit/test_dal_slot_proof.ml b/src/proto_017_PtNairob/lib_protocol/test/unit/test_dal_slot_proof.ml index a59b08c02d09..0a600135144a 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/unit/test_dal_slot_proof.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/unit/test_dal_slot_proof.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Protocol (dal slot proof) - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ - -- test "^\[Unit\] dal slot proof$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/unit/main.exe \ + -- --file test_dal_slot_proof.ml Subject: These unit tests check proof-related functions of Dal slots. *) @@ -439,3 +439,7 @@ let tests = let dal_parameters = constants_test.dal end) in Test.tests + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("dal slot proof", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/unit/test_destination_repr.ml b/src/proto_017_PtNairob/lib_protocol/test/unit/test_destination_repr.ml index b2cd843ba0d3..121d47df2495 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/unit/test_destination_repr.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/unit/test_destination_repr.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Destination_repr - Invocation: dune exec -- ./src/proto_alpha/lib_protocol/test/unit/main.exe \ - test Destination_repr + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/unit/main.exe \ + -- --file test_destination_repr.ml Subject: To test the encoding of [Destination_repr] and assert it is compatible with [Contract_repr.encoding]. *) @@ -223,3 +223,7 @@ let tests = @@ test_encoding_json_compat; tztest "Comparison of destinations" `Quick test_compare_destination; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("Destination_repr.ml", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/unit/test_fitness.ml b/src/proto_017_PtNairob/lib_protocol/test/unit/test_fitness.ml index 3afa3421d656..7254762a8aad 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/unit/test_fitness.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/unit/test_fitness.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Protocol (committee selection) - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ - -- test "^\[Unit\] fitness$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/unit/main.exe \ + -- --file test_fitness.ml Subject: test the fitness module *) @@ -156,3 +156,6 @@ let tests = `Quick test_compare_all; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("fitness", tests)] |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/unit/test_fixed_point.ml b/src/proto_017_PtNairob/lib_protocol/test/unit/test_fixed_point.ml index bd6c11d88fcb..2389060e3b97 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/unit/test_fixed_point.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/unit/test_fixed_point.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Protocol (fixed-point decimals) - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ - -- test "^\[Unit\] fixed point computation$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/unit/main.exe \ + -- --file test_fixed_point.ml Subject: On fixed-point decimal numbers. *) @@ -173,3 +173,7 @@ let tests = Tztest.tztest "FP tests (3 decimals)" `Quick fp_nonzero; Tztest.tztest "FP pp tests (3 decimals)" `Quick fp_pp; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("fixed point computation", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/unit/test_gas_monad.ml b/src/proto_017_PtNairob/lib_protocol/test/unit/test_gas_monad.ml index 33b47e66c4fb..6e4b8a287469 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/unit/test_gas_monad.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/unit/test_gas_monad.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Protocol Gas_monad - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ - -- test "^\[Unit\] gas monad$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/unit/main.exe \ + -- --file test_gas_monad.ml Subject: Tests for the gas monad module *) @@ -196,20 +196,24 @@ let test_syntax_module () = let tests = [ - Tztest.tztest "Test exhaustion" `Quick test_gas_exhaustion; + Tztest.tztest "exhaustion" `Quick test_gas_exhaustion; Tztest.tztest - "Test exhaustion before error" + "exhaustion before error" `Quick test_gas_exhaustion_before_error; Tztest.tztest - "Test successful result with remaining gas" + "successful result with remaining gas" `Quick test_successful_with_remaining_gas; Tztest.tztest - "Test successful result with spare gas" + "successful result with spare gas" `Quick test_successful_with_spare_gas; - Tztest.tztest "Test inner error" `Quick test_inner_error; - Tztest.tztest "Test unlimited" `Quick test_unlimited; - Tztest.tztest "Test syntax module" `Quick test_syntax_module; + Tztest.tztest "inner error" `Quick test_inner_error; + Tztest.tztest "unlimited" `Quick test_unlimited; + Tztest.tztest "syntax module" `Quick test_syntax_module; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("gas monad", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/unit/test_global_constants_storage.ml b/src/proto_017_PtNairob/lib_protocol/test/unit/test_global_constants_storage.ml index 8b340b229194..df77573030cb 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/unit/test_global_constants_storage.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/unit/test_global_constants_storage.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Global table of constants - Invocation: dune exec ./src/proto_alpha/lib_protocol/test/unit/main.exe \ - -- test Global_constants_storage + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/unit/main.exe \ + -- --file test_global_constants_storage.ml Dependencies: contract_hash.ml Subject: Test the global table of constants *) @@ -411,3 +411,10 @@ let tests = test_expand_is_idempotent; test_fold_does_not_stack_overflow; ] + +let () = + Alcotest_lwt.run + ~__FILE__ + Protocol.name + [("Global_constants_storage.ml", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/unit/test_level_module.ml b/src/proto_017_PtNairob/lib_protocol/test/unit/test_level_module.ml index 26493e672686..656e3e5eac8c 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/unit/test_level_module.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/unit/test_level_module.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Protocol (baking) - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ - -- test "^\[Unit\] level module$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/unit/main.exe \ + -- --file test_level_module.ml Subject: some functions in the Level module *) @@ -277,3 +277,7 @@ let tests = Tztest.tztest "level_from_raw" `Quick test_level_from_raw; Tztest.tztest "first_level_in_cycle" `Quick test_first_level_in_cycle; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("level module", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/unit/test_liquidity_baking_repr.ml b/src/proto_017_PtNairob/lib_protocol/test/unit/test_liquidity_baking_repr.ml index ac40fa0600e8..28d300e90ba2 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/unit/test_liquidity_baking_repr.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/unit/test_liquidity_baking_repr.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Protocol Liquidity_baking_repr module - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ - -- test "^\[Unit\] liquidity baking$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/unit/main.exe \ + -- --file test_liquidity_baking_repr.ml Subject: Tests for the Liquidity_baking_repr module *) @@ -217,44 +217,39 @@ let test_ema_symmetry () = let tests = [ + Tztest.tztest "EMA does not change when vote is Pass" `Quick test_ema_pass; Tztest.tztest - "Test EMA does not change when vote is Pass" - `Quick - test_ema_pass; - Tztest.tztest - "Test EMA remains in bounds when vote is Off" + "EMA remains in bounds when vote is Off" `Quick test_ema_in_bound_off; + Tztest.tztest "EMA increases when vote is Off" `Quick test_ema_increases_off; Tztest.tztest - "Test EMA increases when vote is Off" - `Quick - test_ema_increases_off; - Tztest.tztest - "Test EMA does not increase too much when vote is Off" + "EMA does not increase too much when vote is Off" `Quick test_ema_increases_off_bound; Tztest.tztest - "Test EMA remains in bounds when vote is On" + "EMA remains in bounds when vote is On" `Quick test_ema_in_bound_on; + Tztest.tztest "EMA decreases when vote is On" `Quick test_ema_decreases_on; Tztest.tztest - "Test EMA decreases when vote is On" - `Quick - test_ema_decreases_on; - Tztest.tztest - "Test EMA does not decrease too much when vote is On" + "EMA does not decrease too much when vote is On" `Quick test_ema_decreases_on_bound; Tztest.tztest - "Test EMA goes from 0 to one billion in 1386 Off votes" + "EMA goes from 0 to one billion in 1386 Off votes" `Quick test_ema_many_off; Tztest.tztest - "Test EMA goes from two billions to one billion in 1386 On votes" + "EMA goes from two billions to one billion in 1386 On votes" `Quick test_ema_many_on; Tztest.tztest - "Test that voting On and Off have symmetric effects on the EMA" + "voting On and Off have symmetric effects on the EMA" `Quick test_ema_symmetry; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("liquidity baking", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/unit/test_local_contexts.ml b/src/proto_017_PtNairob/lib_protocol/test/unit/test_local_contexts.ml index d620a1618398..031ac22d61f0 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/unit/test_local_contexts.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/unit/test_local_contexts.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Local context storages by functors - Invocation: dune exec ./src/proto_alpha/lib_protocol/test/unit/main.exe -- test local_contexts + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/unit/main.exe \ + -- --file test_local_contexts.ml Dependencies: helpers/block.ml Subject: Tests for local contexts @@ -132,3 +133,7 @@ let tests = `Quick test_local_remove_existing; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("local contexts", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/unit/test_main.ml b/src/proto_017_PtNairob/lib_protocol/test/unit/test_main.ml deleted file mode 100644 index da90172f15c3..000000000000 --- a/src/proto_017_PtNairob/lib_protocol/test/unit/test_main.ml +++ /dev/null @@ -1,62 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2022 Marigold *) -(* Copyright (c) 2022 Nomadic Labs *) -(* Copyright (c) 2022 Oxhead Alpha *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -let () = - Alcotest_lwt.run - ~__FILE__ - (Protocol.name ^ " > unit") - [ - ("Tez_repr.ml", Test_tez_repr.tests); - ("Contract_repr.ml", Test_contract_repr.tests); - ("Destination_repr.ml", Test_destination_repr.tests); - ("Operation_repr.ml", Test_operation_repr.tests); - ("Global_constants_storage.ml", Test_global_constants_storage.tests); - ("fitness", Test_fitness.tests); - ("fixed point computation", Test_fixed_point.tests); - ("level module", Test_level_module.tests); - ("qty", Test_qty.tests); - ("round", Test_round_repr.tests); - ("time", Test_time_repr.tests); - ("receipt encodings", Test_receipt.tests); - ("saturation arithmetic", Test_saturation.tests); - ("gas monad", Test_gas_monad.tests); - ("sc rollup storage", Test_sc_rollup_storage.tests); - ("sc rollup game", Test_sc_rollup_game.tests); - ("liquidity baking", Test_liquidity_baking_repr.tests); - ("sc rollup wasm", Test_sc_rollup_wasm.tests); - ("sc rollup arith", Test_sc_rollup_arith.tests); - ("merkle list", Test_merkle_list.tests); - ("sc rollup inbox", Test_sc_rollup_inbox.tests); - ("skip list", Test_skip_list_repr.tests); - ("sc rollup management protocol", Test_sc_rollup_management_protocol.tests); - ("Bond_id_repr.ml", Test_bond_id_repr.tests); - ("zk rollup storage", Test_zk_rollup_storage.tests); - ("Delegate_consensus_key.ml", Test_consensus_key.tests); - ("local_contexts", Test_local_contexts.tests); - ("dal slot proof", Test_dal_slot_proof.tests); - ] - |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/unit/test_merkle_list.ml b/src/proto_017_PtNairob/lib_protocol/test/unit/test_merkle_list.ml index e7aa2cabd398..231845907c9f 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/unit/test_merkle_list.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/unit/test_merkle_list.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Protocol (Merkle list) - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ - -- test "\[Unit\] merkle list" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/unit/main.exe \ + -- --file test_merkle_list.ml Subject: test the ad-hoc merkle tree structure implemented to encode lists *) @@ -235,20 +235,19 @@ let test_path_encoding () = let valid_tests = [ - ("test_compute", test_compute); - ("test_snoc", test_snoc); - ("test_snoc_non_tr", test_snoc_non_tr); - ("test_compute_path", test_compute_path); - ("test_check_path", test_check_path); - ("test_path_encoding", test_path_encoding); - ("test_compute_path_negative_pos", test_compute_path_negative_pos); - ("test_compute_path_out_of_bounds", test_compute_path_out_of_bounds); - ("test_check_path_negative_pos", test_check_path_negative_pos); - ("test_check_path_out_of_bounds", test_check_path_out_of_bounds); - ( "test_compute_path_out_of_bounds_full", - test_compute_path_out_of_bounds_full ); - ("test_check_path_wrong_pos", test_check_path_wrong_pos); - ("test_check_invalidated_path", test_check_invalidated_path); + ("compute", test_compute); + ("snoc", test_snoc); + ("snoc_non_tr", test_snoc_non_tr); + ("compute_path", test_compute_path); + ("check_path", test_check_path); + ("path_encoding", test_path_encoding); + ("compute_path_negative_pos", test_compute_path_negative_pos); + ("compute_path_out_of_bounds", test_compute_path_out_of_bounds); + ("check_path_negative_pos", test_check_path_negative_pos); + ("check_path_out_of_bounds", test_check_path_out_of_bounds); + ("compute_path_out_of_bounds_full", test_compute_path_out_of_bounds_full); + ("check_path_wrong_pos", test_check_path_wrong_pos); + ("check_invalidated_path", test_check_invalidated_path); ] let wrap (n, f) = @@ -256,3 +255,7 @@ let wrap (n, f) = Lwt.return (f ()) >|= function Ok () -> () | Error _ -> assert false) let tests = List.map wrap valid_tests + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("merkle list", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/unit/test_operation_repr.ml b/src/proto_017_PtNairob/lib_protocol/test/unit/test_operation_repr.ml index 6d24160ecf3a..e3dd0f23227e 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/unit/test_operation_repr.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/unit/test_operation_repr.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Operation_repr - Invocation: dune exec ./src/proto_alpha/lib_protocol/test/unit/main.exe -- test Operation_repr + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/unit/main.exe \ + -- --file test_operation_repr.ml Dependencies: -- Subject: To test the modules (including the top-level) in operation_repr.ml as individual units, particularly @@ -182,3 +183,7 @@ let tests = `Quick Test_operation_repr.test_multiple_non_manager; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("Operation_repr.ml", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/unit/test_qty.ml b/src/proto_017_PtNairob/lib_protocol/test/unit/test_qty.ml index 847686adcef6..03381b187f85 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/unit/test_qty.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/unit/test_qty.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Protocol (quantities) - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ - -- test "^\[Unit\] qty$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/unit/main.exe \ + -- --file test_qty.ml Subject: On tez quantities. *) @@ -158,3 +158,6 @@ let wrap (n, f) = Format.kasprintf Stdlib.failwith "%a" pp_print_trace error) let tests = List.map wrap tests + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("qty", tests)] |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/unit/test_raw_level_repr.ml b/src/proto_017_PtNairob/lib_protocol/test/unit/test_raw_level_repr.ml index 4f12f21eba1d..881e45628f70 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/unit/test_raw_level_repr.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/unit/test_raw_level_repr.ml @@ -29,8 +29,8 @@ open Tztest (** Testing ------- Component: Raw_level_repr - Invocation: dune exec ./src/proto_alpha/lib_protocol/test/unit/main.exe \ - -- test '^\[Unit\] Raw_level_repr.ml$' + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/unit/main.exe \ + -- --file test_raw_level_repr.ml Dependencies: -- Subject: To test the modules (including the top-level) in raw_level_repr.ml as individual units, particularly @@ -174,3 +174,7 @@ let skipped_tests = `Quick Test_raw_level_repr.test_skip_succ; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("raw level repr", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/unit/test_receipt.ml b/src/proto_017_PtNairob/lib_protocol/test/unit/test_receipt.ml index 77290a3fd080..92ee499eac93 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/unit/test_receipt.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/unit/test_receipt.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Protocol (token) - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ - -- test "^\[Unit\] receipt" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/unit/main.exe \ + -- --file test_receipt.ml Subject: Test receipt endocings. *) @@ -92,3 +92,6 @@ let test_encodings () = test_encodings Sc_rollup_refutation_rewards let tests = Tztest.[tztest "receipt - encoding" `Quick test_encodings] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("receipt", tests)] |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/unit/test_round_repr.ml b/src/proto_017_PtNairob/lib_protocol/test/unit/test_round_repr.ml index 35f734798689..8e51b909422e 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/unit/test_round_repr.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/unit/test_round_repr.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: protocol - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ - -- test "^\[Unit\] round$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/unit/main.exe \ + -- --file test_round_repr.ml Subject: test the Round_repr module *) @@ -617,13 +617,13 @@ let test_round_and_offset_correction = let tests = Tztest. [ - tztest "test_level_offset_of_round" `Quick test_level_offset_of_round; - tztest "test Round_duration" `Quick test_round; + tztest "level_offset_of_round" `Quick test_level_offset_of_round; + tztest "Round_duration" `Quick test_round; tztest "round_of_timestamp" `Quick test_round_of_timestamp; tztest "round_of_timestamp_perf" `Quick test_round_of_timestamp_perf; tztest "timestamp_of_round_perf" `Quick test_timestamp_of_round_perf; tztest - "test level offset too high error is triggered" + "level offset too high error is triggered" `Quick test_error_is_triggered_for_too_high_timestamp; tztest "round_of_ts (ts_of_round r) = r" `Quick test_ts_of_round_inverse; @@ -633,3 +633,6 @@ let tests = test_round_of_ts_inverse; test_round_and_offset_correction; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("round", tests)] |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/unit/test_saturation.ml b/src/proto_017_PtNairob/lib_protocol/test/unit/test_saturation.ml index 0cf2633314ca..485ae471ff2e 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/unit/test_saturation.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/unit/test_saturation.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Protocol (saturated arithmetic) - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ - -- test "^\[Unit\] saturation arithmetic$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/unit/main.exe \ + -- --file test_saturation.ml Subject: The gas is represented using saturated arithmetic. These unit tests check that saturated arithmetic operations are correctly implemented. @@ -234,3 +234,7 @@ let tests = `Quick (encoding Saturation_repr.n_encoding); ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("saturation arithmetic", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/unit/test_sc_rollup_arith.ml b/src/proto_017_PtNairob/lib_protocol/test/unit/test_sc_rollup_arith.ml index 228f0cbd9c51..c127044ed5b7 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/unit/test_sc_rollup_arith.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/unit/test_sc_rollup_arith.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Protocol (saturated arithmetic) - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ - -- test "^\[Unit\] sc rollup arith$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/unit/main.exe \ + -- --file test_sc_rollup_arith.ml Subject: Basic testing of the arithmetic rollup example *) @@ -546,3 +546,7 @@ let tests = test_initial_state_hash_arith_pvm; Tztest.tztest "Filter internal message" `Quick test_filter_internal_message; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("sc rollup arith", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/unit/test_sc_rollup_game.ml b/src/proto_017_PtNairob/lib_protocol/test/unit/test_sc_rollup_game.ml index 60a47101379b..3ea7bfca50bb 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/unit/test_sc_rollup_game.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/unit/test_sc_rollup_game.ml @@ -27,8 +27,8 @@ (** Testing ------- Component: Protocol Sc_rollup_refutation_storage - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ - -- test "^\[Unit\] sc rollup game$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/unit/main.exe \ + -- --file test_sc_rollup_game.ml Subject: Tests for the SCORU refutation game *) @@ -460,21 +460,23 @@ let tests = `Quick test_invalid_serialized_inbox_proof; Tztest.tztest - "Test to start a game with invalid commitment hash (swap commitment)." + "start a game with invalid commitment hash (swap commitment)." `Quick test_first_move_with_swapped_commitment; Tztest.tztest - "Test to start a game with invalid commitment hash (op from outsider)." + "start a game with invalid commitment hash (op from outsider)." `Quick test_first_move_from_invalid_player; Tztest.tztest - "Test to start a game with invalid commitment hash (opponent is not in \ - game)." + "start a game with invalid commitment hash (opponent is not in game)." `Quick test_first_move_with_invalid_opponent; Tztest.tztest - "Test to start a game with commitment hash that are not the first \ - conflict." + "start a game with commitment hash that are not the first conflict." `Quick test_first_move_with_invalid_ancestor; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("sc rollup game", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/unit/test_sc_rollup_inbox.ml b/src/proto_017_PtNairob/lib_protocol/test/unit/test_sc_rollup_inbox.ml index 9070a2b6cfe1..67f76b89e633 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/unit/test_sc_rollup_inbox.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/unit/test_sc_rollup_inbox.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Protocol (smart contract rollup inbox) - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ - -- test "^\[Unit\] sc rollup inbox$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/unit/main.exe \ + -- --file test_sc_rollup_inbox.ml Subject: These unit tests check the off-line inbox implementation for smart contract rollups *) @@ -941,3 +941,7 @@ let inbox_tests = let tests = merkelized_payload_hashes_tests @ inbox_tests @ Test_sc_rollup_inbox_legacy.tests + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("sc rollup inbox", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/unit/test_sc_rollup_inbox_legacy.ml b/src/proto_017_PtNairob/lib_protocol/test/unit/test_sc_rollup_inbox_legacy.ml index 806254e26352..8cd4854e0d39 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/unit/test_sc_rollup_inbox_legacy.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/unit/test_sc_rollup_inbox_legacy.ml @@ -26,8 +26,7 @@ (** Testing ------- Component: Protocol (smart contract rollup inbox) - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ - -- test "^\[Unit\] sc rollup inbox legacy$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/unit/main.exe Subject: These unit tests check the off-line inbox implementation for smart contract rollups *) diff --git a/src/proto_017_PtNairob/lib_protocol/test/unit/test_sc_rollup_management_protocol.ml b/src/proto_017_PtNairob/lib_protocol/test/unit/test_sc_rollup_management_protocol.ml index 8ee5c014a803..bc859e1506d6 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/unit/test_sc_rollup_management_protocol.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/unit/test_sc_rollup_management_protocol.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Protocol (Rollup Management Protocol) - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ - -- test "^\[Unit\] sc rollup management protocol$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/unit/main.exe \ + -- --file test_sc_rollup_management_protocol.ml Subject: Sanity checks for the Rollup Management Protocol module. *) @@ -356,3 +356,10 @@ let tests = `Quick test_encode_decode_outbox_message; ] + +let () = + Alcotest_lwt.run + ~__FILE__ + Protocol.name + [("sc rollup management protocol", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/unit/test_sc_rollup_storage.ml b/src/proto_017_PtNairob/lib_protocol/test/unit/test_sc_rollup_storage.ml index be63aae8907a..eacf4255ec4b 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/unit/test_sc_rollup_storage.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/unit/test_sc_rollup_storage.ml @@ -27,8 +27,8 @@ (** Testing ------- Component: Protocol Sc_rollup_storage - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ - -- test "^\[Unit\] sc rollup storage$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/unit/main.exe \ + -- --file test_sc_rollup_storage.ml Subject: Tests for the SCORU storage module *) @@ -2744,7 +2744,7 @@ module Stake_storage_tests = struct `Quick test_unrelated_commitments; Tztest.tztest - "test fresh index is correcly incremented" + "fresh index is correcly incremented" `Quick test_fresh_index_correctly_increment; ] @@ -2798,3 +2798,7 @@ let tests = Stake_storage_tests.tests @ Rollup_storage_tests.tests (* FIXME: https://gitlab.com/tezos/tezos/-/issues/2460 Further tests to be added. *) + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("sc rollup storage", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/unit/test_sc_rollup_wasm.ml b/src/proto_017_PtNairob/lib_protocol/test/unit/test_sc_rollup_wasm.ml index 6c9e40c22830..6696e2e5b454 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/unit/test_sc_rollup_wasm.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/unit/test_sc_rollup_wasm.ml @@ -27,9 +27,8 @@ (** Testing ------- Component: Rollup layer 1 logic - Invocation: dune exec \ - src/proto_alpha/lib_protocol/test/unit/main.exe \ - -- test "^\[Unit\] sc rollup wasm$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/unit/main.exe \ + -- --file test_sc_rollup_wasm.ml Subject: Unit test for the Wasm PVM *) @@ -347,6 +346,10 @@ let tests = test_initial_state_hash_wasm_pvm; Tztest.tztest "size of a rollup metadata" `Quick test_metadata_size; Tztest.tztest "l1 input kind" `Quick test_l1_input_kind; - Tztest.tztest "test output proofs" `Quick test_output; - Tztest.tztest "test protocol names consistency" `Quick test_protocol_names; + Tztest.tztest "output proofs" `Quick test_output; + Tztest.tztest "protocol names consistency" `Quick test_protocol_names; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("sc rollup wasm", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/unit/test_skip_list_repr.ml b/src/proto_017_PtNairob/lib_protocol/test/unit/test_skip_list_repr.ml index 17f77ead34e4..b024b4b0b815 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/unit/test_skip_list_repr.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/unit/test_skip_list_repr.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Protocol (skip lists) - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ - -- test "^\[Unit\] skip list$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/unit/main.exe \ + -- --file test_skip_list_repr.ml Subject: Test skip list implementation *) @@ -675,3 +675,7 @@ let tests = `Quick test_skip_list_proof_size; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("skip list", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/unit/test_tez_repr.ml b/src/proto_017_PtNairob/lib_protocol/test/unit/test_tez_repr.ml index 8a9f65d675d3..c2de2f3a08d2 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/unit/test_tez_repr.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/unit/test_tez_repr.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Tez_repr - Invocation: dune exec ./src/proto_alpha/lib_protocol/test/unit/main.exe -- test Tez_repr + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/unit/main.exe \ + -- --file test_tez_repr.ml Dependencies: -- Subject: To test the modules (including the top-level) in tez_repr.ml as individual units, particularly @@ -196,3 +197,7 @@ let tests = `Quick Test_tez_repr.test_data_encoding; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("Tez_repr.ml", tests)] + |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/unit/test_time_repr.ml b/src/proto_017_PtNairob/lib_protocol/test/unit/test_time_repr.ml index 3eb21525727c..a8e48e306543 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/unit/test_time_repr.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/unit/test_time_repr.ml @@ -1,8 +1,8 @@ (** Testing ------- Component: Protocol (time repr) - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ - -- test "^\[Unit\] time$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/unit/main.exe \ + -- --file test_time_repr.ml Subject: Error handling of time operations *) @@ -43,3 +43,6 @@ let tests = Tztest.tztest "non-overflowing addition" `Quick test_nominal_add; Tztest.tztest "overflowing addition" `Quick test_overflow_add; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("time", tests)] |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_protocol/test/unit/test_zk_rollup_storage.ml b/src/proto_017_PtNairob/lib_protocol/test/unit/test_zk_rollup_storage.ml index 0e0b1ea4ebcf..a1ff8d4c4b84 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/unit/test_zk_rollup_storage.ml +++ b/src/proto_017_PtNairob/lib_protocol/test/unit/test_zk_rollup_storage.ml @@ -26,8 +26,8 @@ (** Testing ------- Component: Protocol (Zk_rollup) - Invocation: cd src/proto_alpha/lib_protocol/test/unit && \ - dune exec ./main.exe -- test "^\[Unit\] zk rollup storage$" + Invocation: dune exec src/proto_017_PtNairob/lib_protocol/test/unit/main.exe \ + -- --file test_zk_rollup_storage.ml Subject: On ZK Rollup storage *) @@ -389,9 +389,10 @@ let tests = "pending_list_get errors" `Quick Raw_context_tests.pending_list_errors; - Tztest.tztest "test_update" `Quick Raw_context_tests.test_update; - Tztest.tztest - "test_update errors" - `Quick - Raw_context_tests.test_update_errors; + Tztest.tztest "update" `Quick Raw_context_tests.test_update; + Tztest.tztest "update errors" `Quick Raw_context_tests.test_update_errors; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("zk rollup storage", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/unit/dune b/src/proto_alpha/lib_protocol/test/unit/dune index c1be5bf09ec9..ef1598ffb81c 100644 --- a/src/proto_alpha/lib_protocol/test/unit/dune +++ b/src/proto_alpha/lib_protocol/test/unit/dune @@ -43,7 +43,6 @@ -open Tezos_crypto_dal -open Tezos_webassembly_interpreter_extra) (modules - test_main test_bond_id_repr test_consensus_key test_contract_repr diff --git a/src/proto_alpha/lib_protocol/test/unit/test_alpha_context.ml b/src/proto_alpha/lib_protocol/test/unit/test_alpha_context.ml index 7ecfda9f156c..89c947065c72 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_alpha_context.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_alpha_context.ml @@ -29,7 +29,8 @@ open Alpha_context (** Testing ------- Component: Alpha_context - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- --file test_alpha_context.ml Dependencies: helpers/block.ml Subject: To test the modules (including the top-level) in alpha_context.ml as individual units, particularly @@ -284,3 +285,7 @@ let tests = `Quick Test_Big_map.test_list_key_values_parameters; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("alpha context", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/unit/test_bond_id_repr.ml b/src/proto_alpha/lib_protocol/test/unit/test_bond_id_repr.ml index 4ca1a86b80bd..92b32f31c590 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_bond_id_repr.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_bond_id_repr.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Bond_id_repr - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- --file test_bond_id_repr.ml Dependencies: -- Subject: Test bond id representations for RPC definitions. *) @@ -111,3 +112,7 @@ let tests = test_destruct_invalid_bond_id_repr; Tztest.tztest "Deserialize/serialize roundtrip" `Quick test_roundtrip; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("Bond_id_repr.ml", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/unit/test_consensus_key.ml b/src/proto_alpha/lib_protocol/test/unit/test_consensus_key.ml index a4b9f86a5cf4..ab49b2122017 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_consensus_key.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_consensus_key.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (delegate_consensus_key) - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- --file test_consensus_key.ml Subject: Functions from the module `Delegate_consensus_key` *) @@ -237,3 +238,7 @@ let test_consensus_key_storage () = let tests = [Tztest.tztest "consensus_key_storage" `Quick test_consensus_key_storage] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("Delegate consensus key", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/unit/test_contract_repr.ml b/src/proto_alpha/lib_protocol/test/unit/test_contract_repr.ml index cac129045afd..2c211049ab79 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_contract_repr.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_contract_repr.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Contract_repr - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- --file test_contract_repr.ml Dependencies: contract_hash.ml Subject: To test the modules (including the top-level) in contract_repr.ml as individual units, particularly @@ -117,3 +118,7 @@ let tests = `Quick Test_contract_repr.test_to_b58check_originated; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("Contract_repr.ml", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/unit/test_dal_slot_proof.ml b/src/proto_alpha/lib_protocol/test/unit/test_dal_slot_proof.ml index deb8e113d4cc..eec382737297 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_dal_slot_proof.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_dal_slot_proof.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (dal slot proof) - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- --file test_dal_slot_proof.ml Subject: These unit tests check proof-related functions of Dal slots. *) @@ -438,3 +439,7 @@ let tests = let dal_parameters = constants_test.dal end) in Test.tests + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("dal slot proof", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/unit/test_destination_repr.ml b/src/proto_alpha/lib_protocol/test/unit/test_destination_repr.ml index 802f4a5af1ed..4f902ac8ccb8 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_destination_repr.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_destination_repr.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Destination_repr - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- --file test_destination_repr.ml Subject: To test the encoding of [Destination_repr] and assert it is compatible with [Contract_repr.encoding]. *) @@ -219,3 +220,7 @@ let tests = @@ test_encoding_json_compat; tztest "Comparison of destinations" `Quick test_compare_destination; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("Destination_repr.ml", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/unit/test_fitness.ml b/src/proto_alpha/lib_protocol/test/unit/test_fitness.ml index 612f1f667c3b..cf54a1fadb41 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_fitness.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_fitness.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (committee selection) - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- --file test_fitness.ml Subject: test the fitness module *) @@ -155,3 +156,6 @@ let tests = `Quick test_compare_all; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("fitness", tests)] |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/unit/test_fixed_point.ml b/src/proto_alpha/lib_protocol/test/unit/test_fixed_point.ml index 58a38d32bb67..0c9dd24eaf5a 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_fixed_point.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_fixed_point.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (fixed-point decimals) - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- --file test_fixed_point.ml Subject: On fixed-point decimal numbers. *) @@ -172,3 +173,7 @@ let tests = Tztest.tztest "FP tests (3 decimals)" `Quick fp_nonzero; Tztest.tztest "FP pp tests (3 decimals)" `Quick fp_pp; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("fixed point computation", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/unit/test_gas_monad.ml b/src/proto_alpha/lib_protocol/test/unit/test_gas_monad.ml index 6b21f9e61c68..05d5fd05ab65 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_gas_monad.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_gas_monad.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol Gas_monad - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- --file test_gas_monad.ml Subject: Tests for the gas monad module *) @@ -195,20 +196,24 @@ let test_syntax_module () = let tests = [ - Tztest.tztest "Test exhaustion" `Quick test_gas_exhaustion; + Tztest.tztest "exhaustion" `Quick test_gas_exhaustion; Tztest.tztest - "Test exhaustion before error" + "exhaustion before error" `Quick test_gas_exhaustion_before_error; Tztest.tztest - "Test successful result with remaining gas" + "successful result with remaining gas" `Quick test_successful_with_remaining_gas; Tztest.tztest - "Test successful result with spare gas" + "successful result with spare gas" `Quick test_successful_with_spare_gas; - Tztest.tztest "Test inner error" `Quick test_inner_error; - Tztest.tztest "Test unlimited" `Quick test_unlimited; - Tztest.tztest "Test syntax module" `Quick test_syntax_module; + Tztest.tztest "inner error" `Quick test_inner_error; + Tztest.tztest "unlimited" `Quick test_unlimited; + Tztest.tztest "syntax module" `Quick test_syntax_module; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("gas monad", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/unit/test_global_constants_storage.ml b/src/proto_alpha/lib_protocol/test/unit/test_global_constants_storage.ml index 9e263d4af221..9e4569c7ebd5 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_global_constants_storage.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_global_constants_storage.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Global table of constants - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- --file test_global_constants_storage.ml Dependencies: contract_hash.ml Subject: Test the global table of constants *) @@ -410,3 +411,7 @@ let tests = test_expand_is_idempotent; test_fold_does_not_stack_overflow; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("Global constants storage", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/unit/test_level_module.ml b/src/proto_alpha/lib_protocol/test/unit/test_level_module.ml index 894de6359b9f..16c7d49b1e33 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_level_module.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_level_module.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (baking) - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- --file test_level_module.ml Subject: some functions in the Level module *) @@ -276,3 +277,7 @@ let tests = Tztest.tztest "level_from_raw" `Quick test_level_from_raw; Tztest.tztest "first_level_in_cycle" `Quick test_first_level_in_cycle; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("level module", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/unit/test_liquidity_baking_repr.ml b/src/proto_alpha/lib_protocol/test/unit/test_liquidity_baking_repr.ml index 1e7d9e7be7ac..78d3b0d73851 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_liquidity_baking_repr.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_liquidity_baking_repr.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol Liquidity_baking_repr module - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- --file test_liquidity_baking_repr.ml Subject: Tests for the Liquidity_baking_repr module *) @@ -216,44 +217,39 @@ let test_ema_symmetry () = let tests = [ + Tztest.tztest "EMA does not change when vote is Pass" `Quick test_ema_pass; Tztest.tztest - "Test EMA does not change when vote is Pass" - `Quick - test_ema_pass; - Tztest.tztest - "Test EMA remains in bounds when vote is Off" + "EMA remains in bounds when vote is Off" `Quick test_ema_in_bound_off; + Tztest.tztest "EMA increases when vote is Off" `Quick test_ema_increases_off; Tztest.tztest - "Test EMA increases when vote is Off" - `Quick - test_ema_increases_off; - Tztest.tztest - "Test EMA does not increase too much when vote is Off" + "EMA does not increase too much when vote is Off" `Quick test_ema_increases_off_bound; Tztest.tztest - "Test EMA remains in bounds when vote is On" + "EMA remains in bounds when vote is On" `Quick test_ema_in_bound_on; + Tztest.tztest "EMA decreases when vote is On" `Quick test_ema_decreases_on; Tztest.tztest - "Test EMA decreases when vote is On" - `Quick - test_ema_decreases_on; - Tztest.tztest - "Test EMA does not decrease too much when vote is On" + "EMA does not decrease too much when vote is On" `Quick test_ema_decreases_on_bound; Tztest.tztest - "Test EMA goes from 0 to one billion in 1386 Off votes" + "EMA goes from 0 to one billion in 1386 Off votes" `Quick test_ema_many_off; Tztest.tztest - "Test EMA goes from two billions to one billion in 1386 On votes" + "EMA goes from two billions to one billion in 1386 On votes" `Quick test_ema_many_on; Tztest.tztest - "Test that voting On and Off have symmetric effects on the EMA" + "voting On and Off have symmetric effects on the EMA" `Quick test_ema_symmetry; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("liquidity baking", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/unit/test_local_contexts.ml b/src/proto_alpha/lib_protocol/test/unit/test_local_contexts.ml index 4505dddfcc5b..9e3c4c54ce69 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_local_contexts.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_local_contexts.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Local context storages by functors - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- --file test_local_contexts.ml Dependencies: helpers/block.ml Subject: Tests for local contexts @@ -132,3 +133,7 @@ let tests = `Quick test_local_remove_existing; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("local contexts", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/unit/test_main.ml b/src/proto_alpha/lib_protocol/test/unit/test_main.ml deleted file mode 100644 index da90172f15c3..000000000000 --- a/src/proto_alpha/lib_protocol/test/unit/test_main.ml +++ /dev/null @@ -1,62 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2022 Marigold *) -(* Copyright (c) 2022 Nomadic Labs *) -(* Copyright (c) 2022 Oxhead Alpha *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -let () = - Alcotest_lwt.run - ~__FILE__ - (Protocol.name ^ " > unit") - [ - ("Tez_repr.ml", Test_tez_repr.tests); - ("Contract_repr.ml", Test_contract_repr.tests); - ("Destination_repr.ml", Test_destination_repr.tests); - ("Operation_repr.ml", Test_operation_repr.tests); - ("Global_constants_storage.ml", Test_global_constants_storage.tests); - ("fitness", Test_fitness.tests); - ("fixed point computation", Test_fixed_point.tests); - ("level module", Test_level_module.tests); - ("qty", Test_qty.tests); - ("round", Test_round_repr.tests); - ("time", Test_time_repr.tests); - ("receipt encodings", Test_receipt.tests); - ("saturation arithmetic", Test_saturation.tests); - ("gas monad", Test_gas_monad.tests); - ("sc rollup storage", Test_sc_rollup_storage.tests); - ("sc rollup game", Test_sc_rollup_game.tests); - ("liquidity baking", Test_liquidity_baking_repr.tests); - ("sc rollup wasm", Test_sc_rollup_wasm.tests); - ("sc rollup arith", Test_sc_rollup_arith.tests); - ("merkle list", Test_merkle_list.tests); - ("sc rollup inbox", Test_sc_rollup_inbox.tests); - ("skip list", Test_skip_list_repr.tests); - ("sc rollup management protocol", Test_sc_rollup_management_protocol.tests); - ("Bond_id_repr.ml", Test_bond_id_repr.tests); - ("zk rollup storage", Test_zk_rollup_storage.tests); - ("Delegate_consensus_key.ml", Test_consensus_key.tests); - ("local_contexts", Test_local_contexts.tests); - ("dal slot proof", Test_dal_slot_proof.tests); - ] - |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/unit/test_merkle_list.ml b/src/proto_alpha/lib_protocol/test/unit/test_merkle_list.ml index ffdc84b340d1..d33e7194ddf8 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_merkle_list.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_merkle_list.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (Merkle list) - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- --file test_merkle_list.ml Subject: test the ad-hoc merkle tree structure implemented to encode lists *) @@ -234,20 +235,19 @@ let test_path_encoding () = let valid_tests = [ - ("test_compute", test_compute); - ("test_snoc", test_snoc); - ("test_snoc_non_tr", test_snoc_non_tr); - ("test_compute_path", test_compute_path); - ("test_check_path", test_check_path); - ("test_path_encoding", test_path_encoding); - ("test_compute_path_negative_pos", test_compute_path_negative_pos); - ("test_compute_path_out_of_bounds", test_compute_path_out_of_bounds); - ("test_check_path_negative_pos", test_check_path_negative_pos); - ("test_check_path_out_of_bounds", test_check_path_out_of_bounds); - ( "test_compute_path_out_of_bounds_full", - test_compute_path_out_of_bounds_full ); - ("test_check_path_wrong_pos", test_check_path_wrong_pos); - ("test_check_invalidated_path", test_check_invalidated_path); + ("compute", test_compute); + ("snoc", test_snoc); + ("snoc_non_tr", test_snoc_non_tr); + ("compute_path", test_compute_path); + ("check_path", test_check_path); + ("path_encoding", test_path_encoding); + ("compute_path_negative_pos", test_compute_path_negative_pos); + ("compute_path_out_of_bounds", test_compute_path_out_of_bounds); + ("check_path_negative_pos", test_check_path_negative_pos); + ("check_path_out_of_bounds", test_check_path_out_of_bounds); + ("compute_path_out_of_bounds_full", test_compute_path_out_of_bounds_full); + ("check_path_wrong_pos", test_check_path_wrong_pos); + ("check_invalidated_path", test_check_invalidated_path); ] let wrap (n, f) = @@ -255,3 +255,7 @@ let wrap (n, f) = Lwt.return (f ()) >|= function Ok () -> () | Error _ -> assert false) let tests = List.map wrap valid_tests + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("merkle list", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/unit/test_operation_repr.ml b/src/proto_alpha/lib_protocol/test/unit/test_operation_repr.ml index 3d0e57d4f353..4ae7d506ff3a 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_operation_repr.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_operation_repr.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Operation_repr - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- --file test_operation_repr.ml Dependencies: -- Subject: To test the modules (including the top-level) in operation_repr.ml as individual units, particularly @@ -182,3 +183,7 @@ let tests = `Quick Test_operation_repr.test_multiple_non_manager; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("Operation_repr.ml", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/unit/test_qty.ml b/src/proto_alpha/lib_protocol/test/unit/test_qty.ml index b4a97549e99e..851faa4e15cf 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_qty.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_qty.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (quantities) - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- --file test_qty.ml Subject: On tez quantities. *) @@ -157,3 +158,6 @@ let wrap (n, f) = Format.kasprintf Stdlib.failwith "%a" pp_print_trace error) let tests = List.map wrap tests + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("qty", tests)] |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/unit/test_raw_level_repr.ml b/src/proto_alpha/lib_protocol/test/unit/test_raw_level_repr.ml index 0074712e9929..1c345b749ef8 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_raw_level_repr.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_raw_level_repr.ml @@ -29,7 +29,8 @@ open Tztest (** Testing ------- Component: Raw_level_repr - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- --file test_raw_level_repr.ml Dependencies: -- Subject: To test the modules (including the top-level) in raw_level_repr.ml as individual units, particularly @@ -173,3 +174,7 @@ let skipped_tests = `Quick Test_raw_level_repr.test_skip_succ; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("Raw level", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/unit/test_receipt.ml b/src/proto_alpha/lib_protocol/test/unit/test_receipt.ml index 5cad90a33103..08e8deb83e80 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_receipt.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_receipt.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (token) - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- --file test_receipt.ml Subject: Test receipt endocings. *) @@ -91,3 +92,6 @@ let test_encodings () = test_encodings Sc_rollup_refutation_rewards let tests = Tztest.[tztest "receipt - encoding" `Quick test_encodings] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("receipt", tests)] |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/unit/test_round_repr.ml b/src/proto_alpha/lib_protocol/test/unit/test_round_repr.ml index 650ae35df6ae..5e63976421e1 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_round_repr.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_round_repr.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: protocol - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- --file test_round_repr.ml Subject: test the Round_repr module *) @@ -616,13 +617,13 @@ let test_round_and_offset_correction = let tests = Tztest. [ - tztest "test_level_offset_of_round" `Quick test_level_offset_of_round; - tztest "test Round_duration" `Quick test_round; + tztest "level_offset_of_round" `Quick test_level_offset_of_round; + tztest "Round_duration" `Quick test_round; tztest "round_of_timestamp" `Quick test_round_of_timestamp; tztest "round_of_timestamp_perf" `Quick test_round_of_timestamp_perf; tztest "timestamp_of_round_perf" `Quick test_timestamp_of_round_perf; tztest - "test level offset too high error is triggered" + "level offset too high error is triggered" `Quick test_error_is_triggered_for_too_high_timestamp; tztest "round_of_ts (ts_of_round r) = r" `Quick test_ts_of_round_inverse; @@ -632,3 +633,6 @@ let tests = test_round_of_ts_inverse; test_round_and_offset_correction; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("round", tests)] |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/unit/test_saturation.ml b/src/proto_alpha/lib_protocol/test/unit/test_saturation.ml index 3a1248aaca3c..b3379b034f63 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_saturation.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_saturation.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (saturated arithmetic) - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- --file test_saturation.ml Subject: The gas is represented using saturated arithmetic. These unit tests check that saturated arithmetic operations are correctly implemented. @@ -233,3 +234,7 @@ let tests = `Quick (encoding Saturation_repr.n_encoding); ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("saturation arithmetic", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_arith.ml b/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_arith.ml index d4d186c56651..de6e353b4327 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_arith.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_arith.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (saturated arithmetic) - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- --file test_sc_rollup_arith.ml Subject: Basic testing of the arithmetic rollup example *) @@ -545,3 +546,7 @@ let tests = test_initial_state_hash_arith_pvm; Tztest.tztest "Filter internal message" `Quick test_filter_internal_message; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("sc rollup arith", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_game.ml b/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_game.ml index 659d475495d4..1da8d2b65fa5 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_game.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_game.ml @@ -27,7 +27,8 @@ (** Testing ------- Component: Protocol Sc_rollup_refutation_storage - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- --file test_sc_rollup_game.ml Subject: Tests for the SCORU refutation game *) @@ -459,21 +460,23 @@ let tests = `Quick test_invalid_serialized_inbox_proof; Tztest.tztest - "Test to start a game with invalid commitment hash (swap commitment)." + "start a game with invalid commitment hash (swap commitment)." `Quick test_first_move_with_swapped_commitment; Tztest.tztest - "Test to start a game with invalid commitment hash (op from outsider)." + "start a game with invalid commitment hash (op from outsider)." `Quick test_first_move_from_invalid_player; Tztest.tztest - "Test to start a game with invalid commitment hash (opponent is not in \ - game)." + "start a game with invalid commitment hash (opponent is not in game)." `Quick test_first_move_with_invalid_opponent; Tztest.tztest - "Test to start a game with commitment hash that are not the first \ - conflict." + "start a game with commitment hash that are not the first conflict." `Quick test_first_move_with_invalid_ancestor; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("sc rollup game", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_inbox.ml b/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_inbox.ml index 0cc0a699d1f8..98e1867438c3 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_inbox.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_inbox.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (smart contract rollup inbox) - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- --file test_sc_rollup_inbox.ml Subject: These unit tests check the off-line inbox implementation for smart contract rollups *) @@ -940,3 +941,7 @@ let inbox_tests = let tests = merkelized_payload_hashes_tests @ inbox_tests @ Test_sc_rollup_inbox_legacy.tests + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("sc rollup inbox", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_management_protocol.ml b/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_management_protocol.ml index 66fa9d8cd82e..e8af9186b77a 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_management_protocol.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_management_protocol.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (Rollup Management Protocol) - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- --file test_sc_rollup_management_protocol.ml Subject: Sanity checks for the Rollup Management Protocol module. *) @@ -355,3 +356,10 @@ let tests = `Quick test_encode_decode_outbox_message; ] + +let () = + Alcotest_lwt.run + ~__FILE__ + Protocol.name + [("sc rollup management protocol", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_storage.ml b/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_storage.ml index ed83ffbd90a1..0ce42edc846a 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_storage.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_storage.ml @@ -27,7 +27,8 @@ (** Testing ------- Component: Protocol Sc_rollup_storage - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- --file test_sc_rollup_storage.ml Subject: Tests for the SCORU storage module *) @@ -2672,7 +2673,7 @@ module Stake_storage_tests = struct `Quick test_no_conflict_point_both_stakers_at_lcc; Tztest.tztest - "test_conflict_point_computation_fits_in_gas_limit" + "conflict_point_computation_fits_in_gas_limit" `Quick test_conflict_point_computation_fits_in_gas_limit; Tztest.tztest "can remove staker 1" `Quick test_can_remove_staker; @@ -2743,7 +2744,7 @@ module Stake_storage_tests = struct `Quick test_unrelated_commitments; Tztest.tztest - "test fresh index is correcly incremented" + "fresh index is correcly incremented" `Quick test_fresh_index_correctly_increment; ] @@ -2797,3 +2798,7 @@ let tests = Stake_storage_tests.tests @ Rollup_storage_tests.tests (* FIXME: https://gitlab.com/tezos/tezos/-/issues/2460 Further tests to be added. *) + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("sc rollup storage", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_wasm.ml b/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_wasm.ml index 2dc6313cdc46..644eaa6393bf 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_wasm.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_wasm.ml @@ -27,7 +27,8 @@ (** Testing ------- Component: Rollup layer 1 logic - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- --file test_sc_rollup_wasm.ml Subject: Unit test for the Wasm PVM *) @@ -345,6 +346,10 @@ let tests = test_initial_state_hash_wasm_pvm; Tztest.tztest "size of a rollup metadata" `Quick test_metadata_size; Tztest.tztest "l1 input kind" `Quick test_l1_input_kind; - Tztest.tztest "test output proofs" `Quick test_output; - Tztest.tztest "test protocol names consistency" `Quick test_protocol_names; + Tztest.tztest "output proofs" `Quick test_output; + Tztest.tztest "protocol names consistency" `Quick test_protocol_names; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("sc rollup wasm", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/unit/test_skip_list_repr.ml b/src/proto_alpha/lib_protocol/test/unit/test_skip_list_repr.ml index 8a64dd89b159..0b5a0c06d454 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_skip_list_repr.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_skip_list_repr.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (skip lists) - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- --file test_skip_list_repr.ml Subject: Test skip list implementation *) @@ -674,3 +675,7 @@ let tests = `Quick test_skip_list_proof_size; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("skip list", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/unit/test_tez_repr.ml b/src/proto_alpha/lib_protocol/test/unit/test_tez_repr.ml index 65cecc9fd191..ae6354778b90 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_tez_repr.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_tez_repr.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Tez_repr - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- --file test_tez_repr.ml Dependencies: -- Subject: To test the modules (including the top-level) in tez_repr.ml as individual units, particularly @@ -196,3 +197,7 @@ let tests = `Quick Test_tez_repr.test_data_encoding; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("Tez_repr.ml", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/unit/test_time_repr.ml b/src/proto_alpha/lib_protocol/test/unit/test_time_repr.ml index f103d9ccaf7d..e9f694808494 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_time_repr.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_time_repr.ml @@ -1,7 +1,8 @@ (** Testing ------- Component: Protocol (time repr) - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- --file test_time_repr.ml Subject: Error handling of time operations *) @@ -42,3 +43,6 @@ let tests = Tztest.tztest "non-overflowing addition" `Quick test_nominal_add; Tztest.tztest "overflowing addition" `Quick test_overflow_add; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("time", tests)] |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/unit/test_zk_rollup_storage.ml b/src/proto_alpha/lib_protocol/test/unit/test_zk_rollup_storage.ml index f42b9ebbec32..82af6fbe1f0b 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_zk_rollup_storage.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_zk_rollup_storage.ml @@ -26,7 +26,8 @@ (** Testing ------- Component: Protocol (Zk_rollup) - Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe + Invocation: dune exec src/proto_alpha/lib_protocol/test/unit/main.exe \ + -- --file test_zk_rollup_storage.ml Subject: On ZK Rollup storage *) @@ -388,9 +389,10 @@ let tests = "pending_list_get errors" `Quick Raw_context_tests.pending_list_errors; - Tztest.tztest "test_update" `Quick Raw_context_tests.test_update; - Tztest.tztest - "test_update errors" - `Quick - Raw_context_tests.test_update_errors; + Tztest.tztest "update" `Quick Raw_context_tests.test_update; + Tztest.tztest "update errors" `Quick Raw_context_tests.test_update_errors; ] + +let () = + Alcotest_lwt.run ~__FILE__ Protocol.name [("zk rollup storage", tests)] + |> Lwt_main.run -- GitLab