diff --git a/.gitlab/ci/jobs/packaging/opam_package.yml b/.gitlab/ci/jobs/packaging/opam_package.yml index 309167ed95575de7c963708db98c1ceaef250dee..ed86e45ca1da657c368cb09a4227d404d72fc645 100644 --- a/.gitlab/ci/jobs/packaging/opam_package.yml +++ b/.gitlab/ci/jobs/packaging/opam_package.yml @@ -369,6 +369,13 @@ opam:octez-polynomial: variables: package: octez-polynomial +opam:octez-protocol-alcotezt: + extends: + - .opam_template + - .rules_template__trigger_opam_batch_5 + variables: + package: octez-protocol-alcotezt + opam:octez-protocol-compiler: extends: - .opam_template @@ -1281,7 +1288,7 @@ opam:tezos-protocol-environment: opam:tezos-protocol-genesis: extends: - .opam_template - - .rules_template__trigger_opam_batch_5 + - .rules_template__trigger_opam_batch_6 variables: package: tezos-protocol-genesis @@ -1731,7 +1738,7 @@ opam:tezos-webassembly-interpreter-extra: opam:tezos-workers: extends: - .opam_template - - .rules_template__trigger_opam_batch_6 + - .rules_template__trigger_opam_batch_7 variables: package: tezos-workers diff --git a/dune-project b/dune-project index 73cae799a69a9fd8248114162f4cb999fd458019..f36c3e712c29a7bb3c09cb439ec2a5d8286a59a1 100644 --- a/dune-project +++ b/dune-project @@ -33,6 +33,7 @@ (package (name octez-plompiler)) (package (name octez-plonk)) (package (name octez-polynomial)) +(package (name octez-protocol-alcotezt)) (package (name octez-protocol-compiler)) (package (name octez-proxy-server)) (package (name octez-signer)) diff --git a/manifest/main.ml b/manifest/main.ml index d524fb54d027cc8289d52b7a3489e6b728f549e9..85fcb17347ea7785d20e284f25c2dc6c892c15a0 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -2877,6 +2877,25 @@ protocols.|} octez_event_logging; ] +let protocol_alcotezt = + public_lib + "octez-protocol-alcotezt" + ~path:"tezt/lib_protocol_alcotezt" + (* TODO: is this necessary? + + TODO: https://gitlab.com/tezos/tezos/-/issues/4727 + + we mark "protocol-octez-alcotezt" as released but the real solution is to + modify the manifest to add build instructions for dune to be + used `with-test` *) + ~release_status:Released + ~synopsis: + "Provide the interface of Alcotest for Octez Protocol Tests, but with \ + Tezt as backend and automatically enforcing test naming and tagging \ + policies" + ~deps:[alcotezt; tezt_tezos; octez_protocol_environment |> open_] + |> open_ + let octez_shell_context = public_lib "tezos-shell-context" @@ -4585,8 +4604,8 @@ end = struct module Lib_protocol = struct type t = {main : target; embedded : target} - let make_tests ?test_helpers ?parameters ?plugin ?client ?benchmark - ?benchmark_type_inference ?octez_sc_rollup ~main ~name () = + let make_tests ?test_helpers ?alcotezt ?parameters ?plugin ?client + ?benchmark ?benchmark_type_inference ?octez_sc_rollup ~main ~name () = let name_dash = Name.name_dash name in let number = Name.number name in let path = Name.base_path name in @@ -4614,7 +4633,7 @@ end = struct ~opam:(sf "tezos-protocol-%s-tests" name_dash) ~deps: [ - alcotezt; + alcotezt |> if_some; octez_base |> open_ ~m:"TzPervasives" |> open_ ~m:"TzPervasives.Error_monad.Legacy_monad_globals"; main |> open_; @@ -4632,7 +4651,7 @@ end = struct ~with_macos_security_framework:true ~deps: [ - alcotezt; + alcotezt |> if_some; octez_base |> open_ ~m:"TzPervasives" |> open_ ~m:"TzPervasives.Error_monad.Legacy_monad_globals"; main |> open_; @@ -4688,7 +4707,7 @@ end = struct ]) ~deps: [ - alcotezt; + alcotezt |> if_some; octez_base |> open_ ~m:"TzPervasives" |> open_ ~m:"TzPervasives.Error_monad.Legacy_monad_globals"; main |> open_; @@ -4732,7 +4751,7 @@ end = struct ~dep_globs:(conditional_list [("contracts/*", N.(number >= 013))]) ~deps: [ - alcotezt; + alcotezt |> if_some; octez_base |> open_ ~m:"TzPervasives" |> open_ ~m:"TzPervasives.Error_monad.Legacy_monad_globals"; main |> open_; @@ -4764,7 +4783,7 @@ end = struct ~with_macos_security_framework:true ~deps: [ - alcotezt; + alcotezt |> if_some; octez_base |> open_ ~m:"TzPervasives" |> open_ ~m:"TzPervasives.Error_monad.Legacy_monad_globals"; main |> open_; @@ -4799,7 +4818,7 @@ end = struct [ (if N.(number >= 015) then Some tezt_lib else None) |> if_some; octez_context; - alcotezt; + alcotezt |> if_some; octez_base |> open_ ~m:"TzPervasives" |> open_ ~m:"TzPervasives.Error_monad.Legacy_monad_globals"; client |> if_some |> open_; @@ -4858,7 +4877,7 @@ end = struct octez_merkle_proof_encoding; octez_test_helpers |> open_; test_helpers |> if_some |> open_; - alcotezt; + alcotezt |> if_some; qcheck_alcotest; octez_client_base |> if_ N.(number <= 012); octez_benchmark; @@ -4927,7 +4946,7 @@ end = struct main |> open_; octez_test_helpers |> open_; test_helpers |> if_some |> open_; - alcotezt; + alcotezt |> if_some; octez_scoru_wasm_helpers |> if_ N.(number >= 016) |> open_; octez_stdlib |> if_ N.(number >= 013) |> open_; octez_crypto_dal |> if_ N.(number >= 016) |> open_; @@ -4961,6 +4980,7 @@ end = struct plugin |> if_some |> open_; test_helpers |> if_some |> open_; octez_micheline |> open_; + protocol_alcotezt; ] ~dep_globs:["contracts/*.tz"; "expected/test_logging.ml/*.out"] in @@ -5518,6 +5538,26 @@ module Protocol = Protocol octez_crypto_dal |> if_ N.(number >= 016) |> open_; ] in + (* We override the original definition of [alcotezt] to a + protocol-specific wrapper that registers tests with a + Protocol-appropriate title prefix and tag. We override to + ensure that the original definition is not used by mistake + which could lead to test title collisions when snapshotting. *) + let this_protocol_alcotezt = + only_if active @@ fun () -> + public_lib + (sf "tezos-%s-test-helpers.alcotezt" name_dash) + ~path: + (if active then path // "lib_protocol/test/helpers/alcotezt" + else path // "lib_protocol") + ~opam: + (if active then sf "tezos-%s-test-helpers" name_dash + else sf "tezos-%s-test-helpers" name_dash) + ~internal_name:(sf "tezos_%s_test_helpers_alcotezt" name_underscore) + ~opam_only_deps:[octez_protocol_environment] + ~deps:[octez_protocol_environment; main |> open_; protocol_alcotezt] + |> open_ + in let _plugin_tests = opt_map (both plugin test_helpers) @@ fun (plugin, test_helpers) -> only_if active @@ fun () -> @@ -5540,7 +5580,7 @@ module Protocol = Protocol |> open_ ~m:"TzPervasives.Error_monad.Legacy_monad_globals"; octez_base_test_helpers |> open_; octez_base_unix |> if_ N.(number >= 013); - alcotezt; + this_protocol_alcotezt |> if_some; octez_test_helpers |> open_; qcheck_alcotest; octez_stdlib_unix; @@ -5572,7 +5612,7 @@ module Protocol = Protocol main |> open_; octez_base_test_helpers |> open_; octez_test_helpers |> open_; - alcotezt; + protocol_alcotezt; qcheck_alcotest; ] in @@ -5791,7 +5831,7 @@ module Protocol = Protocol baking |> open_; parameters |> if_some |> if_ N.(number >= 012); octez_crypto |> if_ N.(number >= 012); - alcotezt; + this_protocol_alcotezt |> if_some; uri; ] in @@ -6196,7 +6236,7 @@ module Protocol = Protocol main |> open_; octez_base_test_helpers |> open_; test_helpers |> if_some |> open_; - alcotezt; + this_protocol_alcotezt |> if_some; ] in let dac = @@ -6247,7 +6287,7 @@ module Protocol = Protocol test_helpers |> if_some |> open_; octez_dac_lib |> open_; octez_dac_node_lib |> open_; - alcotezt; + this_protocol_alcotezt |> if_some; ] in let benchmark_type_inference = @@ -6392,6 +6432,7 @@ module Protocol = Protocol if active then Lib_protocol.make_tests ?test_helpers + ?alcotezt:this_protocol_alcotezt ?parameters ?plugin ?client diff --git a/opam/octez-protocol-alcotezt.opam b/opam/octez-protocol-alcotezt.opam new file mode 100644 index 0000000000000000000000000000000000000000..f39047895a2174f7840005c77cea2e5faf095211 --- /dev/null +++ b/opam/octez-protocol-alcotezt.opam @@ -0,0 +1,22 @@ +# This file was automatically generated, do not edit. +# Edit file manifest/main.ml instead. +opam-version: "2.0" +maintainer: "contact@tezos.com" +authors: ["Tezos devteam"] +homepage: "https://www.tezos.com/" +bug-reports: "https://gitlab.com/tezos/tezos/issues" +dev-repo: "git+https://gitlab.com/tezos/tezos.git" +license: "MIT" +depends: [ + "dune" { >= "3.0" } + "ocaml" { >= "4.14" } + "octez-alcotezt" + "tezt-tezos" + "tezos-protocol-environment" +] +build: [ + ["rm" "-r" "vendors"] + ["dune" "build" "-p" name "-j" jobs] + ["dune" "runtest" "-p" name "-j" jobs] {with-test} +] +synopsis: "Provide the interface of Alcotest for Octez Protocol Tests, but with Tezt as backend and automatically enforcing test naming and tagging policies" diff --git a/opam/tezos-015-PtLimaPt-test-helpers.opam b/opam/tezos-015-PtLimaPt-test-helpers.opam index 8cb2483c6402438212773166d7f0aafeb036661d..452e62162830cd1fb7b2b2c1ddf469e38f5c8322 100644 --- a/opam/tezos-015-PtLimaPt-test-helpers.opam +++ b/opam/tezos-015-PtLimaPt-test-helpers.opam @@ -21,6 +21,7 @@ depends: [ "tezos-protocol-plugin-015-PtLimaPt" "tezos-shell-services" "octez-plompiler" + "octez-protocol-alcotezt" ] build: [ ["rm" "-r" "vendors"] diff --git a/opam/tezos-016-PtMumbai-test-helpers.opam b/opam/tezos-016-PtMumbai-test-helpers.opam index c041ee4aae5de1b9428ce50a128c9c3b30c242b9..a21851797186fc8b890b9c73c40faa49fc081970 100644 --- a/opam/tezos-016-PtMumbai-test-helpers.opam +++ b/opam/tezos-016-PtMumbai-test-helpers.opam @@ -22,6 +22,7 @@ depends: [ "tezos-shell-services" "octez-plompiler" "tezos-crypto-dal" + "octez-protocol-alcotezt" ] build: [ ["rm" "-r" "vendors"] diff --git a/opam/tezos-017-PtNairob-test-helpers.opam b/opam/tezos-017-PtNairob-test-helpers.opam index ca7f3c84a184c648c73e9e0b2912dd5383d1c173..ccb45073f9e0e255541c4165d08073b901e20cea 100644 --- a/opam/tezos-017-PtNairob-test-helpers.opam +++ b/opam/tezos-017-PtNairob-test-helpers.opam @@ -22,6 +22,7 @@ depends: [ "tezos-shell-services" "octez-plompiler" "tezos-crypto-dal" + "octez-protocol-alcotezt" ] build: [ ["rm" "-r" "vendors"] diff --git a/opam/tezos-alpha-test-helpers.opam b/opam/tezos-alpha-test-helpers.opam index 1002ce39d3c9c125a8a6601fd431954aa598fd03..84ed3b38b41cd4ccdb872f18eedbaf4c883c55e7 100644 --- a/opam/tezos-alpha-test-helpers.opam +++ b/opam/tezos-alpha-test-helpers.opam @@ -22,6 +22,7 @@ depends: [ "tezos-shell-services" "octez-plompiler" "tezos-crypto-dal" + "octez-protocol-alcotezt" ] build: [ ["rm" "-r" "vendors"] diff --git a/opam/tezos-baking-015-PtLimaPt.opam b/opam/tezos-baking-015-PtLimaPt.opam index f86e4c334926880ea2ed793e66bb90cdda2799bb..9b3c640f980b79c0d752dde23198b927477ec048 100644 --- a/opam/tezos-baking-015-PtLimaPt.opam +++ b/opam/tezos-baking-015-PtLimaPt.opam @@ -40,7 +40,7 @@ depends: [ "tezos-micheline" {with-test} "tezos-base-test-helpers" {with-test} "tezos-crypto" {with-test} - "octez-alcotezt" {with-test} + "tezos-015-PtLimaPt-test-helpers" {with-test} ] build: [ ["rm" "-r" "vendors"] diff --git a/opam/tezos-baking-016-PtMumbai.opam b/opam/tezos-baking-016-PtMumbai.opam index 3e26d967a7861207170a6b8253e6dab94b33b2fe..37b09ed31ae6fa2018fee7a30db409b6cc371774 100644 --- a/opam/tezos-baking-016-PtMumbai.opam +++ b/opam/tezos-baking-016-PtMumbai.opam @@ -40,7 +40,7 @@ depends: [ "tezos-micheline" {with-test} "tezos-base-test-helpers" {with-test} "tezos-crypto" {with-test} - "octez-alcotezt" {with-test} + "tezos-016-PtMumbai-test-helpers" {with-test} ] build: [ ["rm" "-r" "vendors"] diff --git a/opam/tezos-baking-017-PtNairob.opam b/opam/tezos-baking-017-PtNairob.opam index c856c058a989e632231a8b8b79f797d7df87aef8..f2c7db2a4357aaeea34ac3e4a4e1b5bb00409a57 100644 --- a/opam/tezos-baking-017-PtNairob.opam +++ b/opam/tezos-baking-017-PtNairob.opam @@ -41,7 +41,7 @@ depends: [ "tezos-micheline" {with-test} "tezos-base-test-helpers" {with-test} "tezos-crypto" {with-test} - "octez-alcotezt" {with-test} + "tezos-017-PtNairob-test-helpers" {with-test} ] build: [ ["rm" "-r" "vendors"] diff --git a/opam/tezos-baking-alpha.opam b/opam/tezos-baking-alpha.opam index e2711ed928ef4da54aa17600e15a42d66c58b69d..f25065254e143b8a027581f52657bb739865a04f 100644 --- a/opam/tezos-baking-alpha.opam +++ b/opam/tezos-baking-alpha.opam @@ -41,7 +41,7 @@ depends: [ "tezos-micheline" {with-test} "tezos-base-test-helpers" {with-test} "tezos-crypto" {with-test} - "octez-alcotezt" {with-test} + "tezos-alpha-test-helpers" {with-test} ] build: [ ["rm" "-r" "vendors"] diff --git a/opam/tezos-client-015-PtLimaPt.opam b/opam/tezos-client-015-PtLimaPt.opam index 0b111f186e2d8f5b19bf7535720f955ab687a0b1..ae53b15c3aaa3485c1ac547a23bcd6231b98401c 100644 --- a/opam/tezos-client-015-PtLimaPt.opam +++ b/opam/tezos-client-015-PtLimaPt.opam @@ -33,7 +33,7 @@ depends: [ "tezos-micheline" {with-test} "tezos-base-test-helpers" {with-test} "tezos-test-helpers" {with-test} - "octez-alcotezt" {with-test} + "octez-protocol-alcotezt" {with-test} "qcheck-alcotest" { with-test & >= "0.20" } ] build: [ diff --git a/opam/tezos-client-016-PtMumbai.opam b/opam/tezos-client-016-PtMumbai.opam index a38b3d232e82c67c83a5b8ca38c24cd29e109f27..3355644306f8da08a6618cd6df19c1886f4d7eb7 100644 --- a/opam/tezos-client-016-PtMumbai.opam +++ b/opam/tezos-client-016-PtMumbai.opam @@ -34,7 +34,7 @@ depends: [ "tezos-micheline" {with-test} "tezos-base-test-helpers" {with-test} "tezos-test-helpers" {with-test} - "octez-alcotezt" {with-test} + "octez-protocol-alcotezt" {with-test} "qcheck-alcotest" { with-test & >= "0.20" } ] build: [ diff --git a/opam/tezos-client-017-PtNairob.opam b/opam/tezos-client-017-PtNairob.opam index fc204ad66686c54fb0fefaccee80007737531371..66b9d40780cb26de63692596870d1f79caf434f1 100644 --- a/opam/tezos-client-017-PtNairob.opam +++ b/opam/tezos-client-017-PtNairob.opam @@ -34,7 +34,7 @@ depends: [ "tezos-micheline" {with-test} "tezos-base-test-helpers" {with-test} "tezos-test-helpers" {with-test} - "octez-alcotezt" {with-test} + "octez-protocol-alcotezt" {with-test} "qcheck-alcotest" { with-test & >= "0.20" } ] build: [ diff --git a/opam/tezos-client-alpha.opam b/opam/tezos-client-alpha.opam index 7a773bbe0bf7b41124198c13c059e707da40b559..3b562d482d00033537b11122976b0c98294406f5 100644 --- a/opam/tezos-client-alpha.opam +++ b/opam/tezos-client-alpha.opam @@ -34,7 +34,7 @@ depends: [ "tezos-micheline" {with-test} "tezos-base-test-helpers" {with-test} "tezos-test-helpers" {with-test} - "octez-alcotezt" {with-test} + "octez-protocol-alcotezt" {with-test} "qcheck-alcotest" { with-test & >= "0.20" } ] build: [ diff --git a/opam/tezos-dac-017-PtNairob.opam b/opam/tezos-dac-017-PtNairob.opam index 56e93fcca9cbaf8f2f44d4ad52bb0fc9ea68d539..8198ae33a85a714fcbccd31360b5cdde07c2dac6 100644 --- a/opam/tezos-dac-017-PtNairob.opam +++ b/opam/tezos-dac-017-PtNairob.opam @@ -23,7 +23,6 @@ depends: [ "tezos-base-test-helpers" {with-test} "tezos-017-PtNairob-test-helpers" {with-test} "tezos-dac-node-lib" {with-test} - "octez-alcotezt" {with-test} ] build: [ ["rm" "-r" "vendors"] diff --git a/opam/tezos-dac-alpha.opam b/opam/tezos-dac-alpha.opam index 4d08e27b05194c9d28d62c146aebc24da72add70..9752cde709ad0ff36ceb58ccb0f03ff51ec042f7 100644 --- a/opam/tezos-dac-alpha.opam +++ b/opam/tezos-dac-alpha.opam @@ -23,7 +23,6 @@ depends: [ "tezos-base-test-helpers" {with-test} "tezos-alpha-test-helpers" {with-test} "tezos-dac-node-lib" {with-test} - "octez-alcotezt" {with-test} ] build: [ ["rm" "-r" "vendors"] diff --git a/opam/tezos-dal-016-PtMumbai.opam b/opam/tezos-dal-016-PtMumbai.opam index d3c522cad9dd9785e12f23353292e115474f02b7..3bf9ada21d3a8e1a0c5575f30bddde83342e29dd 100644 --- a/opam/tezos-dal-016-PtMumbai.opam +++ b/opam/tezos-dal-016-PtMumbai.opam @@ -23,7 +23,6 @@ depends: [ "tezt" { with-test & >= "3.0.0" } "tezos-base-test-helpers" {with-test} "tezos-016-PtMumbai-test-helpers" {with-test} - "octez-alcotezt" {with-test} ] build: [ ["rm" "-r" "vendors"] diff --git a/opam/tezos-dal-017-PtNairob.opam b/opam/tezos-dal-017-PtNairob.opam index 0fc44eef70f178f6b45a80470ff47cd9cd264325..13771b8dee6b798b2631c607b8ec2ee482c5ff4f 100644 --- a/opam/tezos-dal-017-PtNairob.opam +++ b/opam/tezos-dal-017-PtNairob.opam @@ -23,7 +23,6 @@ depends: [ "tezt" { with-test & >= "3.0.0" } "tezos-base-test-helpers" {with-test} "tezos-017-PtNairob-test-helpers" {with-test} - "octez-alcotezt" {with-test} ] build: [ ["rm" "-r" "vendors"] diff --git a/opam/tezos-dal-alpha.opam b/opam/tezos-dal-alpha.opam index 48f0faecdaf6689151f6e3182cf061f599199152..77ac951a7796f07aeaee2da1089f775d456a60e0 100644 --- a/opam/tezos-dal-alpha.opam +++ b/opam/tezos-dal-alpha.opam @@ -23,7 +23,6 @@ depends: [ "tezt" { with-test & >= "3.0.0" } "tezos-base-test-helpers" {with-test} "tezos-alpha-test-helpers" {with-test} - "octez-alcotezt" {with-test} ] build: [ ["rm" "-r" "vendors"] diff --git a/opam/tezos-protocol-015-PtLimaPt-tests.opam b/opam/tezos-protocol-015-PtLimaPt-tests.opam index 532accfa4ad15be00adc49401822b6a3319c2db6..cb3181139d960a18c48dccde9e003d53d245b43d 100644 --- a/opam/tezos-protocol-015-PtLimaPt-tests.opam +++ b/opam/tezos-protocol-015-PtLimaPt-tests.opam @@ -12,11 +12,10 @@ depends: [ "ocaml" { >= "4.14" } "tezt" { with-test & >= "3.0.0" } "tezos-context" {with-test} - "octez-alcotezt" {with-test} + "tezos-015-PtLimaPt-test-helpers" {with-test} "tezos-base" {with-test} "tezos-client-015-PtLimaPt" {with-test} "tezos-protocol-015-PtLimaPt" {with-test} - "tezos-015-PtLimaPt-test-helpers" {with-test} "tezos-base-test-helpers" {with-test} "tezos-protocol-plugin-015-PtLimaPt" {with-test} "tezos-benchmark" {with-test} @@ -26,6 +25,7 @@ depends: [ "qcheck-alcotest" { with-test & >= "0.20" } "tezos-test-helpers" {with-test} "tezt-tezos" {with-test} + "octez-protocol-alcotezt" {with-test} "tezos-client-base" {with-test} "tezos-protocol-environment" {with-test} "tezos-stdlib-unix" {with-test} diff --git a/opam/tezos-protocol-016-PtMumbai-tests.opam b/opam/tezos-protocol-016-PtMumbai-tests.opam index 0e0e4e8ab89cf14a3b34f5e1b323bd46f232e5f6..67eca199c5b4324c3e1a20e8eaa71881611710ad 100644 --- a/opam/tezos-protocol-016-PtMumbai-tests.opam +++ b/opam/tezos-protocol-016-PtMumbai-tests.opam @@ -12,11 +12,10 @@ depends: [ "ocaml" { >= "4.14" } "tezt" { with-test & >= "3.0.0" } "tezos-context" {with-test} - "octez-alcotezt" {with-test} + "tezos-016-PtMumbai-test-helpers" {with-test} "tezos-base" {with-test} "tezos-client-016-PtMumbai" {with-test} "tezos-protocol-016-PtMumbai" {with-test} - "tezos-016-PtMumbai-test-helpers" {with-test} "tezos-base-test-helpers" {with-test} "tezos-protocol-plugin-016-PtMumbai" {with-test} "tezos-benchmark" {with-test} @@ -28,6 +27,7 @@ depends: [ "tezos-smart-rollup-016-PtMumbai" {with-test} "tezos-crypto-dal" {with-test} "tezt-tezos" {with-test} + "octez-protocol-alcotezt" {with-test} "tezos-client-base" {with-test} "tezos-protocol-environment" {with-test} "tezos-stdlib-unix" {with-test} diff --git a/opam/tezos-protocol-017-PtNairob-tests.opam b/opam/tezos-protocol-017-PtNairob-tests.opam index 62ba825d4aac62444091fb7f9cb36b83b5942b46..4b4001b27fd0972d146eaefeb55f8b24240edac1 100644 --- a/opam/tezos-protocol-017-PtNairob-tests.opam +++ b/opam/tezos-protocol-017-PtNairob-tests.opam @@ -12,11 +12,10 @@ depends: [ "ocaml" { >= "4.14" } "tezt" { with-test & >= "3.0.0" } "tezos-context" {with-test} - "octez-alcotezt" {with-test} + "tezos-017-PtNairob-test-helpers" {with-test} "tezos-base" {with-test} "tezos-client-017-PtNairob" {with-test} "tezos-protocol-017-PtNairob" {with-test} - "tezos-017-PtNairob-test-helpers" {with-test} "tezos-base-test-helpers" {with-test} "tezos-protocol-plugin-017-PtNairob" {with-test} "tezos-benchmark" {with-test} @@ -28,6 +27,7 @@ depends: [ "tezos-smart-rollup-017-PtNairob" {with-test} "tezos-crypto-dal" {with-test} "tezt-tezos" {with-test} + "octez-protocol-alcotezt" {with-test} "tezos-client-base" {with-test} "tezos-protocol-environment" {with-test} "tezos-stdlib-unix" {with-test} diff --git a/opam/tezos-protocol-alpha-tests.opam b/opam/tezos-protocol-alpha-tests.opam index 69568ef93f4839623deab8bf61b9ffdbba78100e..2704a8745cc09e48a42aef4beeaf7548091e849c 100644 --- a/opam/tezos-protocol-alpha-tests.opam +++ b/opam/tezos-protocol-alpha-tests.opam @@ -12,11 +12,10 @@ depends: [ "ocaml" { >= "4.14" } "tezt" { with-test & >= "3.0.0" } "tezos-context" {with-test} - "octez-alcotezt" {with-test} + "tezos-alpha-test-helpers" {with-test} "tezos-base" {with-test} "tezos-client-alpha" {with-test} "tezos-protocol-alpha" {with-test} - "tezos-alpha-test-helpers" {with-test} "tezos-base-test-helpers" {with-test} "tezos-protocol-plugin-alpha" {with-test} "tezos-benchmark" {with-test} @@ -28,6 +27,7 @@ depends: [ "tezos-smart-rollup-alpha" {with-test} "tezos-crypto-dal" {with-test} "tezt-tezos" {with-test} + "octez-protocol-alcotezt" {with-test} "tezos-client-base" {with-test} "tezos-protocol-environment" {with-test} "tezos-stdlib-unix" {with-test} diff --git a/opam/tezos-protocol-plugin-015-PtLimaPt-tests.opam b/opam/tezos-protocol-plugin-015-PtLimaPt-tests.opam index b9269c355b61a16eae3423290c769330d3032671..e7eaad6f14ac5e3697156cd5ab81fef090a31c68 100644 --- a/opam/tezos-protocol-plugin-015-PtLimaPt-tests.opam +++ b/opam/tezos-protocol-plugin-015-PtLimaPt-tests.opam @@ -13,14 +13,13 @@ depends: [ "tezt" { with-test & >= "3.0.0" } "tezos-base" {with-test} "tezos-base-test-helpers" {with-test} - "octez-alcotezt" {with-test} + "tezos-015-PtLimaPt-test-helpers" {with-test} "tezos-test-helpers" {with-test} "qcheck-alcotest" { with-test & >= "0.20" } "tezos-stdlib-unix" {with-test} "tezos-micheline" {with-test} "tezos-protocol-plugin-015-PtLimaPt" {with-test} "tezos-protocol-015-PtLimaPt" {with-test} - "tezos-015-PtLimaPt-test-helpers" {with-test} ] build: [ ["rm" "-r" "vendors"] diff --git a/opam/tezos-protocol-plugin-016-PtMumbai-tests.opam b/opam/tezos-protocol-plugin-016-PtMumbai-tests.opam index ca78afa10ffcb5e9d2a988924f445f90e3a5774b..1054ac96b9827f78191db4d253edcdf3f46b58ec 100644 --- a/opam/tezos-protocol-plugin-016-PtMumbai-tests.opam +++ b/opam/tezos-protocol-plugin-016-PtMumbai-tests.opam @@ -13,14 +13,13 @@ depends: [ "tezt" { with-test & >= "3.0.0" } "tezos-base" {with-test} "tezos-base-test-helpers" {with-test} - "octez-alcotezt" {with-test} + "tezos-016-PtMumbai-test-helpers" {with-test} "tezos-test-helpers" {with-test} "qcheck-alcotest" { with-test & >= "0.20" } "tezos-stdlib-unix" {with-test} "tezos-micheline" {with-test} "tezos-protocol-plugin-016-PtMumbai" {with-test} "tezos-protocol-016-PtMumbai" {with-test} - "tezos-016-PtMumbai-test-helpers" {with-test} ] build: [ ["rm" "-r" "vendors"] diff --git a/opam/tezos-protocol-plugin-017-PtNairob-tests.opam b/opam/tezos-protocol-plugin-017-PtNairob-tests.opam index c4c11e99874063ae7bf115e4a94ed07d54400874..e4443debad6bad0555ffccab26955b8a6ad16e04 100644 --- a/opam/tezos-protocol-plugin-017-PtNairob-tests.opam +++ b/opam/tezos-protocol-plugin-017-PtNairob-tests.opam @@ -13,14 +13,13 @@ depends: [ "tezt" { with-test & >= "3.0.0" } "tezos-base" {with-test} "tezos-base-test-helpers" {with-test} - "octez-alcotezt" {with-test} + "tezos-017-PtNairob-test-helpers" {with-test} "tezos-test-helpers" {with-test} "qcheck-alcotest" { with-test & >= "0.20" } "tezos-stdlib-unix" {with-test} "tezos-micheline" {with-test} "tezos-protocol-plugin-017-PtNairob" {with-test} "tezos-protocol-017-PtNairob" {with-test} - "tezos-017-PtNairob-test-helpers" {with-test} ] build: [ ["rm" "-r" "vendors"] diff --git a/opam/tezos-protocol-plugin-alpha-tests.opam b/opam/tezos-protocol-plugin-alpha-tests.opam index cfc304235fc15fee34188b2ab759d80ac535ba65..6e95ff3f439aa2a6f8a906517a4aa83c74b41cb1 100644 --- a/opam/tezos-protocol-plugin-alpha-tests.opam +++ b/opam/tezos-protocol-plugin-alpha-tests.opam @@ -13,14 +13,13 @@ depends: [ "tezt" { with-test & >= "3.0.0" } "tezos-base" {with-test} "tezos-base-test-helpers" {with-test} - "octez-alcotezt" {with-test} + "tezos-alpha-test-helpers" {with-test} "tezos-test-helpers" {with-test} "qcheck-alcotest" { with-test & >= "0.20" } "tezos-stdlib-unix" {with-test} "tezos-micheline" {with-test} "tezos-protocol-plugin-alpha" {with-test} "tezos-protocol-alpha" {with-test} - "tezos-alpha-test-helpers" {with-test} ] build: [ ["rm" "-r" "vendors"] diff --git a/src/proto_015_PtLimaPt/lib_client/test/dune b/src/proto_015_PtLimaPt/lib_client/test/dune index f7692ec3c150601cb989c3ec2a2ab0bdd8417da6..7b0c1b7419185366b1c6d8a5f3f0558c20d95d2e 100644 --- a/src/proto_015_PtLimaPt/lib_client/test/dune +++ b/src/proto_015_PtLimaPt/lib_client/test/dune @@ -12,7 +12,7 @@ tezos-protocol-015-PtLimaPt tezos-base-test-helpers tezos-test-helpers - octez-alcotezt + octez-protocol-alcotezt qcheck-alcotest) (library_flags (:standard -linkall)) (flags @@ -26,7 +26,7 @@ -open Tezos_protocol_015_PtLimaPt -open Tezos_base_test_helpers -open Tezos_test_helpers - -open Octez_alcotezt) + -open Octez_protocol_alcotezt) (modules test_michelson_v1_macros test_client_proto_contracts diff --git a/src/proto_015_PtLimaPt/lib_client/test/test_client_proto_context.ml b/src/proto_015_PtLimaPt/lib_client/test/test_client_proto_context.ml index 0c6b2eab531afa3da61a06bf0f01405b5dd96125..f8b187fb4a822864bbeb8e0f074dca1a39a96e2f 100644 --- a/src/proto_015_PtLimaPt/lib_client/test/test_client_proto_context.ml +++ b/src/proto_015_PtLimaPt/lib_client/test/test_client_proto_context.ml @@ -66,7 +66,9 @@ let tests = ] let () = - Alcotest.run + let protocol = (module Protocol : Tezt_protocol.PROTOCOL) in + Protocol_alcotest.run + protocol ~__FILE__ "Client proto context" - [(Protocol.name ^ ": Encodings", qcheck_wrap tests)] + [("Encodings", qcheck_wrap tests)] diff --git a/src/proto_015_PtLimaPt/lib_client/test/test_client_proto_contracts.ml b/src/proto_015_PtLimaPt/lib_client/test/test_client_proto_contracts.ml index b02710728a08a42f0fe22aa4dbf3ec5b1ce0a5f6..7380b3d1bfd818ef7c0b34d38faf8ba242abd809 100644 --- a/src/proto_015_PtLimaPt/lib_client/test/test_client_proto_contracts.ml +++ b/src/proto_015_PtLimaPt/lib_client/test/test_client_proto_contracts.ml @@ -88,11 +88,13 @@ let test_find_destination _ = test "Expected test_alias bootstrap1" "test_alias" bootstrap1 let () = - Alcotest_lwt.run + let protocol = (module Protocol : Tezt_protocol.PROTOCOL) in + Protocol_alcotest_lwt.run + protocol ~__FILE__ "tezos-lib-client-proto-contracts" [ - ( Protocol.name ^ ": client_proto_contracts", + ( "client_proto_contracts", [Tztest.tztest "test_find_destination" `Quick test_find_destination] ); ] |> Lwt_main.run diff --git a/src/proto_015_PtLimaPt/lib_client/test/test_michelson_v1_macros.ml b/src/proto_015_PtLimaPt/lib_client/test/test_michelson_v1_macros.ml index 17a0817f5914c11b37c2a39c875e4a10bf0e396a..fd80d54498908b7238bac8cfd4c8d11f9ff43e5e 100644 --- a/src/proto_015_PtLimaPt/lib_client/test/test_michelson_v1_macros.ml +++ b/src/proto_015_PtLimaPt/lib_client/test/test_michelson_v1_macros.ml @@ -1340,8 +1340,10 @@ let wrap (n, f) = Format.kasprintf Stdlib.failwith "%a" pp_print_trace error) let () = - Alcotest_lwt.run + let protocol = (module Protocol : Tezt_protocol.PROTOCOL) in + Protocol_alcotest_lwt.run + protocol ~__FILE__ "tezos-lib-client" - [(Protocol.name ^ ": micheline v1 macros", List.map wrap tests)] + [("micheline v1 macros", List.map wrap tests)] |> Lwt_main.run diff --git a/src/proto_015_PtLimaPt/lib_client/test/test_proxy.ml b/src/proto_015_PtLimaPt/lib_client/test/test_proxy.ml index f6249ec45578283aff401cfd0f1606ef43c07d8e..a7894fa8e7d8f7f809ac852c5d6f2c55661cb288 100644 --- a/src/proto_015_PtLimaPt/lib_client/test/test_proxy.ml +++ b/src/proto_015_PtLimaPt/lib_client/test/test_proxy.ml @@ -83,7 +83,9 @@ let test_split_key = key let () = - Alcotest.run + let protocol = (module Protocol : Tezt_protocol.PROTOCOL) in + Protocol_alcotest.run + protocol ~__FILE__ "tezos-lib-client-proxy" - [(Protocol.name ^ ": proxy", Qcheck2_helpers.qcheck_wrap [test_split_key])] + [("proxy", Qcheck2_helpers.qcheck_wrap [test_split_key])] diff --git a/src/proto_015_PtLimaPt/lib_delegate/test/dune b/src/proto_015_PtLimaPt/lib_delegate/test/dune index a0bf2ea9ab74740837daaf4a5b9d4096e52fac2d..d5072b1d4b0df51a9f84210aa938877bf21f299a 100644 --- a/src/proto_015_PtLimaPt/lib_delegate/test/dune +++ b/src/proto_015_PtLimaPt/lib_delegate/test/dune @@ -15,7 +15,7 @@ tezos-baking-015-PtLimaPt tezos-protocol-015-PtLimaPt.parameters tezos-crypto - octez-alcotezt + tezos-015-PtLimaPt-test-helpers.alcotezt uri) (library_flags (:standard -linkall)) (flags @@ -30,7 +30,7 @@ -open Tezos_base_test_helpers -open Tezos_015_PtLimaPt_mockup_simulator -open Tezos_baking_015_PtLimaPt - -open Octez_alcotezt) + -open Tezos_015_PtLimaPt_test_helpers_alcotezt) (modules test_scenario)) (executable diff --git a/src/proto_015_PtLimaPt/lib_delegate/test/test_scenario.ml b/src/proto_015_PtLimaPt/lib_delegate/test/test_scenario.ml index ee881c2dd46d33b106246ad2bfc2916804b05c2f..0badabcfb563f59f0c577ecb776e5d88d902122d 100644 --- a/src/proto_015_PtLimaPt/lib_delegate/test/test_scenario.ml +++ b/src/proto_015_PtLimaPt/lib_delegate/test/test_scenario.ml @@ -1472,20 +1472,20 @@ let () = let open Tezos_base_test_helpers.Tztest in (title, [tztest title `Quick body])) [ - (Protocol.name ^ ": reaches level 5", test_level_5); - (Protocol.name ^ ": scenario t1", test_scenario_t1); - (Protocol.name ^ ": scenario t2", test_scenario_t2); - (Protocol.name ^ ": scenario t3", test_scenario_t3); + ("reaches level 5", test_level_5); + ("scenario t1", test_scenario_t1); + ("scenario t2", test_scenario_t2); + ("scenario t3", test_scenario_t3); (* See issue https://gitlab.com/nomadic-labs/tezos/-/issues/518 *) (* tztest "scenario f1" `Quick test_scenario_f1; *) - (Protocol.name ^ ": scenario f2", test_scenario_f2); - (Protocol.name ^ ": scenario m1", test_scenario_m1); - (Protocol.name ^ ": scenario m2", test_scenario_m2); - (Protocol.name ^ ": scenario m3", test_scenario_m3); - (Protocol.name ^ ": scenario m4", test_scenario_m4); - (Protocol.name ^ ": scenario m5", test_scenario_m5); - (Protocol.name ^ ": scenario m6", test_scenario_m6); - (Protocol.name ^ ": scenario m7", test_scenario_m7); - (Protocol.name ^ ": scenario m8", test_scenario_m8); + ("scenario f2", test_scenario_f2); + ("scenario m1", test_scenario_m1); + ("scenario m2", test_scenario_m2); + ("scenario m3", test_scenario_m3); + ("scenario m4", test_scenario_m4); + ("scenario m5", test_scenario_m5); + ("scenario m6", test_scenario_m6); + ("scenario m7", test_scenario_m7); + ("scenario m8", test_scenario_m8); ] |> Lwt_main.run diff --git a/src/proto_015_PtLimaPt/lib_plugin/test/dune b/src/proto_015_PtLimaPt/lib_plugin/test/dune index a152e5acfc9b14700d2ce0815ec360db31370d66..3158de2468a50d06e4289f34395c73ae433b9d7b 100644 --- a/src/proto_015_PtLimaPt/lib_plugin/test/dune +++ b/src/proto_015_PtLimaPt/lib_plugin/test/dune @@ -9,7 +9,7 @@ tezos-base tezos-base-test-helpers tezos-base.unix - octez-alcotezt + tezos-015-PtLimaPt-test-helpers.alcotezt tezos-test-helpers qcheck-alcotest tezos-stdlib-unix @@ -26,7 +26,7 @@ -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_base_test_helpers - -open Octez_alcotezt + -open Tezos_015_PtLimaPt_test_helpers_alcotezt -open Tezos_test_helpers -open Tezos_micheline -open Tezos_protocol_plugin_015_PtLimaPt diff --git a/src/proto_015_PtLimaPt/lib_plugin/test/test_conflict_handler.ml b/src/proto_015_PtLimaPt/lib_plugin/test/test_conflict_handler.ml index b03ddf977774b9e7c8a76f81dadccf626a9cecfd..98daf4ca84de11996f024d34cd1cc6827c9a6e85 100644 --- a/src/proto_015_PtLimaPt/lib_plugin/test/test_conflict_handler.ml +++ b/src/proto_015_PtLimaPt/lib_plugin/test/test_conflict_handler.ml @@ -263,7 +263,7 @@ let () = ~__FILE__ "conflict_handler" [ - ( Protocol.name ^ ": conflict_handler", + ( "conflict_handler", [ Tztest.tztest "Random operations (not both manager)" diff --git a/src/proto_015_PtLimaPt/lib_plugin/test/test_consensus_filter.ml b/src/proto_015_PtLimaPt/lib_plugin/test/test_consensus_filter.ml index 1445191ab587d742084d6518beee8373b05c0710..d467b88706d6f40a3cd21a889923de479b007565 100644 --- a/src/proto_015_PtLimaPt/lib_plugin/test/test_consensus_filter.ml +++ b/src/proto_015_PtLimaPt/lib_plugin/test/test_consensus_filter.ml @@ -436,7 +436,7 @@ let () = ~__FILE__ "Filter" [ - ( Protocol.name ^ ": pre_filter", + ( "pre_filter", qcheck_wrap [ test_acceptable_past_level; diff --git a/src/proto_015_PtLimaPt/lib_plugin/test/test_filter_state.ml b/src/proto_015_PtLimaPt/lib_plugin/test/test_filter_state.ml index ceec327fa278c5c00a072f5ac20dcf67e010f8e8..25b798c8c9b07d8707fa71c16f85d61fb61b350b 100644 --- a/src/proto_015_PtLimaPt/lib_plugin/test/test_filter_state.ml +++ b/src/proto_015_PtLimaPt/lib_plugin/test/test_filter_state.ml @@ -188,7 +188,6 @@ let () = ~__FILE__ "Filter_state" [ - (Protocol.name ^ ": add_manager_op", qcheck_wrap [test_add_manager_op]); - ( Protocol.name ^ ": remove", - qcheck_wrap [test_remove_present; test_remove_unknown] ); + ("add_manager_op", qcheck_wrap [test_add_manager_op]); + ("remove", qcheck_wrap [test_remove_present; test_remove_unknown]); ] diff --git a/src/proto_015_PtLimaPt/lib_plugin/test/test_plugin.ml b/src/proto_015_PtLimaPt/lib_plugin/test/test_plugin.ml index ab7ee537350c2464dba17f41bacf38d22d1f9fda..cd3f3815350b669e5cd071566053f661856a385c 100644 --- a/src/proto_015_PtLimaPt/lib_plugin/test/test_plugin.ml +++ b/src/proto_015_PtLimaPt/lib_plugin/test/test_plugin.ml @@ -72,7 +72,7 @@ let () = ~__FILE__ "Plugin" [ - ( Protocol.name ^ ": on_flush", + ( "on_flush", [ Tztest.tztest "[on_flush ~validation_state ...] yields an empty state " diff --git a/src/proto_015_PtLimaPt/lib_protocol/test/helpers/alcotezt/alcotest.ml b/src/proto_015_PtLimaPt/lib_protocol/test/helpers/alcotezt/alcotest.ml new file mode 100644 index 0000000000000000000000000000000000000000..faa66ffe9592e29abb356f81470944c36db9a1bb --- /dev/null +++ b/src/proto_015_PtLimaPt/lib_protocol/test/helpers/alcotezt/alcotest.ml @@ -0,0 +1,28 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2023 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. *) +(* *) +(*****************************************************************************) + +include Octez_protocol_alcotezt.Protocol_alcotest + +let run = Octez_protocol_alcotezt.Protocol_alcotest.run Tezt_protocol.protocol diff --git a/src/proto_015_PtLimaPt/lib_protocol/test/helpers/alcotezt/alcotest.mli b/src/proto_015_PtLimaPt/lib_protocol/test/helpers/alcotezt/alcotest.mli new file mode 100644 index 0000000000000000000000000000000000000000..b3188151e2215076a3e92bebfeb4139334304f9d --- /dev/null +++ b/src/proto_015_PtLimaPt/lib_protocol/test/helpers/alcotezt/alcotest.mli @@ -0,0 +1,43 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2023 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. *) +(* *) +(*****************************************************************************) + +(** Protocol-specific Alcotezt wrapper. *) + +(** This modules shadows the function [run] in + [Octez_alcotezt.Alcotest] to automatically add the protocol name + to the title and tags of registered tests. *) +include module type of Octez_alcotezt.Alcotest + +(** Shadowed version of {!Octez_alcotezt.Alcotest.run}, with + protocol-prefixed titles and protocol-specific tags. + + This modules shadows the function [run] in + [Octez_alcotezt.Alcotest] to prefix Alcotest suite names with the + "pretty" version of the protocol name (e.g. [Alpha], [Mumbai], + ... ). It also adds a tag to each registered test identifying the + test. As in integration tests, this is the pretty name lowercased + (e.g. [alpha], [mumbai]). *) +val run : + __FILE__:string -> ?tags:string list -> string -> unit test list -> return diff --git a/src/proto_015_PtLimaPt/lib_protocol/test/helpers/alcotezt/alcotest_lwt.ml b/src/proto_015_PtLimaPt/lib_protocol/test/helpers/alcotezt/alcotest_lwt.ml new file mode 100644 index 0000000000000000000000000000000000000000..1214d7e3c937576575a2475d2bc5178f228f84f3 --- /dev/null +++ b/src/proto_015_PtLimaPt/lib_protocol/test/helpers/alcotezt/alcotest_lwt.ml @@ -0,0 +1,29 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2023 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. *) +(* *) +(*****************************************************************************) + +include Octez_protocol_alcotezt.Protocol_alcotest_lwt + +let run = + Octez_protocol_alcotezt.Protocol_alcotest_lwt.run Tezt_protocol.protocol diff --git a/src/proto_015_PtLimaPt/lib_protocol/test/helpers/alcotezt/alcotest_lwt.mli b/src/proto_015_PtLimaPt/lib_protocol/test/helpers/alcotezt/alcotest_lwt.mli new file mode 100644 index 0000000000000000000000000000000000000000..a02fe4aa0d90ab9ee293542d946e011bae851ff4 --- /dev/null +++ b/src/proto_015_PtLimaPt/lib_protocol/test/helpers/alcotezt/alcotest_lwt.mli @@ -0,0 +1,43 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2023 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. *) +(* *) +(*****************************************************************************) + +(** Protocol-specific Alcotezt_lwt wrapper. *) + +(** This modules shadows the function [run] in + [Octez_alcotezt.Alcotest_lwt] to automatically add the protocol name + to the title and tags of registered tests. *) +include module type of Octez_alcotezt.Alcotest_lwt + +(** Shadowed version of {!Octez_alcotezt.Alcotest_lwt.run}, with + protocol-prefixed titles and protocol-specific tags. + + This modules shadows the function [run] in + [Octez_alcotezt.Alcotest] to prefix Alcotest suite names with the + "pretty" version of the protocol name (e.g. [Alpha], [Mumbai], + ... ). It also adds a tag to each registered test identifying the + test. As in integration tests, this is the pretty name lowercased + (e.g. [alpha], [mumbai]). *) +val run : + __FILE__:string -> ?tags:string list -> string -> unit test list -> return diff --git a/src/proto_015_PtLimaPt/lib_protocol/test/helpers/alcotezt/dune b/src/proto_015_PtLimaPt/lib_protocol/test/helpers/alcotezt/dune new file mode 100644 index 0000000000000000000000000000000000000000..a70d31ab3c5c704390eae40837f428ccbf6880e4 --- /dev/null +++ b/src/proto_015_PtLimaPt/lib_protocol/test/helpers/alcotezt/dune @@ -0,0 +1,15 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(library + (name tezos_015_PtLimaPt_test_helpers_alcotezt) + (public_name tezos-015-PtLimaPt-test-helpers.alcotezt) + (instrumentation (backend bisect_ppx)) + (libraries + tezos-protocol-environment + tezos-protocol-015-PtLimaPt + octez-protocol-alcotezt) + (flags + (:standard) + -open Tezos_protocol_015_PtLimaPt + -open Octez_protocol_alcotezt)) diff --git a/src/proto_015_PtLimaPt/lib_protocol/test/helpers/alcotezt/tezt_protocol.ml b/src/proto_015_PtLimaPt/lib_protocol/test/helpers/alcotezt/tezt_protocol.ml new file mode 100644 index 0000000000000000000000000000000000000000..77a32313194208d6bfc4a92e8038458500e0c0a2 --- /dev/null +++ b/src/proto_015_PtLimaPt/lib_protocol/test/helpers/alcotezt/tezt_protocol.ml @@ -0,0 +1,33 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2023 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. *) +(* *) +(*****************************************************************************) + +let protocol = + (module Protocol : Octez_protocol_alcotezt.Tezt_protocol.PROTOCOL) + +let tag = + (* Get protocol tag from Tezt_tezos *) + Octez_protocol_alcotezt.Tezt_protocol.tag protocol + +let name = Octez_protocol_alcotezt.Tezt_protocol.name protocol diff --git a/src/proto_015_PtLimaPt/lib_protocol/test/helpers/alcotezt/tezt_protocol.mli b/src/proto_015_PtLimaPt/lib_protocol/test/helpers/alcotezt/tezt_protocol.mli new file mode 100644 index 0000000000000000000000000000000000000000..4fc2d66a4608a2bf7bb9ab75d11b8d815e086ff1 --- /dev/null +++ b/src/proto_015_PtLimaPt/lib_protocol/test/helpers/alcotezt/tezt_protocol.mli @@ -0,0 +1,36 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2023 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. *) +(* *) +(*****************************************************************************) + +val protocol : Octez_protocol_alcotezt.Tezt_protocol.protocol + +(** TODO: document *) +val name : string + +(** The protocol-specific Tezt tag of this prototcol + + The protocol tag is the same as defined by + {!Tezt_tezos.Protocol.tag}, that is, the lower-cased "pretty" name + of the protocol (e.g. [Alpha], [Mumbai], ...). *) +val tag : string diff --git a/src/proto_015_PtLimaPt/lib_protocol/test/integration/consensus/dune b/src/proto_015_PtLimaPt/lib_protocol/test/integration/consensus/dune index 05454121a76474a7f3b3e73a1380975648d94c11..21bbbbbbd3f5fd1b1902ec2656ad5d24fc2313c0 100644 --- a/src/proto_015_PtLimaPt/lib_protocol/test/integration/consensus/dune +++ b/src/proto_015_PtLimaPt/lib_protocol/test/integration/consensus/dune @@ -7,7 +7,7 @@ (instrumentation (backend bisect_ppx)) (libraries tezt.core - octez-alcotezt + tezos-015-PtLimaPt-test-helpers.alcotezt tezos-base tezos-protocol-015-PtLimaPt tezos-015-PtLimaPt-test-helpers @@ -19,7 +19,7 @@ (:standard) -open Tezt_core -open Tezt_core.Base - -open Octez_alcotezt + -open Tezos_015_PtLimaPt_test_helpers_alcotezt -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_015_PtLimaPt diff --git a/src/proto_015_PtLimaPt/lib_protocol/test/integration/consensus/test_main.ml b/src/proto_015_PtLimaPt/lib_protocol/test/integration/consensus/test_main.ml index 34d4f8da29d4a9b23a2c66340d363d1ee4abc966..2594ebf614e0b9eb78a2589f119b266948b994eb 100644 --- a/src/proto_015_PtLimaPt/lib_protocol/test/integration/consensus/test_main.ml +++ b/src/proto_015_PtLimaPt/lib_protocol/test/integration/consensus/test_main.ml @@ -35,19 +35,18 @@ let () = ~__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); + ("endorsement", Test_endorsement.tests); + ("preendorsement", Test_preendorsement.tests); + ("double endorsement", Test_double_endorsement.tests); + ("double preendorsement", Test_double_preendorsement.tests); + ("double baking", Test_double_baking.tests); + ("seed", Test_seed.tests); + ("baking", Test_baking.tests); + ("delegation", Test_delegation.tests); + ("deactivation", Test_deactivation.tests); + ("helpers rpcs", Test_helpers_rpcs.tests); + ("participation monitoring", Test_participation.tests); + ("frozen deposits", Test_frozen_deposits.tests); + ("consensus key", Test_consensus_key.tests); ] |> Lwt_main.run diff --git a/src/proto_015_PtLimaPt/lib_protocol/test/integration/dune b/src/proto_015_PtLimaPt/lib_protocol/test/integration/dune index 49409ef787e2d04f55c1428907848c4ed772d7cb..4f5841f2d53483213e0637fb3df58cb6339114a9 100644 --- a/src/proto_015_PtLimaPt/lib_protocol/test/integration/dune +++ b/src/proto_015_PtLimaPt/lib_protocol/test/integration/dune @@ -8,7 +8,7 @@ tezt.core tezt tezos-context - octez-alcotezt + tezos-015-PtLimaPt-test-helpers.alcotezt tezos-base tezos-client-015-PtLimaPt tezos-protocol-015-PtLimaPt @@ -20,7 +20,7 @@ (:standard) -open Tezt_core -open Tezt_core.Base - -open Octez_alcotezt + -open Tezos_015_PtLimaPt_test_helpers_alcotezt -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_client_015_PtLimaPt diff --git a/src/proto_015_PtLimaPt/lib_protocol/test/integration/gas/dune b/src/proto_015_PtLimaPt/lib_protocol/test/integration/gas/dune index 573319b558ab6efb11ae6342cd617a16753195a7..54ceb476a7e7283059f3220c8dfbd65bbbc9542b 100644 --- a/src/proto_015_PtLimaPt/lib_protocol/test/integration/gas/dune +++ b/src/proto_015_PtLimaPt/lib_protocol/test/integration/gas/dune @@ -6,7 +6,7 @@ (instrumentation (backend bisect_ppx)) (libraries tezt.core - octez-alcotezt + tezos-015-PtLimaPt-test-helpers.alcotezt tezos-base tezos-protocol-015-PtLimaPt tezos-015-PtLimaPt-test-helpers @@ -16,7 +16,7 @@ (:standard) -open Tezt_core -open Tezt_core.Base - -open Octez_alcotezt + -open Tezos_015_PtLimaPt_test_helpers_alcotezt -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_015_PtLimaPt diff --git a/src/proto_015_PtLimaPt/lib_protocol/test/integration/gas/test_main.ml b/src/proto_015_PtLimaPt/lib_protocol/test/integration/gas/test_main.ml index 862e20583b523f70b840f965b2490a3cc6bf59b2..8ee336524573bd68a950f3079e9435ab72e8901a 100644 --- a/src/proto_015_PtLimaPt/lib_protocol/test/integration/gas/test_main.ml +++ b/src/proto_015_PtLimaPt/lib_protocol/test/integration/gas/test_main.ml @@ -35,7 +35,7 @@ let () = ~__FILE__ "protocol > integration > gas" [ - (Protocol.name ^ ": gas levels", Test_gas_levels.tests); - (Protocol.name ^ ": gas cost functions", Test_gas_costs.tests); + ("gas levels", Test_gas_levels.tests); + ("gas cost functions", Test_gas_costs.tests); ] |> Lwt_main.run diff --git a/src/proto_015_PtLimaPt/lib_protocol/test/integration/michelson/dune b/src/proto_015_PtLimaPt/lib_protocol/test/integration/michelson/dune index fac126ca4354a9ab92e890b5f717ccbe6bebc036..07c9116178fe0f6dad85ea16560542f68449355b 100644 --- a/src/proto_015_PtLimaPt/lib_protocol/test/integration/michelson/dune +++ b/src/proto_015_PtLimaPt/lib_protocol/test/integration/michelson/dune @@ -7,7 +7,7 @@ (instrumentation (backend bisect_ppx)) (libraries tezt.core - octez-alcotezt + tezos-015-PtLimaPt-test-helpers.alcotezt tezos-base tezos-protocol-015-PtLimaPt tezos-015-PtLimaPt-test-helpers @@ -24,7 +24,7 @@ (:standard) -open Tezt_core -open Tezt_core.Base - -open Octez_alcotezt + -open Tezos_015_PtLimaPt_test_helpers_alcotezt -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_015_PtLimaPt diff --git a/src/proto_015_PtLimaPt/lib_protocol/test/integration/michelson/test_main.ml b/src/proto_015_PtLimaPt/lib_protocol/test/integration/michelson/test_main.ml index e47592aff7ed916f2fb69cea6701f33c678cbb81..2e945bf27c145093bd3902e11cc127f04dda0e3c 100644 --- a/src/proto_015_PtLimaPt/lib_protocol/test/integration/michelson/test_main.ml +++ b/src/proto_015_PtLimaPt/lib_protocol/test/integration/michelson/test_main.ml @@ -35,30 +35,26 @@ let () = ~__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 ^ ": timelock", Test_timelock.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); + ("global table of constants", Test_global_constants_storage.tests); + ("interpretation", Test_interpretation.tests); + ("lazy storage diff", Test_lazy_storage_diff.tests); + ("sapling", Test_sapling.tests); + ("script typed ir size", Test_script_typed_ir_size.tests); + ("temp big maps", Test_temp_big_maps.tests); + ("ticket balance key", Test_ticket_balance_key.tests); + ("ticket scanner", Test_ticket_scanner.tests); + ("ticket storage", Test_ticket_storage.tests); + ("ticket lazy storage diff", Test_ticket_lazy_storage_diff.tests); + ("ticket operations diff", Test_ticket_operations_diff.tests); + ("ticket accounting", Test_ticket_accounting.tests); + ("ticket balance", Test_ticket_balance.tests); + ("ticket manager", Test_ticket_manager.tests); + ("timelock", Test_timelock.tests); + ("typechecking", Test_typechecking.tests); + ("script cache", Test_script_cache.tests); + ("block time instructions", Test_block_time_instructions.tests); + ("annotations", Test_annotations.tests); + ("event logging", Test_contract_event.tests); + ("patched contracts", Test_patched_contracts.tests); ] |> Lwt_main.run diff --git a/src/proto_015_PtLimaPt/lib_protocol/test/integration/operations/dune b/src/proto_015_PtLimaPt/lib_protocol/test/integration/operations/dune index 9e51741182b8c1f3ce345b760ff2da9bffacb2ae..b3489bdeef6a03a3490dc4988c84b2bd7a70a726 100644 --- a/src/proto_015_PtLimaPt/lib_protocol/test/integration/operations/dune +++ b/src/proto_015_PtLimaPt/lib_protocol/test/integration/operations/dune @@ -7,7 +7,7 @@ (instrumentation (backend bisect_ppx)) (libraries tezt.core - octez-alcotezt + tezos-015-PtLimaPt-test-helpers.alcotezt tezos-base tezos-protocol-015-PtLimaPt tezos-client-015-PtLimaPt @@ -19,7 +19,7 @@ (:standard) -open Tezt_core -open Tezt_core.Base - -open Octez_alcotezt + -open Tezos_015_PtLimaPt_test_helpers_alcotezt -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_015_PtLimaPt diff --git a/src/proto_015_PtLimaPt/lib_protocol/test/integration/operations/test_main.ml b/src/proto_015_PtLimaPt/lib_protocol/test/integration/operations/test_main.ml index 3c5658553cd37913e753bd1d823f982ef5e0b8ab..1d06a8f580b4627c385cd17437233f68ac20d2bf 100644 --- a/src/proto_015_PtLimaPt/lib_protocol/test/integration/operations/test_main.ml +++ b/src/proto_015_PtLimaPt/lib_protocol/test/integration/operations/test_main.ml @@ -35,16 +35,15 @@ let () = ~__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 ^ ": zk rollup", Test_zk_rollup.tests); + ("voting", Test_voting.tests); + ("origination", Test_origination.tests); + ("revelation", Test_reveal.tests); + ("transfer", Test_transfer.tests); + ("activation", Test_activation.tests); + ("paid storage increase", Test_paid_storage_increase.tests); + ("combined", Test_combined_operations.tests); + ("failing_noop operation", Test_failing_noop.tests); + ("tx rollup", Test_tx_rollup.tests); + ("zk rollup", Test_zk_rollup.tests); ] |> Lwt_main.run diff --git a/src/proto_015_PtLimaPt/lib_protocol/test/integration/test_main.ml b/src/proto_015_PtLimaPt/lib_protocol/test/integration/test_main.ml index 54cbc766cbe689c60f3103fdb90338402addda39..7109657836274d7ec93fd2cc2725b53e650e9af6 100644 --- a/src/proto_015_PtLimaPt/lib_protocol/test/integration/test_main.ml +++ b/src/proto_015_PtLimaPt/lib_protocol/test/integration/test_main.ml @@ -35,11 +35,11 @@ let () = ~__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); + ("constants", Test_constants.tests); + ("liquidity baking", Test_liquidity_baking.tests); + ("storage description", Test_storage.tests); + ("storage tests", Test_storage_functions.tests); + ("token movements", Test_token.tests); + ("frozen bonds", Test_frozen_bonds.tests); ] |> Lwt_main.run diff --git a/src/proto_015_PtLimaPt/lib_protocol/test/integration/validate/dune b/src/proto_015_PtLimaPt/lib_protocol/test/integration/validate/dune index 61207942f9390bf14d7d1e2d295765f0bfd47afb..e1303620da50526c83f555cd783e9b06e54dfc27 100644 --- a/src/proto_015_PtLimaPt/lib_protocol/test/integration/validate/dune +++ b/src/proto_015_PtLimaPt/lib_protocol/test/integration/validate/dune @@ -6,7 +6,7 @@ (instrumentation (backend bisect_ppx)) (libraries tezt.core - octez-alcotezt + tezos-015-PtLimaPt-test-helpers.alcotezt tezos-base tezos-protocol-015-PtLimaPt qcheck-alcotest @@ -20,7 +20,7 @@ (:standard) -open Tezt_core -open Tezt_core.Base - -open Octez_alcotezt + -open Tezos_015_PtLimaPt_test_helpers_alcotezt -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_015_PtLimaPt diff --git a/src/proto_015_PtLimaPt/lib_protocol/test/integration/validate/test_main.ml b/src/proto_015_PtLimaPt/lib_protocol/test/integration/validate/test_main.ml index ab292b309a3caf1ef6e7b289ca234f103cb21fec..c793b3f29e20a574a2918740aa6afdebf0919a06 100644 --- a/src/proto_015_PtLimaPt/lib_protocol/test/integration/validate/test_main.ml +++ b/src/proto_015_PtLimaPt/lib_protocol/test/integration/validate/test_main.ml @@ -35,13 +35,11 @@ let () = ~__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); + ("sanity checks", Test_sanity.tests); + ("mempool", Test_mempool.tests); + ("single manager validation", Test_manager_operation_validation.tests); + ("batched managers validation", Test_validation_batch.tests); + ("one-manager restriction", Test_1m_restriction.tests); + ("covalidity", Test_covalidity.tests); ] |> Lwt_main.run diff --git a/src/proto_015_PtLimaPt/lib_protocol/test/pbt/dune b/src/proto_015_PtLimaPt/lib_protocol/test/pbt/dune index 9e27814843172c89a5c9bd77313eccfb15d76064..5a149a0d84caf1b02824cce52a0e64173264dfe7 100644 --- a/src/proto_015_PtLimaPt/lib_protocol/test/pbt/dune +++ b/src/proto_015_PtLimaPt/lib_protocol/test/pbt/dune @@ -13,7 +13,7 @@ tezos-context.merkle_proof_encoding tezos-test-helpers tezos-015-PtLimaPt-test-helpers - octez-alcotezt + tezos-015-PtLimaPt-test-helpers.alcotezt qcheck-alcotest tezos-benchmark tezos-benchmark-015-PtLimaPt @@ -29,7 +29,7 @@ -open Tezos_protocol_015_PtLimaPt -open Tezos_test_helpers -open Tezos_015_PtLimaPt_test_helpers - -open Octez_alcotezt + -open Tezos_015_PtLimaPt_test_helpers_alcotezt -open Tezos_benchmark_015_PtLimaPt -open Tezos_benchmark_type_inference_015_PtLimaPt) (modules diff --git a/src/proto_015_PtLimaPt/lib_protocol/test/pbt/liquidity_baking_pbt.ml b/src/proto_015_PtLimaPt/lib_protocol/test/pbt/liquidity_baking_pbt.ml index fe4ac035fa082a78e57410ef6e25654633ca5eb5..379e2f28665bdadffe87da269664849092553f09 100644 --- a/src/proto_015_PtLimaPt/lib_protocol/test/pbt/liquidity_baking_pbt.ml +++ b/src/proto_015_PtLimaPt/lib_protocol/test/pbt/liquidity_baking_pbt.ml @@ -315,7 +315,6 @@ let _ = ~__FILE__ "protocol > pbt > liquidity baking" [ - ( 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_015_PtLimaPt/lib_protocol/test/pbt/saturation_fuzzing.ml b/src/proto_015_PtLimaPt/lib_protocol/test/pbt/saturation_fuzzing.ml index 1e119503a8d859e1e21139a05985a8216dd5d64c..d53c4fd33eae0a93840ba1c92902d03acf81bd88 100644 --- a/src/proto_015_PtLimaPt/lib_protocol/test/pbt/saturation_fuzzing.ml +++ b/src/proto_015_PtLimaPt/lib_protocol/test/pbt/saturation_fuzzing.ml @@ -192,10 +192,10 @@ let () = ~__FILE__ "protocol > pbt > saturation" [ - (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_015_PtLimaPt/lib_protocol/test/pbt/test_bitset.ml b/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_bitset.ml index f89eb3b1ecb359c5e898be3ae5ccc170b91b2e7d..5b7faffe61e3f4c1c11c558a94bf0f73236bfa9f 100644 --- a/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_bitset.ml +++ b/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_bitset.ml @@ -110,7 +110,7 @@ let () = ~__FILE__ "bits" [ - ( Protocol.name ^ ": quantity", + ( "quantity", qcheck_wrap [ QCheck2.Test.make diff --git a/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_carbonated_map.ml b/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_carbonated_map.ml index d51f2a14cd67d088a4afcc9186ddef65a3498cfb..44f1a282061e9cb974c7e3cc55c5fcf4709fc89b 100644 --- a/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_carbonated_map.ml +++ b/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_carbonated_map.ml @@ -551,4 +551,4 @@ let () = Alcotest.run ~__FILE__ "protocol > pbt > carbonated map" - [(Protocol.name ^ ": Carbonated map", tests ~rand)] + [("Carbonated map", tests ~rand)] diff --git a/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_compare_operations.ml b/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_compare_operations.ml index 0623fedda4d292a4d9cf73c34613a6d385646986..adca6cbd90c2caae69e6791dad688427acc66f66 100644 --- a/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_compare_operations.ml +++ b/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_compare_operations.ml @@ -98,6 +98,4 @@ let () = Alcotest.run ~__FILE__ "Compare operations" - [ - (Protocol.name ^ ": Compare_operations", Qcheck2_helpers.qcheck_wrap tests); - ] + [("Compare_operations", Qcheck2_helpers.qcheck_wrap tests)] diff --git a/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_gas_properties.ml b/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_gas_properties.ml index caeebd9adbdbb8f18bff40a03286f144ee218a68..0c6d38ccd8dbf5f73c1773d675409c1b8a2175d2 100644 --- a/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_gas_properties.ml +++ b/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_gas_properties.ml @@ -143,4 +143,4 @@ let () = Alcotest.run ~__FILE__ "protocol > pbt > gas" - [(Protocol.name ^ ": gas properties", qcheck_wrap tests)] + [("gas properties", qcheck_wrap tests)] diff --git a/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_merkle_list.ml b/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_merkle_list.ml index b2b3162e9aa3ba061d11469a4affa7ed09a55bc5..4dd30ce27650d45f024ff4ac9d0bb1da90451d97 100644 --- a/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_merkle_list.ml +++ b/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_merkle_list.ml @@ -113,13 +113,13 @@ let () = ~__FILE__ "Merkle list" [ - ( 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_015_PtLimaPt/lib_protocol/test/pbt/test_sampler.ml b/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_sampler.ml index f6abf5757f864e8dba5ff906a030df70131cc768..2203586703126a8d22fe4648cbd29ae2da05f1be 100644 --- a/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_sampler.ml +++ b/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_sampler.ml @@ -267,7 +267,4 @@ let () = Alcotest.run ~__FILE__ "protocol > pbt > sampling" - [ - ( Protocol.name ^ ": sampling", - qcheck_wrap [alias_float_test; alias_z_test] ); - ] + [("sampling", qcheck_wrap [alias_float_test; alias_z_test])] diff --git a/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_script_comparison.ml b/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_script_comparison.ml index 0b036240d076cb9d6b4646e0bbd6d5a825fb1ef8..5911f0e71c398daf1669c3ae99feb8189a369eb5 100644 --- a/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_script_comparison.ml +++ b/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_script_comparison.ml @@ -348,12 +348,10 @@ let () = ~__FILE__ "protocol > pbt > script_comparison" [ - ( 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_015_PtLimaPt/lib_protocol/test/pbt/test_tez_repr.ml b/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_tez_repr.ml index c6af5fbf48edc9457cf12253eee2b86d9a0b359b..395c8ebf44a16be870788d096fcb017876c4ebc5 100644 --- a/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_tez_repr.ml +++ b/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_tez_repr.ml @@ -133,4 +133,4 @@ let () = Alcotest.run ~__FILE__ "protocol > pbt > tez_repr" - [(Protocol.name ^ ": Tez_repr", Qcheck2_helpers.qcheck_wrap tests)] + [("Tez_repr", Qcheck2_helpers.qcheck_wrap tests)] diff --git a/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_tx_rollup_l2_encoding.ml b/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_tx_rollup_l2_encoding.ml index 68cdd390c9d585c9832c4383bb2ce794e52ff45d..44bad653903aeacbc533c72fd995d72fd62d0da2 100644 --- a/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_tx_rollup_l2_encoding.ml +++ b/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_tx_rollup_l2_encoding.ml @@ -278,8 +278,8 @@ let () = ~__FILE__ "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_015_PtLimaPt/lib_protocol/test/pbt/test_zk_rollup_encoding.ml b/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_zk_rollup_encoding.ml index 677b65a0d7a86f63fd877d0d43b3233835d6cff1..240e645d0cca4f022af8dfaccabcad70a139677b 100644 --- a/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_zk_rollup_encoding.ml +++ b/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_zk_rollup_encoding.ml @@ -224,6 +224,6 @@ let () = ~__FILE__ "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_015_PtLimaPt/lib_protocol/test/regression/dune b/src/proto_015_PtLimaPt/lib_protocol/test/regression/dune index 0cc1eb204bd00deb81e7b6db9633641c473160f2..c18603113fe7b6b593cb08a185f8ee44dd019c79 100644 --- a/src/proto_015_PtLimaPt/lib_protocol/test/regression/dune +++ b/src/proto_015_PtLimaPt/lib_protocol/test/regression/dune @@ -12,7 +12,8 @@ tezos-client-015-PtLimaPt tezos-protocol-plugin-015-PtLimaPt tezos-015-PtLimaPt-test-helpers - tezos-micheline) + tezos-micheline + octez-protocol-alcotezt) (library_flags (:standard -linkall)) (flags (:standard) @@ -24,7 +25,8 @@ -open Tezos_client_015_PtLimaPt -open Tezos_protocol_plugin_015_PtLimaPt -open Tezos_015_PtLimaPt_test_helpers - -open Tezos_micheline) + -open Tezos_micheline + -open Octez_protocol_alcotezt) (modules test_logging)) (executable diff --git a/src/proto_015_PtLimaPt/lib_protocol/test/regression/test_logging.ml b/src/proto_015_PtLimaPt/lib_protocol/test/regression/test_logging.ml index d919830cc6337acb8bc7c4eab582189d6b40ea32..fa47a6941963a038fc7e1d50d5958db8e29efd11 100644 --- a/src/proto_015_PtLimaPt/lib_protocol/test/regression/test_logging.ml +++ b/src/proto_015_PtLimaPt/lib_protocol/test/regression/test_logging.ml @@ -251,22 +251,19 @@ let fail_on_error f () = | Ok () -> return () | Error e -> Test.fail "%a" Error_monad.pp_print_trace e -(* Make sure that after a snapshot the snapshotted version of the test - has a different [~title], because all tests are linked in [tezt/tests/main.exe]. *) -let protocol = - match __FILE__ =~* rex "^src/proto_([0-9a-zA-Z_]*)/" with - | None -> - Stdlib.failwith ("failed to extract protocol name from path: " ^ __FILE__) - | Some name -> name - let register_script transaction = (* [~title] must be unique across the codebase, so we prefix it with the protocol name. [~file] however is better kept the same across protocols to simplify snapshotting. *) let file = filename transaction in + let protocol = + (module Protocol : Octez_protocol_alcotezt.Tezt_protocol.PROTOCOL) + in + let tag = Tezt_protocol.tag protocol in + let name = Tezt_protocol.name protocol in Regression.register ~__FILE__ - ~title:(protocol ^ ": " ^ file) - ~tags:["protocol"; "regression"; "logging"] + ~title:(name ^ ": " ^ file) + ~tags:[tag; "protocol"; "regression"; "logging"] ~file (fail_on_error @@ run_script transaction) diff --git a/src/proto_015_PtLimaPt/lib_protocol/test/unit/dune b/src/proto_015_PtLimaPt/lib_protocol/test/unit/dune index fdaa5135c36472d5555fc234b4a537cbd4cf370d..2dfd452c0f72f34d9e4f75e62ef15372ad40c655 100644 --- a/src/proto_015_PtLimaPt/lib_protocol/test/unit/dune +++ b/src/proto_015_PtLimaPt/lib_protocol/test/unit/dune @@ -17,7 +17,7 @@ tezos-protocol-015-PtLimaPt tezos-test-helpers tezos-015-PtLimaPt-test-helpers - octez-alcotezt + tezos-015-PtLimaPt-test-helpers.alcotezt tezos-stdlib tezos-scoru-wasm) (library_flags (:standard -linkall)) @@ -33,7 +33,7 @@ -open Tezos_protocol_015_PtLimaPt -open Tezos_test_helpers -open Tezos_015_PtLimaPt_test_helpers - -open Octez_alcotezt + -open Tezos_015_PtLimaPt_test_helpers_alcotezt -open Tezos_stdlib) (modules test_main diff --git a/src/proto_015_PtLimaPt/lib_protocol/test/unit/test_main.ml b/src/proto_015_PtLimaPt/lib_protocol/test/unit/test_main.ml index 13dc374241d02901dc4d67cde55dbeadd8cf72c8..07344d9ba6de9c08cd61edb72523cebc1b60bfa4 100644 --- a/src/proto_015_PtLimaPt/lib_protocol/test/unit/test_main.ml +++ b/src/proto_015_PtLimaPt/lib_protocol/test/unit/test_main.ml @@ -50,49 +50,29 @@ let () = ~__FILE__ "protocol > unit" [ - Unit_test.spec (Protocol.name ^ ": Tez_repr.ml") Test_tez_repr.tests; + Unit_test.spec "Tez_repr.ml" Test_tez_repr.tests; + Unit_test.spec "Contract_repr.ml" Test_contract_repr.tests; + Unit_test.spec "Destination_repr.ml" Test_destination_repr.tests; + Unit_test.spec "Operation_repr.ml" Test_operation_repr.tests; Unit_test.spec - (Protocol.name ^ ": Contract_repr.ml") - Test_contract_repr.tests; - Unit_test.spec - (Protocol.name ^ ": Destination_repr.ml") - Test_destination_repr.tests; - Unit_test.spec - (Protocol.name ^ ": Operation_repr.ml") - Test_operation_repr.tests; - Unit_test.spec - (Protocol.name ^ ": Global_constants_storage.ml") + "Global_constants_storage.ml" Test_global_constants_storage.tests; - Unit_test.spec (Protocol.name ^ ": fitness") Test_fitness.tests; - Unit_test.spec - (Protocol.name ^ ": fixed point computation") - Test_fixed_point.tests; - Unit_test.spec (Protocol.name ^ ": level module") Test_level_module.tests; - Unit_test.spec (Protocol.name ^ ": qty") Test_qty.tests; - Unit_test.spec (Protocol.name ^ ": round") Test_round_repr.tests; - Unit_test.spec (Protocol.name ^ ": time") Test_time_repr.tests; - Unit_test.spec (Protocol.name ^ ": receipt encodings") Test_receipt.tests; - Unit_test.spec - (Protocol.name ^ ": saturation arithmetic") - Test_saturation.tests; - Unit_test.spec (Protocol.name ^ ": gas monad") Test_gas_monad.tests; - Unit_test.spec (Protocol.name ^ ": tx rollup l2") Test_tx_rollup_l2.tests; - Unit_test.spec - (Protocol.name ^ ": tx rollup l2 apply") - Test_tx_rollup_l2_apply.tests; - Unit_test.spec - (Protocol.name ^ ": liquidity baking") - Test_liquidity_baking_repr.tests; - Unit_test.spec (Protocol.name ^ ": merkle list") Test_merkle_list.tests; - Unit_test.spec (Protocol.name ^ ": skip list") Test_skip_list_repr.tests; - Unit_test.spec - (Protocol.name ^ ": Bond_id_repr.ml") - Test_bond_id_repr.tests; - Unit_test.spec - (Protocol.name ^ ": zk rollup storage") - Test_zk_rollup_storage.tests; - Unit_test.spec - (Protocol.name ^ ": Delegate_consensus_key.ml") - Test_consensus_key.tests; + Unit_test.spec "fitness" Test_fitness.tests; + Unit_test.spec "fixed point computation" Test_fixed_point.tests; + Unit_test.spec "level module" Test_level_module.tests; + Unit_test.spec "qty" Test_qty.tests; + Unit_test.spec "round" Test_round_repr.tests; + Unit_test.spec "time" Test_time_repr.tests; + Unit_test.spec "receipt encodings" Test_receipt.tests; + Unit_test.spec "saturation arithmetic" Test_saturation.tests; + Unit_test.spec "gas monad" Test_gas_monad.tests; + Unit_test.spec "tx rollup l2" Test_tx_rollup_l2.tests; + Unit_test.spec "tx rollup l2 apply" Test_tx_rollup_l2_apply.tests; + Unit_test.spec "liquidity baking" Test_liquidity_baking_repr.tests; + Unit_test.spec "merkle list" Test_merkle_list.tests; + Unit_test.spec "skip list" Test_skip_list_repr.tests; + Unit_test.spec "Bond_id_repr.ml" Test_bond_id_repr.tests; + Unit_test.spec "zk rollup storage" Test_zk_rollup_storage.tests; + Unit_test.spec "Delegate_consensus_key.ml" Test_consensus_key.tests; ] |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_client/test/dune b/src/proto_016_PtMumbai/lib_client/test/dune index ea3c3dd4ad9340193aa8c8455444996376b4b640..013c7f0ad242b09abd6bb349eb59787674e3104a 100644 --- a/src/proto_016_PtMumbai/lib_client/test/dune +++ b/src/proto_016_PtMumbai/lib_client/test/dune @@ -12,7 +12,7 @@ tezos-protocol-016-PtMumbai tezos-base-test-helpers tezos-test-helpers - octez-alcotezt + octez-protocol-alcotezt qcheck-alcotest) (library_flags (:standard -linkall)) (flags @@ -26,7 +26,7 @@ -open Tezos_protocol_016_PtMumbai -open Tezos_base_test_helpers -open Tezos_test_helpers - -open Octez_alcotezt) + -open Octez_protocol_alcotezt) (modules test_michelson_v1_macros test_client_proto_contracts diff --git a/src/proto_016_PtMumbai/lib_client/test/test_client_proto_context.ml b/src/proto_016_PtMumbai/lib_client/test/test_client_proto_context.ml index e178bc95b9091bdae91c4d48cdb01a44883fc0f6..3e64075d648a1632c31b14f307f545c3244acd13 100644 --- a/src/proto_016_PtMumbai/lib_client/test/test_client_proto_context.ml +++ b/src/proto_016_PtMumbai/lib_client/test/test_client_proto_context.ml @@ -66,7 +66,9 @@ let tests = ] let () = - Alcotest.run + let protocol = (module Protocol : Tezt_protocol.PROTOCOL) in + Protocol_alcotest.run + protocol ~__FILE__ "Client proto context" - [(Protocol.name ^ ": Encodings", qcheck_wrap tests)] + [("Encodings", qcheck_wrap tests)] diff --git a/src/proto_016_PtMumbai/lib_client/test/test_client_proto_contracts.ml b/src/proto_016_PtMumbai/lib_client/test/test_client_proto_contracts.ml index fecc84a12cf45baae225a98b3e9b3c2e8110ef63..a17b0f1686111f55883d5288e3b33b24dfe7cc5e 100644 --- a/src/proto_016_PtMumbai/lib_client/test/test_client_proto_contracts.ml +++ b/src/proto_016_PtMumbai/lib_client/test/test_client_proto_contracts.ml @@ -88,11 +88,13 @@ let test_find_destination _ = test "Expected test_alias bootstrap1" "test_alias" bootstrap1 let () = - Alcotest_lwt.run + let protocol = (module Protocol : Tezt_protocol.PROTOCOL) in + Protocol_alcotest_lwt.run + protocol ~__FILE__ "tezos-lib-client-proto-contracts" [ - ( Protocol.name ^ ": client_proto_contracts", + ( "client_proto_contracts", [Tztest.tztest "test_find_destination" `Quick test_find_destination] ); ] |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_client/test/test_michelson_v1_macros.ml b/src/proto_016_PtMumbai/lib_client/test/test_michelson_v1_macros.ml index 23bdd0b7b0cf4c728e1d68c34e36d31e5996c44c..c1e493443b47eb21583e6716c84881ad5142c7de 100644 --- a/src/proto_016_PtMumbai/lib_client/test/test_michelson_v1_macros.ml +++ b/src/proto_016_PtMumbai/lib_client/test/test_michelson_v1_macros.ml @@ -1340,8 +1340,10 @@ let wrap (n, f) = Format.kasprintf Stdlib.failwith "%a" pp_print_trace error) let () = - Alcotest_lwt.run + let protocol = (module Protocol : Tezt_protocol.PROTOCOL) in + Protocol_alcotest_lwt.run + protocol ~__FILE__ "tezos-lib-client" - [(Protocol.name ^ ": micheline v1 macros", List.map wrap tests)] + [("micheline v1 macros", List.map wrap tests)] |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_client/test/test_proxy.ml b/src/proto_016_PtMumbai/lib_client/test/test_proxy.ml index 6d46086941fd57e96a8b710f556f4e2db1b313a1..f6e0b18686f33e0fb299e567b71f72e74b1c46c9 100644 --- a/src/proto_016_PtMumbai/lib_client/test/test_proxy.ml +++ b/src/proto_016_PtMumbai/lib_client/test/test_proxy.ml @@ -83,7 +83,9 @@ let test_split_key = key let () = - Alcotest.run + let protocol = (module Protocol : Tezt_protocol.PROTOCOL) in + Protocol_alcotest.run + protocol ~__FILE__ "tezos-lib-client-proxy" - [(Protocol.name ^ ": proxy", Qcheck2_helpers.qcheck_wrap [test_split_key])] + [("proxy", Qcheck2_helpers.qcheck_wrap [test_split_key])] diff --git a/src/proto_016_PtMumbai/lib_dal/test/dune b/src/proto_016_PtMumbai/lib_dal/test/dune index a0eceb195e7ab2b0ff79dd5bf4a86b61d14e03d2..19c63caeb1b6ae61257adf95e58957ef95374a11 100644 --- a/src/proto_016_PtMumbai/lib_dal/test/dune +++ b/src/proto_016_PtMumbai/lib_dal/test/dune @@ -11,7 +11,7 @@ tezos-protocol-016-PtMumbai tezos-base-test-helpers tezos-016-PtMumbai-test-helpers - octez-alcotezt) + tezos-016-PtMumbai-test-helpers.alcotezt) (library_flags (:standard -linkall)) (flags (:standard) @@ -23,7 +23,7 @@ -open Tezos_protocol_016_PtMumbai -open Tezos_base_test_helpers -open Tezos_016_PtMumbai_test_helpers - -open Octez_alcotezt) + -open Tezos_016_PtMumbai_test_helpers_alcotezt) (modules test_dal_slot_frame_encoding test_helpers)) (executable diff --git a/src/proto_016_PtMumbai/lib_dal/test/test_dal_slot_frame_encoding.ml b/src/proto_016_PtMumbai/lib_dal/test/test_dal_slot_frame_encoding.ml index dc1f4bad73c69c653cf612da53f9e344e420f862..5db2855c19d22b91f76a2aca86556793c15fff95 100644 --- a/src/proto_016_PtMumbai/lib_dal/test/test_dal_slot_frame_encoding.ml +++ b/src/proto_016_PtMumbai/lib_dal/test/test_dal_slot_frame_encoding.ml @@ -415,9 +415,5 @@ let () = Alcotest_lwt.run ~__FILE__ "protocol > unit" - [ - Test_helpers.Unit_test.spec - (Protocol.name ^ ": Slot_framing_protocol.ml") - tests; - ] + [Test_helpers.Unit_test.spec "Slot_framing_protocol.ml" tests] |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_delegate/test/dune b/src/proto_016_PtMumbai/lib_delegate/test/dune index 8206c345908c7a7ad2db85edba2e5e5ea069c5f0..7b93f26149619dae51498b89e68b5261d38bc5b3 100644 --- a/src/proto_016_PtMumbai/lib_delegate/test/dune +++ b/src/proto_016_PtMumbai/lib_delegate/test/dune @@ -15,7 +15,7 @@ tezos-baking-016-PtMumbai tezos-protocol-016-PtMumbai.parameters tezos-crypto - octez-alcotezt + tezos-016-PtMumbai-test-helpers.alcotezt uri) (library_flags (:standard -linkall)) (flags @@ -30,7 +30,7 @@ -open Tezos_base_test_helpers -open Tezos_016_PtMumbai_mockup_simulator -open Tezos_baking_016_PtMumbai - -open Octez_alcotezt) + -open Tezos_016_PtMumbai_test_helpers_alcotezt) (modules test_scenario)) (executable diff --git a/src/proto_016_PtMumbai/lib_delegate/test/test_scenario.ml b/src/proto_016_PtMumbai/lib_delegate/test/test_scenario.ml index 3d4c86686331c280b735661d1861a93e606af80a..3a959f5bc6152b672b0f72ed83f5cef5bd4890b7 100644 --- a/src/proto_016_PtMumbai/lib_delegate/test/test_scenario.ml +++ b/src/proto_016_PtMumbai/lib_delegate/test/test_scenario.ml @@ -1594,22 +1594,21 @@ let () = let open Tezos_base_test_helpers.Tztest in (title, [tztest title `Quick body])) [ - (Protocol.name ^ ": reaches level 5", test_level_5); - ( Protocol.name ^ ": cannot progress without new head", - test_preendorse_on_valid ); - (Protocol.name ^ ": reset delayed pqc", test_reset_delayed_pqc); - (Protocol.name ^ ": scenario t1", test_scenario_t1); - (Protocol.name ^ ": scenario t2", test_scenario_t2); - (Protocol.name ^ ": scenario t3", test_scenario_t3); - (Protocol.name ^ ": scenario f1", test_scenario_f1); - (Protocol.name ^ ": scenario f2", test_scenario_f2); - (Protocol.name ^ ": scenario m1", test_scenario_m1); - (Protocol.name ^ ": scenario m2", test_scenario_m2); - (Protocol.name ^ ": scenario m3", test_scenario_m3); - (Protocol.name ^ ": scenario m4", test_scenario_m4); - (Protocol.name ^ ": scenario m5", test_scenario_m5); - (Protocol.name ^ ": scenario m6", test_scenario_m6); - (Protocol.name ^ ": scenario m7", test_scenario_m7); - (Protocol.name ^ ": scenario m8", test_scenario_m8); + ("reaches level 5", test_level_5); + ("cannot progress without new head", test_preendorse_on_valid); + ("reset delayed pqc", test_reset_delayed_pqc); + ("scenario t1", test_scenario_t1); + ("scenario t2", test_scenario_t2); + ("scenario t3", test_scenario_t3); + ("scenario f1", test_scenario_f1); + ("scenario f2", test_scenario_f2); + ("scenario m1", test_scenario_m1); + ("scenario m2", test_scenario_m2); + ("scenario m3", test_scenario_m3); + ("scenario m4", test_scenario_m4); + ("scenario m5", test_scenario_m5); + ("scenario m6", test_scenario_m6); + ("scenario m7", test_scenario_m7); + ("scenario m8", test_scenario_m8); ] |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_plugin/test/dune b/src/proto_016_PtMumbai/lib_plugin/test/dune index 70d7d736ad7c9e56f2631fd39029ba43bfd5a114..9ae55b7c8f2d721af460a57dfbdb4a91f922eba6 100644 --- a/src/proto_016_PtMumbai/lib_plugin/test/dune +++ b/src/proto_016_PtMumbai/lib_plugin/test/dune @@ -9,7 +9,7 @@ tezos-base tezos-base-test-helpers tezos-base.unix - octez-alcotezt + tezos-016-PtMumbai-test-helpers.alcotezt tezos-test-helpers qcheck-alcotest tezos-stdlib-unix @@ -26,7 +26,7 @@ -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_base_test_helpers - -open Octez_alcotezt + -open Tezos_016_PtMumbai_test_helpers_alcotezt -open Tezos_test_helpers -open Tezos_micheline -open Tezos_protocol_plugin_016_PtMumbai diff --git a/src/proto_016_PtMumbai/lib_plugin/test/test_conflict_handler.ml b/src/proto_016_PtMumbai/lib_plugin/test/test_conflict_handler.ml index d1c17855c5a6da3d7e15e3bb588c299acb7cb950..dfaf9ba7283e705ebaf690454a752016c5a38217 100644 --- a/src/proto_016_PtMumbai/lib_plugin/test/test_conflict_handler.ml +++ b/src/proto_016_PtMumbai/lib_plugin/test/test_conflict_handler.ml @@ -263,7 +263,7 @@ let () = ~__FILE__ "conflict_handler" [ - ( Protocol.name ^ ": conflict_handler", + ( "conflict_handler", [ Tztest.tztest "Random operations (not both manager)" diff --git a/src/proto_016_PtMumbai/lib_plugin/test/test_consensus_filter.ml b/src/proto_016_PtMumbai/lib_plugin/test/test_consensus_filter.ml index 1445191ab587d742084d6518beee8373b05c0710..d467b88706d6f40a3cd21a889923de479b007565 100644 --- a/src/proto_016_PtMumbai/lib_plugin/test/test_consensus_filter.ml +++ b/src/proto_016_PtMumbai/lib_plugin/test/test_consensus_filter.ml @@ -436,7 +436,7 @@ let () = ~__FILE__ "Filter" [ - ( Protocol.name ^ ": pre_filter", + ( "pre_filter", qcheck_wrap [ test_acceptable_past_level; diff --git a/src/proto_016_PtMumbai/lib_plugin/test/test_filter_state.ml b/src/proto_016_PtMumbai/lib_plugin/test/test_filter_state.ml index b5e13fdb6947945c7c2edaaf136f7b45c131b731..8719292ba8aac5fa980bccdd15c05c192f490c36 100644 --- a/src/proto_016_PtMumbai/lib_plugin/test/test_filter_state.ml +++ b/src/proto_016_PtMumbai/lib_plugin/test/test_filter_state.ml @@ -188,7 +188,6 @@ let () = ~__FILE__ "Filter_state" [ - (Protocol.name ^ ": add_manager_op", qcheck_wrap [test_add_manager_op]); - ( Protocol.name ^ ": remove", - qcheck_wrap [test_remove_present; test_remove_unknown] ); + ("add_manager_op", qcheck_wrap [test_add_manager_op]); + ("remove", qcheck_wrap [test_remove_present; test_remove_unknown]); ] diff --git a/src/proto_016_PtMumbai/lib_plugin/test/test_plugin.ml b/src/proto_016_PtMumbai/lib_plugin/test/test_plugin.ml index d139236a13a39b0dae181364e10b66cf5c3e0c12..afd3b19c5cd93ea83aaf2501304d944138a12ec8 100644 --- a/src/proto_016_PtMumbai/lib_plugin/test/test_plugin.ml +++ b/src/proto_016_PtMumbai/lib_plugin/test/test_plugin.ml @@ -72,7 +72,7 @@ let () = ~__FILE__ "Plugin" [ - ( Protocol.name ^ ": on_flush", + ( "on_flush", [ Tztest.tztest "[on_flush ~validation_state ...] yields an empty state " diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/alcotezt/alcotest.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/alcotezt/alcotest.ml new file mode 100644 index 0000000000000000000000000000000000000000..faa66ffe9592e29abb356f81470944c36db9a1bb --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/alcotezt/alcotest.ml @@ -0,0 +1,28 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2023 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. *) +(* *) +(*****************************************************************************) + +include Octez_protocol_alcotezt.Protocol_alcotest + +let run = Octez_protocol_alcotezt.Protocol_alcotest.run Tezt_protocol.protocol diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/alcotezt/alcotest.mli b/src/proto_016_PtMumbai/lib_protocol/test/helpers/alcotezt/alcotest.mli new file mode 100644 index 0000000000000000000000000000000000000000..b3188151e2215076a3e92bebfeb4139334304f9d --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/alcotezt/alcotest.mli @@ -0,0 +1,43 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2023 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. *) +(* *) +(*****************************************************************************) + +(** Protocol-specific Alcotezt wrapper. *) + +(** This modules shadows the function [run] in + [Octez_alcotezt.Alcotest] to automatically add the protocol name + to the title and tags of registered tests. *) +include module type of Octez_alcotezt.Alcotest + +(** Shadowed version of {!Octez_alcotezt.Alcotest.run}, with + protocol-prefixed titles and protocol-specific tags. + + This modules shadows the function [run] in + [Octez_alcotezt.Alcotest] to prefix Alcotest suite names with the + "pretty" version of the protocol name (e.g. [Alpha], [Mumbai], + ... ). It also adds a tag to each registered test identifying the + test. As in integration tests, this is the pretty name lowercased + (e.g. [alpha], [mumbai]). *) +val run : + __FILE__:string -> ?tags:string list -> string -> unit test list -> return diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/alcotezt/alcotest_lwt.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/alcotezt/alcotest_lwt.ml new file mode 100644 index 0000000000000000000000000000000000000000..1214d7e3c937576575a2475d2bc5178f228f84f3 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/alcotezt/alcotest_lwt.ml @@ -0,0 +1,29 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2023 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. *) +(* *) +(*****************************************************************************) + +include Octez_protocol_alcotezt.Protocol_alcotest_lwt + +let run = + Octez_protocol_alcotezt.Protocol_alcotest_lwt.run Tezt_protocol.protocol diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/alcotezt/alcotest_lwt.mli b/src/proto_016_PtMumbai/lib_protocol/test/helpers/alcotezt/alcotest_lwt.mli new file mode 100644 index 0000000000000000000000000000000000000000..a02fe4aa0d90ab9ee293542d946e011bae851ff4 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/alcotezt/alcotest_lwt.mli @@ -0,0 +1,43 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2023 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. *) +(* *) +(*****************************************************************************) + +(** Protocol-specific Alcotezt_lwt wrapper. *) + +(** This modules shadows the function [run] in + [Octez_alcotezt.Alcotest_lwt] to automatically add the protocol name + to the title and tags of registered tests. *) +include module type of Octez_alcotezt.Alcotest_lwt + +(** Shadowed version of {!Octez_alcotezt.Alcotest_lwt.run}, with + protocol-prefixed titles and protocol-specific tags. + + This modules shadows the function [run] in + [Octez_alcotezt.Alcotest] to prefix Alcotest suite names with the + "pretty" version of the protocol name (e.g. [Alpha], [Mumbai], + ... ). It also adds a tag to each registered test identifying the + test. As in integration tests, this is the pretty name lowercased + (e.g. [alpha], [mumbai]). *) +val run : + __FILE__:string -> ?tags:string list -> string -> unit test list -> return diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/alcotezt/dune b/src/proto_016_PtMumbai/lib_protocol/test/helpers/alcotezt/dune new file mode 100644 index 0000000000000000000000000000000000000000..ee4e4f60648b9f4d859e3beb59f372a4cb16f0a3 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/alcotezt/dune @@ -0,0 +1,15 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(library + (name tezos_016_PtMumbai_test_helpers_alcotezt) + (public_name tezos-016-PtMumbai-test-helpers.alcotezt) + (instrumentation (backend bisect_ppx)) + (libraries + tezos-protocol-environment + tezos-protocol-016-PtMumbai + octez-protocol-alcotezt) + (flags + (:standard) + -open Tezos_protocol_016_PtMumbai + -open Octez_protocol_alcotezt)) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/alcotezt/tezt_protocol.ml b/src/proto_016_PtMumbai/lib_protocol/test/helpers/alcotezt/tezt_protocol.ml new file mode 100644 index 0000000000000000000000000000000000000000..77a32313194208d6bfc4a92e8038458500e0c0a2 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/alcotezt/tezt_protocol.ml @@ -0,0 +1,33 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2023 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. *) +(* *) +(*****************************************************************************) + +let protocol = + (module Protocol : Octez_protocol_alcotezt.Tezt_protocol.PROTOCOL) + +let tag = + (* Get protocol tag from Tezt_tezos *) + Octez_protocol_alcotezt.Tezt_protocol.tag protocol + +let name = Octez_protocol_alcotezt.Tezt_protocol.name protocol diff --git a/src/proto_016_PtMumbai/lib_protocol/test/helpers/alcotezt/tezt_protocol.mli b/src/proto_016_PtMumbai/lib_protocol/test/helpers/alcotezt/tezt_protocol.mli new file mode 100644 index 0000000000000000000000000000000000000000..4fc2d66a4608a2bf7bb9ab75d11b8d815e086ff1 --- /dev/null +++ b/src/proto_016_PtMumbai/lib_protocol/test/helpers/alcotezt/tezt_protocol.mli @@ -0,0 +1,36 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2023 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. *) +(* *) +(*****************************************************************************) + +val protocol : Octez_protocol_alcotezt.Tezt_protocol.protocol + +(** TODO: document *) +val name : string + +(** The protocol-specific Tezt tag of this prototcol + + The protocol tag is the same as defined by + {!Tezt_tezos.Protocol.tag}, that is, the lower-cased "pretty" name + of the protocol (e.g. [Alpha], [Mumbai], ...). *) +val tag : string 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 e43d7b45a08c16c095b60340cbd76128c828c236..fdcf57030657993941ce99c1274b31233e3d3603 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/dune +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/consensus/dune @@ -7,7 +7,7 @@ (instrumentation (backend bisect_ppx)) (libraries tezt.core - octez-alcotezt + tezos-016-PtMumbai-test-helpers.alcotezt tezos-base tezos-protocol-016-PtMumbai tezos-016-PtMumbai-test-helpers @@ -19,7 +19,7 @@ (:standard) -open Tezt_core -open Tezt_core.Base - -open Octez_alcotezt + -open Tezos_016_PtMumbai_test_helpers_alcotezt -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_016_PtMumbai 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 index e5341ec77bb0a847b2211b32a09a83ef198678a2..879aaba8faed949a3e43b7885ba31953556b1e9d 100644 --- 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 @@ -35,19 +35,18 @@ let () = ~__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); + ("endorsement", Test_endorsement.tests); + ("preendorsement", Test_preendorsement.tests); + ("double endorsement", Test_double_endorsement.tests); + ("double preendorsement", Test_double_preendorsement.tests); + ("double baking", Test_double_baking.tests); + ("seed", Test_seed.tests); + ("baking", Test_baking.tests); + ("delegation", Test_delegation.tests); + ("deactivation", Test_deactivation.tests); + ("helpers rpcs", Test_helpers_rpcs.tests); + ("participation monitoring", Test_participation.tests); + ("frozen deposits", Test_frozen_deposits.tests); + ("consensus key", Test_consensus_key.tests); ] |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/dune b/src/proto_016_PtMumbai/lib_protocol/test/integration/dune index 51efbbe49ad946ae92d1e6634fe2d53891bb90e2..91844bea3f2e4cc627233b39ac665fa83bd89484 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/dune +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/dune @@ -8,7 +8,7 @@ tezt.core tezt tezos-context - octez-alcotezt + tezos-016-PtMumbai-test-helpers.alcotezt tezos-base tezos-client-016-PtMumbai tezos-protocol-016-PtMumbai @@ -20,7 +20,7 @@ (:standard) -open Tezt_core -open Tezt_core.Base - -open Octez_alcotezt + -open Tezos_016_PtMumbai_test_helpers_alcotezt -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_client_016_PtMumbai 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 e358e9c047c421bb158465f3c295469ba369b6a9..2fce6850a886be97e9af514ceade71ccc2f1ae51 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/dune +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/dune @@ -6,7 +6,7 @@ (instrumentation (backend bisect_ppx)) (libraries tezt.core - octez-alcotezt + tezos-016-PtMumbai-test-helpers.alcotezt tezos-base tezos-protocol-016-PtMumbai tezos-016-PtMumbai-test-helpers @@ -16,7 +16,7 @@ (:standard) -open Tezt_core -open Tezt_core.Base - -open Octez_alcotezt + -open Tezos_016_PtMumbai_test_helpers_alcotezt -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_016_PtMumbai 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 index 1cad429b13533b3b26461684ca0743830257ec8a..466ec8a9b063826b98456ad91f4464d4a4dbb511 100644 --- 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 @@ -35,7 +35,7 @@ let () = ~__FILE__ "protocol > integration > gas" [ - (Protocol.name ^ ": gas levels", Test_gas_levels.tests); - (Protocol.name ^ ": gas cost functions", Test_gas_costs.tests); + ("gas levels", Test_gas_levels.tests); + ("gas cost functions", Test_gas_costs.tests); ] |> Lwt_main.run 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 9510709025f232a69511fcf8bd95b7a8ecba73b4..dd7516b2e0f5992572e2d5a6f7e2b509c6c69e62 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/dune +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/dune @@ -7,7 +7,7 @@ (instrumentation (backend bisect_ppx)) (libraries tezt.core - octez-alcotezt + tezos-016-PtMumbai-test-helpers.alcotezt tezos-base tezos-protocol-016-PtMumbai tezos-016-PtMumbai-test-helpers @@ -24,7 +24,7 @@ (:standard) -open Tezt_core -open Tezt_core.Base - -open Octez_alcotezt + -open Tezos_016_PtMumbai_test_helpers_alcotezt -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_016_PtMumbai 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 index 001c43de6c485d1810d53868bcb46fb72276b11c..217d9292ba20b36fb9fb2827fcb577c6efd54708 100644 --- 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 @@ -35,31 +35,27 @@ let () = ~__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 ^ ": timelock", Test_timelock.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); + ("global table of constants", Test_global_constants_storage.tests); + ("interpretation", Test_interpretation.tests); + ("lazy storage diff", Test_lazy_storage_diff.tests); + ("sapling", Test_sapling.tests); + ("script typed ir size", Test_script_typed_ir_size.tests); + ("temp big maps", Test_temp_big_maps.tests); + ("ticket balance key", Test_ticket_balance_key.tests); + ("ticket scanner", Test_ticket_scanner.tests); + ("ticket storage", Test_ticket_storage.tests); + ("ticket lazy storage diff", Test_ticket_lazy_storage_diff.tests); + ("ticket operations diff", Test_ticket_operations_diff.tests); + ("ticket accounting", Test_ticket_accounting.tests); + ("ticket balance", Test_ticket_balance.tests); + ("ticket manager", Test_ticket_manager.tests); + ("timelock", Test_timelock.tests); + ("typechecking", Test_typechecking.tests); + ("script cache", Test_script_cache.tests); + ("block time instructions", Test_block_time_instructions.tests); + ("annotations", Test_annotations.tests); + ("event logging", Test_contract_event.tests); + ("patched contracts", Test_patched_contracts.tests); + ("lambda normalization", Test_lambda_normalization.tests); ] |> Lwt_main.run 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 5efb8044f524ddd5c8b530c00cae418777ea8d14..079abd24f20e9de6a85205b592e2f5b8d852bd62 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/dune +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/operations/dune @@ -7,7 +7,7 @@ (instrumentation (backend bisect_ppx)) (libraries tezt.core - octez-alcotezt + tezos-016-PtMumbai-test-helpers.alcotezt tezos-base tezos-protocol-016-PtMumbai tezos-client-016-PtMumbai @@ -19,7 +19,7 @@ (:standard) -open Tezt_core -open Tezt_core.Base - -open Octez_alcotezt + -open Tezos_016_PtMumbai_test_helpers_alcotezt -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_016_PtMumbai 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 index dcb9b02326efc5d2af031df62c157aa0a04dba25..b03b03f73f3cae3019a161e313bc98528db4c157 100644 --- 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 @@ -35,19 +35,18 @@ let () = ~__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); + ("voting", Test_voting.tests); + ("origination", Test_origination.tests); + ("revelation", Test_reveal.tests); + ("transfer", Test_transfer.tests); + ("activation", Test_activation.tests); + ("paid storage increase", Test_paid_storage_increase.tests); + ("combined", Test_combined_operations.tests); + ("failing_noop operation", Test_failing_noop.tests); + ("tx rollup", Test_tx_rollup.tests); + ("sc rollup", Test_sc_rollup.tests); + ("sc rollup transfer", Test_sc_rollup_transfer.tests); + ("zk rollup", Test_zk_rollup.tests); + ("transfer ticket", Test_transfer_ticket.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 index 6e0d58de57ab33526b4a8744fb726a0803927c08..d33a670ae8d878b97d8687ebd0a3078d9e855c1a 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/test_main.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/test_main.ml @@ -35,12 +35,12 @@ let () = ~__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); - (Protocol.name ^ ": sc rollup wasm", Test_sc_rollup_wasm.tests); + ("constants", Test_constants.tests); + ("liquidity baking", Test_liquidity_baking.tests); + ("storage description", Test_storage.tests); + ("storage tests", Test_storage_functions.tests); + ("token movements", Test_token.tests); + ("frozen bonds", Test_frozen_bonds.tests); + ("sc rollup wasm", Test_sc_rollup_wasm.tests); ] |> Lwt_main.run 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 8c3f813826876ca5c086892f62f87f058d17c6d6..38200b422f1a65a072f211bfe23ae16df0c36af1 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/dune +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/validate/dune @@ -6,7 +6,7 @@ (instrumentation (backend bisect_ppx)) (libraries tezt.core - octez-alcotezt + tezos-016-PtMumbai-test-helpers.alcotezt tezos-base tezos-protocol-016-PtMumbai qcheck-alcotest @@ -20,7 +20,7 @@ (:standard) -open Tezt_core -open Tezt_core.Base - -open Octez_alcotezt + -open Tezos_016_PtMumbai_test_helpers_alcotezt -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_016_PtMumbai 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 index f4b9908fd88611c62b190cff31bdac0026099230..c065057e21b7ff8cd517059107b25904cf23d0e4 100644 --- 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 @@ -35,13 +35,11 @@ let () = ~__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); + ("sanity checks", Test_sanity.tests); + ("mempool", Test_mempool.tests); + ("single manager validation", Test_manager_operation_validation.tests); + ("batched managers validation", Test_validation_batch.tests); + ("one-manager restriction", Test_1m_restriction.tests); + ("covalidity", Test_covalidity.tests); ] |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/pbt/dune b/src/proto_016_PtMumbai/lib_protocol/test/pbt/dune index aa2b2f7f667e21abc6b1defd231f64cc37bcbe01..ec250e13baddfb4f2c4372abf93ec4edf05f4343 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/pbt/dune +++ b/src/proto_016_PtMumbai/lib_protocol/test/pbt/dune @@ -13,7 +13,7 @@ tezos-context.merkle_proof_encoding tezos-test-helpers tezos-016-PtMumbai-test-helpers - octez-alcotezt + tezos-016-PtMumbai-test-helpers.alcotezt qcheck-alcotest tezos-benchmark tezos-benchmark-016-PtMumbai @@ -33,7 +33,7 @@ -open Tezos_protocol_016_PtMumbai -open Tezos_test_helpers -open Tezos_016_PtMumbai_test_helpers - -open Octez_alcotezt + -open Tezos_016_PtMumbai_test_helpers_alcotezt -open Tezos_benchmark_016_PtMumbai -open Tezos_benchmark_type_inference_016_PtMumbai -open Tezos_smart_rollup_016_PtMumbai 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 6eb71eb3d7bf1cc36b948d712146939423f29f5f..78b0222ddc8975c4eae87ac6505bdf50d81cf017 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 @@ -321,7 +321,6 @@ let () = ~__FILE__ "protocol > pbt > liquidity baking" [ - ( 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 d18d88741a79447a3d77a5624d0f290ff8b1b690..62ef4773a5f192810feb79a44696944e0f52bb7d 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 @@ -192,10 +192,10 @@ let () = ~__FILE__ "protocol > pbt > saturation" [ - (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 2adf84a1978a365cdc19fb983b109c06f60794b7..89315cc7f66bc3092dd185fb75ef668ae6bc0acd 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 @@ -99,7 +99,7 @@ let () = ~__FILE__ "bits" [ - ( Protocol.name ^ ": quantity", + ( "quantity", qcheck_wrap [ QCheck2.Test.make 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 ce22c3c4200823ecf345b908d6d8a74fc4f91f84..66828cb9b6d442ff07703899396a6e9a6bdd9e3a 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 @@ -551,4 +551,4 @@ let () = Alcotest.run ~__FILE__ "protocol > pbt > carbonated map" - [(Protocol.name ^ ": Carbonated map", tests ~rand)] + [("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 1512fa32bc6d063da0f7094e753abe361c0dd1ac..b6a777e515085a64c5d812e05d0fa82eeea371f6 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 @@ -98,6 +98,4 @@ let () = Alcotest.run ~__FILE__ "Compare operations" - [ - (Protocol.name ^ ": Compare_operations", Qcheck2_helpers.qcheck_wrap tests); - ] + [("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 5e1a35744d5a6e02b2b59984ee1354381f0cc92d..f71e9511752ab7aa6ac205f0778f612bfa055c78 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 @@ -219,8 +219,5 @@ let () = let dal_parameters = constants_test.dal end) in - Alcotest_lwt.run - ~__FILE__ - (Protocol.name ^ ": Dal slots refutation game") - Test.tests + Alcotest_lwt.run ~__FILE__ "Dal slots refutation game" Test.tests |> Lwt_main.run 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 9ec8f40e2d8f921999879519e763087cae12f566..f89e55d2784219c257b9c5d380446142c7cd0355 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 @@ -143,4 +143,4 @@ let () = Alcotest.run ~__FILE__ "protocol > pbt > gas" - [(Protocol.name ^ ": gas properties", qcheck_wrap tests)] + [("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 6c47f0582bb0be0218aff0bbd890e76d6fd5e3a8..5f07910c16617e0aef52846c99f00782854b9972 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 @@ -113,13 +113,13 @@ let () = ~__FILE__ "Merkle list" [ - ( 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 3e86031acca17e4cf5f63e8de1638b7876362f7a..8ac396d232b4776b1e0f7849a376acea53d9fa8f 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 @@ -63,4 +63,4 @@ let () = Alcotest.run ~__FILE__ "Operation_encoding" - [(Protocol.name ^ ": roundtrip", qcheck_wrap [test_operation])] + [("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 5883c3aab5d20c7c8b49de22440f980846d309ca..ec2f35d8037ef4669160b002b3db66b5ac0261b2 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 @@ -1830,4 +1830,4 @@ let tests = let tests = [tests; Dissection.tests] -let () = Alcotest.run ~__FILE__ (Protocol.name ^ ": Refutation_game") tests +let () = Alcotest.run ~__FILE__ "Refutation_game" tests 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 cd2b634592f8851b22a7509b250a5e10014b88c5..6d7873b50f36fdea68fd7212a87ca2b4101a9bd9 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 @@ -267,7 +267,4 @@ let () = Alcotest.run ~__FILE__ "protocol > pbt > sampling" - [ - ( Protocol.name ^ ": sampling", - qcheck_wrap [alias_float_test; alias_z_test] ); - ] + [("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 998d8ab4d6cc11096147f2b0560a1e51cee3947a..a5cf5a3bb6ee214a3a41700d6de2e6639a56241b 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 @@ -288,7 +288,4 @@ let tests = ] let () = - Alcotest.run - ~__FILE__ - "SC rollup encoding" - [(Protocol.name ^ ": roundtrip", qcheck_wrap tests)] + Alcotest.run ~__FILE__ "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 9f556f9056849cd0419c35bf58790c3dc8a2d528..7326e3ebbfe5a2a3527fdfdd032c0631265986cf 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 @@ -106,4 +106,4 @@ let () = Alcotest.run ~__FILE__ "Tick_repr" - [(Protocol.name ^ ": Tick_repr", Qcheck2_helpers.qcheck_wrap tests)] + [("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 64f5e85501955648e6697543934ef8c788337651..da6f7ff0b743216c40f723987912200ce58ca83a 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 @@ -346,12 +346,10 @@ let () = ~__FILE__ "protocol > pbt > script_comparison" [ - ( 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 b08c2775fee38917162705128a5fc80564808e17..2f98491636e4303476058843662d22474515ea14 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 @@ -133,4 +133,4 @@ let () = Alcotest.run ~__FILE__ "protocol > pbt > tez_repr" - [(Protocol.name ^ ": Tez_repr", Qcheck2_helpers.qcheck_wrap tests)] + [("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 9c78e11d4f9c338fee8fa752051d0a7b60283ef0..29a70b09ddb0c72f32f13f22a6dbef5f7634b64a 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 @@ -280,8 +280,8 @@ let () = ~__FILE__ "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 fa638fffe4b71548526c4ff03b0db30302721221..31b91dafa3ca2e7fdcf225d9640b154b4f62518f 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 @@ -224,6 +224,6 @@ let () = ~__FILE__ "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_016_PtMumbai/lib_protocol/test/regression/dune b/src/proto_016_PtMumbai/lib_protocol/test/regression/dune index e795506d03655c72c7b436fe61e56db1c9de0cee..a06834200d3db258d1130dc56eef130d2d00d600 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/regression/dune +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/dune @@ -12,7 +12,8 @@ tezos-client-016-PtMumbai tezos-protocol-plugin-016-PtMumbai tezos-016-PtMumbai-test-helpers - tezos-micheline) + tezos-micheline + octez-protocol-alcotezt) (library_flags (:standard -linkall)) (flags (:standard) @@ -24,7 +25,8 @@ -open Tezos_client_016_PtMumbai -open Tezos_protocol_plugin_016_PtMumbai -open Tezos_016_PtMumbai_test_helpers - -open Tezos_micheline) + -open Tezos_micheline + -open Octez_protocol_alcotezt) (modules test_logging)) (executable diff --git a/src/proto_016_PtMumbai/lib_protocol/test/regression/test_logging.ml b/src/proto_016_PtMumbai/lib_protocol/test/regression/test_logging.ml index 15d44bb7792745808c9c46674d58758af73b982b..c45ea20884890ab9c2943c99aaf36a923b728b47 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/regression/test_logging.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/regression/test_logging.ml @@ -257,22 +257,19 @@ let fail_on_error f () = | Ok () -> return () | Error e -> Test.fail "%a" Error_monad.pp_print_trace e -(* Make sure that after a snapshot the snapshotted version of the test - has a different [~title], because all tests are linked in [tezt/tests/main.exe]. *) -let protocol = - match __FILE__ =~* rex "^src/proto_([0-9a-zA-Z_]*)/" with - | None -> - Stdlib.failwith ("failed to extract protocol name from path: " ^ __FILE__) - | Some name -> name - let register_script transaction = (* [~title] must be unique across the codebase, so we prefix it with the protocol name. [~file] however is better kept the same across protocols to simplify snapshotting. *) let file = filename transaction in + let protocol = + (module Protocol : Octez_protocol_alcotezt.Tezt_protocol.PROTOCOL) + in + let tag = Tezt_protocol.tag protocol in + let name = Tezt_protocol.name protocol in Regression.register ~__FILE__ - ~title:(protocol ^ ": " ^ file) - ~tags:["protocol"; "regression"; "logging"] + ~title:(name ^ ": " ^ file) + ~tags:[tag; "protocol"; "regression"; "logging"] ~file (fail_on_error @@ run_script transaction) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/unit/dune b/src/proto_016_PtMumbai/lib_protocol/test/unit/dune index 138dd6abfa7935c2464a0a91c81b88b832045834..37d2ccec63d22e2f5344eabc8a58900cf89183e2 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/dune +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/dune @@ -17,7 +17,7 @@ tezos-protocol-016-PtMumbai tezos-test-helpers tezos-016-PtMumbai-test-helpers - octez-alcotezt + tezos-016-PtMumbai-test-helpers.alcotezt tezos-scoru-wasm-helpers tezos-stdlib tezos-crypto-dal @@ -37,7 +37,7 @@ -open Tezos_protocol_016_PtMumbai -open Tezos_test_helpers -open Tezos_016_PtMumbai_test_helpers - -open Octez_alcotezt + -open Tezos_016_PtMumbai_test_helpers_alcotezt -open Tezos_scoru_wasm_helpers -open Tezos_stdlib -open Tezos_crypto_dal 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 index 868fd9e59e6488c3513a80102f97173969389e41..155be56bb77543a4c3cbe270118686f5b32f5858 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/unit/test_main.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/unit/test_main.ml @@ -50,73 +50,39 @@ let () = ~__FILE__ "protocol > unit" [ - Unit_test.spec (Protocol.name ^ ": Tez_repr.ml") Test_tez_repr.tests; + Unit_test.spec "Tez_repr.ml" Test_tez_repr.tests; + Unit_test.spec "Contract_repr.ml" Test_contract_repr.tests; + Unit_test.spec "Destination_repr.ml" Test_destination_repr.tests; + Unit_test.spec "Operation_repr.ml" Test_operation_repr.tests; Unit_test.spec - (Protocol.name ^ ": Contract_repr.ml") - Test_contract_repr.tests; - Unit_test.spec - (Protocol.name ^ ": Destination_repr.ml") - Test_destination_repr.tests; - Unit_test.spec - (Protocol.name ^ ": Operation_repr.ml") - Test_operation_repr.tests; - Unit_test.spec - (Protocol.name ^ ": Global_constants_storage.ml") + "Global_constants_storage.ml" Test_global_constants_storage.tests; - Unit_test.spec (Protocol.name ^ ": fitness") Test_fitness.tests; - Unit_test.spec - (Protocol.name ^ ": fixed point computation") - Test_fixed_point.tests; - Unit_test.spec (Protocol.name ^ ": level module") Test_level_module.tests; - Unit_test.spec (Protocol.name ^ ": qty") Test_qty.tests; - Unit_test.spec (Protocol.name ^ ": round") Test_round_repr.tests; - Unit_test.spec (Protocol.name ^ ": time") Test_time_repr.tests; - Unit_test.spec (Protocol.name ^ ": receipt encodings") Test_receipt.tests; - Unit_test.spec - (Protocol.name ^ ": saturation arithmetic") - Test_saturation.tests; - Unit_test.spec (Protocol.name ^ ": gas monad") Test_gas_monad.tests; - Unit_test.spec - (Protocol.name ^ ": sc rollup storage") - Test_sc_rollup_storage.tests; - Unit_test.spec - (Protocol.name ^ ": sc rollup game") - Test_sc_rollup_game.tests; - Unit_test.spec (Protocol.name ^ ": tx rollup l2") Test_tx_rollup_l2.tests; - Unit_test.spec - (Protocol.name ^ ": tx rollup l2 apply") - Test_tx_rollup_l2_apply.tests; - Unit_test.spec - (Protocol.name ^ ": liquidity baking") - Test_liquidity_baking_repr.tests; - Unit_test.spec - (Protocol.name ^ ": sc rollup wasm") - Test_sc_rollup_wasm.tests; - Unit_test.spec - (Protocol.name ^ ": sc rollup arith") - Test_sc_rollup_arith.tests; - Unit_test.spec (Protocol.name ^ ": merkle list") Test_merkle_list.tests; - Unit_test.spec - (Protocol.name ^ ": sc rollup inbox") - Test_sc_rollup_inbox.tests; - Unit_test.spec (Protocol.name ^ ": skip list") Test_skip_list_repr.tests; - Unit_test.spec - (Protocol.name ^ ": sc rollup management protocol") + Unit_test.spec "fitness" Test_fitness.tests; + Unit_test.spec "fixed point computation" Test_fixed_point.tests; + Unit_test.spec "level module" Test_level_module.tests; + Unit_test.spec "qty" Test_qty.tests; + Unit_test.spec "round" Test_round_repr.tests; + Unit_test.spec "time" Test_time_repr.tests; + Unit_test.spec "receipt encodings" Test_receipt.tests; + Unit_test.spec "saturation arithmetic" Test_saturation.tests; + Unit_test.spec "gas monad" Test_gas_monad.tests; + Unit_test.spec "sc rollup storage" Test_sc_rollup_storage.tests; + Unit_test.spec "sc rollup game" Test_sc_rollup_game.tests; + Unit_test.spec "tx rollup l2" Test_tx_rollup_l2.tests; + Unit_test.spec "tx rollup l2 apply" Test_tx_rollup_l2_apply.tests; + Unit_test.spec "liquidity baking" Test_liquidity_baking_repr.tests; + Unit_test.spec "sc rollup wasm" Test_sc_rollup_wasm.tests; + Unit_test.spec "sc rollup arith" Test_sc_rollup_arith.tests; + Unit_test.spec "merkle list" Test_merkle_list.tests; + Unit_test.spec "sc rollup inbox" Test_sc_rollup_inbox.tests; + Unit_test.spec "skip list" Test_skip_list_repr.tests; + Unit_test.spec + "sc rollup management protocol" Test_sc_rollup_management_protocol.tests; - Unit_test.spec - (Protocol.name ^ ": Bond_id_repr.ml") - Test_bond_id_repr.tests; - Unit_test.spec - (Protocol.name ^ ": zk rollup storage") - Test_zk_rollup_storage.tests; - Unit_test.spec - (Protocol.name ^ ": Delegate_consensus_key.ml") - Test_consensus_key.tests; - Unit_test.spec - (Protocol.name ^ ": local_contexts") - Test_local_contexts.tests; - Unit_test.spec - (Protocol.name ^ ": dal slot proof") - Test_dal_slot_proof.tests; + Unit_test.spec "Bond_id_repr.ml" Test_bond_id_repr.tests; + Unit_test.spec "zk rollup storage" Test_zk_rollup_storage.tests; + Unit_test.spec "Delegate_consensus_key.ml" Test_consensus_key.tests; + Unit_test.spec "local_contexts" Test_local_contexts.tests; + Unit_test.spec "dal slot proof" Test_dal_slot_proof.tests; ] |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_client/test/dune b/src/proto_017_PtNairob/lib_client/test/dune index 8fe17a865dfb0839089d597ac6f1ed93b189dce5..4e6f17225597e405e9f58e05aef6c46859a9b013 100644 --- a/src/proto_017_PtNairob/lib_client/test/dune +++ b/src/proto_017_PtNairob/lib_client/test/dune @@ -12,7 +12,7 @@ tezos-protocol-017-PtNairob tezos-base-test-helpers tezos-test-helpers - octez-alcotezt + octez-protocol-alcotezt qcheck-alcotest) (library_flags (:standard -linkall)) (flags @@ -26,7 +26,7 @@ -open Tezos_protocol_017_PtNairob -open Tezos_base_test_helpers -open Tezos_test_helpers - -open Octez_alcotezt) + -open Octez_protocol_alcotezt) (modules test_michelson_v1_macros test_client_proto_contracts diff --git a/src/proto_017_PtNairob/lib_client/test/test_client_proto_context.ml b/src/proto_017_PtNairob/lib_client/test/test_client_proto_context.ml index 1437fec988b90d1e1612c29d30ff3656bc8ec97f..5f8547f55de5755a43319b12bf697376ac2d5573 100644 --- a/src/proto_017_PtNairob/lib_client/test/test_client_proto_context.ml +++ b/src/proto_017_PtNairob/lib_client/test/test_client_proto_context.ml @@ -66,7 +66,9 @@ let tests = ] let () = - Alcotest.run + let protocol = (module Protocol : Tezt_protocol.PROTOCOL) in + Protocol_alcotest.run + protocol ~__FILE__ "Client proto context" - [(Protocol.name ^ ": Encodings", qcheck_wrap tests)] + [("Encodings", qcheck_wrap tests)] diff --git a/src/proto_017_PtNairob/lib_client/test/test_client_proto_contracts.ml b/src/proto_017_PtNairob/lib_client/test/test_client_proto_contracts.ml index 74c35ce7ce195ea72e043cd9110d605eea9f7563..b3cf3ff04611cce211b3a8e6530220aa3e899d05 100644 --- a/src/proto_017_PtNairob/lib_client/test/test_client_proto_contracts.ml +++ b/src/proto_017_PtNairob/lib_client/test/test_client_proto_contracts.ml @@ -88,11 +88,13 @@ let test_find_destination _ = test "Expected test_alias bootstrap1" "test_alias" bootstrap1 let () = - Alcotest_lwt.run + let protocol = (module Protocol : Tezt_protocol.PROTOCOL) in + Protocol_alcotest_lwt.run + protocol ~__FILE__ "tezos-lib-client-proto-contracts" [ - ( Protocol.name ^ ": client_proto_contracts", + ( "client_proto_contracts", [Tztest.tztest "test_find_destination" `Quick test_find_destination] ); ] |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_client/test/test_michelson_v1_macros.ml b/src/proto_017_PtNairob/lib_client/test/test_michelson_v1_macros.ml index b6874812d00adfc74331f633fee655d6c3700fc0..aa4152f728116ea952e0d2ed630e64a8624777bc 100644 --- a/src/proto_017_PtNairob/lib_client/test/test_michelson_v1_macros.ml +++ b/src/proto_017_PtNairob/lib_client/test/test_michelson_v1_macros.ml @@ -1340,8 +1340,10 @@ let wrap (n, f) = Format.kasprintf Stdlib.failwith "%a" pp_print_trace error) let () = - Alcotest_lwt.run + let protocol = (module Protocol : Tezt_protocol.PROTOCOL) in + Protocol_alcotest_lwt.run + protocol ~__FILE__ "tezos-lib-client" - [(Protocol.name ^ ": micheline v1 macros", List.map wrap tests)] + [("micheline v1 macros", List.map wrap tests)] |> Lwt_main.run diff --git a/src/proto_017_PtNairob/lib_client/test/test_proxy.ml b/src/proto_017_PtNairob/lib_client/test/test_proxy.ml index defa5b47870ed9180a5140b1a53f888ea5b42335..ee87951359c69a22fb1efb6a1292a2167d44c5e1 100644 --- a/src/proto_017_PtNairob/lib_client/test/test_proxy.ml +++ b/src/proto_017_PtNairob/lib_client/test/test_proxy.ml @@ -83,7 +83,9 @@ let test_split_key = key let () = - Alcotest.run + let protocol = (module Protocol : Tezt_protocol.PROTOCOL) in + Protocol_alcotest.run + protocol ~__FILE__ "tezos-lib-client-proxy" - [(Protocol.name ^ ": proxy", Qcheck2_helpers.qcheck_wrap [test_split_key])] + [("proxy", Qcheck2_helpers.qcheck_wrap [test_split_key])] diff --git a/src/proto_017_PtNairob/lib_dac_plugin/test/dune b/src/proto_017_PtNairob/lib_dac_plugin/test/dune index 281a3a4a6a60cb9946c7ff7518a147212a788bcd..8969f59de961ac5772a8431f94832ed93029a46d 100644 --- a/src/proto_017_PtNairob/lib_dac_plugin/test/dune +++ b/src/proto_017_PtNairob/lib_dac_plugin/test/dune @@ -13,7 +13,7 @@ tezos-017-PtNairob-test-helpers tezos-dac-lib tezos_dac_node_lib - octez-alcotezt) + tezos-017-PtNairob-test-helpers.alcotezt) (library_flags (:standard -linkall)) (flags (:standard) @@ -27,7 +27,7 @@ -open Tezos_017_PtNairob_test_helpers -open Tezos_dac_lib -open Tezos_dac_node_lib - -open Octez_alcotezt) + -open Tezos_017_PtNairob_test_helpers_alcotezt) (modules test_dac_pages_encoding test_dac_plugin_registration test_helpers)) (executable diff --git a/src/proto_017_PtNairob/lib_dal/test/dune b/src/proto_017_PtNairob/lib_dal/test/dune index 93b86554a0277bc584806427fb6f221b090f7a1b..29a24e7e2e79b479582cec01f5408e88a469bd4d 100644 --- a/src/proto_017_PtNairob/lib_dal/test/dune +++ b/src/proto_017_PtNairob/lib_dal/test/dune @@ -11,7 +11,7 @@ tezos-protocol-017-PtNairob tezos-base-test-helpers tezos-017-PtNairob-test-helpers - octez-alcotezt) + tezos-017-PtNairob-test-helpers.alcotezt) (library_flags (:standard -linkall)) (flags (:standard) @@ -23,7 +23,7 @@ -open Tezos_protocol_017_PtNairob -open Tezos_base_test_helpers -open Tezos_017_PtNairob_test_helpers - -open Octez_alcotezt) + -open Tezos_017_PtNairob_test_helpers_alcotezt) (modules test_dal_slot_frame_encoding test_helpers)) (executable diff --git a/src/proto_017_PtNairob/lib_delegate/test/dune b/src/proto_017_PtNairob/lib_delegate/test/dune index 33a473dda4ed8a02c7e039f25af978f433954b12..e494fbe77276a5318422c67f500765a4e4fd8dc0 100644 --- a/src/proto_017_PtNairob/lib_delegate/test/dune +++ b/src/proto_017_PtNairob/lib_delegate/test/dune @@ -15,7 +15,7 @@ tezos-baking-017-PtNairob tezos-protocol-017-PtNairob.parameters tezos-crypto - octez-alcotezt + tezos-017-PtNairob-test-helpers.alcotezt uri) (library_flags (:standard -linkall)) (flags @@ -30,7 +30,7 @@ -open Tezos_base_test_helpers -open Tezos_017_PtNairob_mockup_simulator -open Tezos_baking_017_PtNairob - -open Octez_alcotezt) + -open Tezos_017_PtNairob_test_helpers_alcotezt) (modules test_scenario)) (executable diff --git a/src/proto_017_PtNairob/lib_plugin/test/dune b/src/proto_017_PtNairob/lib_plugin/test/dune index b6870095abf3d0be677243ed82a6e05410010c24..89aeba02a189f020545a78a95f16a7096ed4b223 100644 --- a/src/proto_017_PtNairob/lib_plugin/test/dune +++ b/src/proto_017_PtNairob/lib_plugin/test/dune @@ -9,7 +9,7 @@ tezos-base tezos-base-test-helpers tezos-base.unix - octez-alcotezt + tezos-017-PtNairob-test-helpers.alcotezt tezos-test-helpers qcheck-alcotest tezos-stdlib-unix @@ -26,7 +26,7 @@ -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_base_test_helpers - -open Octez_alcotezt + -open Tezos_017_PtNairob_test_helpers_alcotezt -open Tezos_test_helpers -open Tezos_micheline -open Tezos_protocol_plugin_017_PtNairob diff --git a/src/proto_017_PtNairob/lib_protocol/test/helpers/alcotezt/dune b/src/proto_017_PtNairob/lib_protocol/test/helpers/alcotezt/dune new file mode 100644 index 0000000000000000000000000000000000000000..7ffbeec803b98a13cc8a080875521cc3ce4ae391 --- /dev/null +++ b/src/proto_017_PtNairob/lib_protocol/test/helpers/alcotezt/dune @@ -0,0 +1,15 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(library + (name tezos_017_PtNairob_test_helpers_alcotezt) + (public_name tezos-017-PtNairob-test-helpers.alcotezt) + (instrumentation (backend bisect_ppx)) + (libraries + tezos-protocol-environment + tezos-protocol-017-PtNairob + octez-protocol-alcotezt) + (flags + (:standard) + -open Tezos_protocol_017_PtNairob + -open Octez_protocol_alcotezt)) 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 02b4e560515f21bda251c1f090783389e960d25b..a6ee1e58128da9c031fc2c731c9440bf55884191 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/dune +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/consensus/dune @@ -7,7 +7,7 @@ (instrumentation (backend bisect_ppx)) (libraries tezt.core - octez-alcotezt + tezos-017-PtNairob-test-helpers.alcotezt tezos-base tezos-protocol-017-PtNairob tezos-017-PtNairob-test-helpers @@ -19,7 +19,7 @@ (:standard) -open Tezt_core -open Tezt_core.Base - -open Octez_alcotezt + -open Tezos_017_PtNairob_test_helpers_alcotezt -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_017_PtNairob diff --git a/src/proto_017_PtNairob/lib_protocol/test/integration/dune b/src/proto_017_PtNairob/lib_protocol/test/integration/dune index b50e0da39c8015cf31ec5482f07eaf77a2a8433c..8ea8afacf128bfa5aa262c36d32550a3bacf4c5c 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/dune +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/dune @@ -8,7 +8,7 @@ tezt.core tezt tezos-context - octez-alcotezt + tezos-017-PtNairob-test-helpers.alcotezt tezos-base tezos-client-017-PtNairob tezos-protocol-017-PtNairob @@ -20,7 +20,7 @@ (:standard) -open Tezt_core -open Tezt_core.Base - -open Octez_alcotezt + -open Tezos_017_PtNairob_test_helpers_alcotezt -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_client_017_PtNairob 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 7ea3a1758fa166c9ca28a5d325ea6a94992ecf47..9389fa1173682ae18c9001637b4f530ed4c75fb7 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/gas/dune +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/gas/dune @@ -6,7 +6,7 @@ (instrumentation (backend bisect_ppx)) (libraries tezt.core - octez-alcotezt + tezos-017-PtNairob-test-helpers.alcotezt tezos-base tezos-protocol-017-PtNairob tezos-017-PtNairob-test-helpers @@ -16,7 +16,7 @@ (:standard) -open Tezt_core -open Tezt_core.Base - -open Octez_alcotezt + -open Tezos_017_PtNairob_test_helpers_alcotezt -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_017_PtNairob 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 3f792e161906843970cc042ab55ffa0dcfad87b9..5f44a21bffa1e752314a450d7735db6d916b91d3 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/dune +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/michelson/dune @@ -7,7 +7,7 @@ (instrumentation (backend bisect_ppx)) (libraries tezt.core - octez-alcotezt + tezos-017-PtNairob-test-helpers.alcotezt tezos-base tezos-protocol-017-PtNairob tezos-017-PtNairob-test-helpers @@ -24,7 +24,7 @@ (:standard) -open Tezt_core -open Tezt_core.Base - -open Octez_alcotezt + -open Tezos_017_PtNairob_test_helpers_alcotezt -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_017_PtNairob 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 a0d3ffd577a39081c98ab41be0ce260a2b9fce16..eeba8e4b95c5fb1aab0ba6d084b52676527cca32 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/operations/dune +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/operations/dune @@ -7,7 +7,7 @@ (instrumentation (backend bisect_ppx)) (libraries tezt.core - octez-alcotezt + tezos-017-PtNairob-test-helpers.alcotezt tezos-base tezos-protocol-017-PtNairob tezos-client-017-PtNairob @@ -19,7 +19,7 @@ (:standard) -open Tezt_core -open Tezt_core.Base - -open Octez_alcotezt + -open Tezos_017_PtNairob_test_helpers_alcotezt -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_017_PtNairob 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 69f7236c7b9a47401762bb91f0445196639d4970..bb71dea2f657eb25458bb288598fd4604bad7366 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/integration/validate/dune +++ b/src/proto_017_PtNairob/lib_protocol/test/integration/validate/dune @@ -6,7 +6,7 @@ (instrumentation (backend bisect_ppx)) (libraries tezt.core - octez-alcotezt + tezos-017-PtNairob-test-helpers.alcotezt tezos-base tezos-protocol-017-PtNairob qcheck-alcotest @@ -20,7 +20,7 @@ (:standard) -open Tezt_core -open Tezt_core.Base - -open Octez_alcotezt + -open Tezos_017_PtNairob_test_helpers_alcotezt -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_017_PtNairob diff --git a/src/proto_017_PtNairob/lib_protocol/test/pbt/dune b/src/proto_017_PtNairob/lib_protocol/test/pbt/dune index bcada9c56f93016f80d8749de62200e8a1872d85..cbd2622097587824db432440656d9e182ab1760a 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/pbt/dune +++ b/src/proto_017_PtNairob/lib_protocol/test/pbt/dune @@ -13,7 +13,7 @@ tezos-context.merkle_proof_encoding tezos-test-helpers tezos-017-PtNairob-test-helpers - octez-alcotezt + tezos-017-PtNairob-test-helpers.alcotezt qcheck-alcotest tezos-benchmark tezos-benchmark-017-PtNairob @@ -33,7 +33,7 @@ -open Tezos_protocol_017_PtNairob -open Tezos_test_helpers -open Tezos_017_PtNairob_test_helpers - -open Octez_alcotezt + -open Tezos_017_PtNairob_test_helpers_alcotezt -open Tezos_benchmark_017_PtNairob -open Tezos_benchmark_type_inference_017_PtNairob -open Tezos_smart_rollup_017_PtNairob 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 3bcfae8f37e38aa29a8d3e9d4663dce5b5978109..9bad7b1862ece40561b0f10cea55c668cec4447d 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 @@ -75,7 +75,9 @@ let test_add_info_per_level = let tests = [test_add_info_per_level] let () = - Alcotest.run + let protocol = (module Protocol : Tezt_protocol.PROTOCOL) in + Protocol_alcotest.run + protocol ~__FILE__ "Smart rollup inbox" [(Protocol.name ^ ": safety", qcheck_wrap tests)] diff --git a/src/proto_017_PtNairob/lib_protocol/test/regression/dune b/src/proto_017_PtNairob/lib_protocol/test/regression/dune index fb784bb650fe69ac0bcd241fe117ad3c608d0d93..02b7a9f72c6fc3c51520759ec9f48e0ddf2ccb87 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/regression/dune +++ b/src/proto_017_PtNairob/lib_protocol/test/regression/dune @@ -12,7 +12,8 @@ tezos-client-017-PtNairob tezos-protocol-plugin-017-PtNairob tezos-017-PtNairob-test-helpers - tezos-micheline) + tezos-micheline + octez-protocol-alcotezt) (library_flags (:standard -linkall)) (flags (:standard) @@ -24,7 +25,8 @@ -open Tezos_client_017_PtNairob -open Tezos_protocol_plugin_017_PtNairob -open Tezos_017_PtNairob_test_helpers - -open Tezos_micheline) + -open Tezos_micheline + -open Octez_protocol_alcotezt) (modules test_logging)) (executable diff --git a/src/proto_017_PtNairob/lib_protocol/test/unit/dune b/src/proto_017_PtNairob/lib_protocol/test/unit/dune index 738d17f237a740d06dd6a173187d1d7035dba4df..77d9ea40a18313de9b8ef9110d03d1d55f87343b 100644 --- a/src/proto_017_PtNairob/lib_protocol/test/unit/dune +++ b/src/proto_017_PtNairob/lib_protocol/test/unit/dune @@ -17,7 +17,7 @@ tezos-protocol-017-PtNairob tezos-test-helpers tezos-017-PtNairob-test-helpers - octez-alcotezt + tezos-017-PtNairob-test-helpers.alcotezt tezos-scoru-wasm-helpers tezos-stdlib tezos-crypto-dal @@ -37,7 +37,7 @@ -open Tezos_protocol_017_PtNairob -open Tezos_test_helpers -open Tezos_017_PtNairob_test_helpers - -open Octez_alcotezt + -open Tezos_017_PtNairob_test_helpers_alcotezt -open Tezos_scoru_wasm_helpers -open Tezos_stdlib -open Tezos_crypto_dal diff --git a/src/proto_alpha/lib_client/test/dune b/src/proto_alpha/lib_client/test/dune index 6a37a175607d6879b57eb03eb2095ff805928c91..e726ec8e3364cd669db3c0d1710b05fbb3f042c4 100644 --- a/src/proto_alpha/lib_client/test/dune +++ b/src/proto_alpha/lib_client/test/dune @@ -12,7 +12,7 @@ tezos-protocol-alpha tezos-base-test-helpers tezos-test-helpers - octez-alcotezt + octez-protocol-alcotezt qcheck-alcotest) (library_flags (:standard -linkall)) (flags @@ -26,7 +26,7 @@ -open Tezos_protocol_alpha -open Tezos_base_test_helpers -open Tezos_test_helpers - -open Octez_alcotezt) + -open Octez_protocol_alcotezt) (modules test_michelson_v1_macros test_client_proto_contracts diff --git a/src/proto_alpha/lib_client/test/test_client_proto_context.ml b/src/proto_alpha/lib_client/test/test_client_proto_context.ml index 7351c7013307fcc2ffd9a06bc17aca97a28ec366..7e95d44feacf8d7451c29de80447ab23c496556b 100644 --- a/src/proto_alpha/lib_client/test/test_client_proto_context.ml +++ b/src/proto_alpha/lib_client/test/test_client_proto_context.ml @@ -66,7 +66,9 @@ let tests = ] let () = - Alcotest.run + let protocol = (module Protocol : Tezt_protocol.PROTOCOL) in + Protocol_alcotest.run + protocol ~__FILE__ "Client proto context" - [(Protocol.name ^ ": Encodings", qcheck_wrap tests)] + [("Encodings", qcheck_wrap tests)] diff --git a/src/proto_alpha/lib_client/test/test_client_proto_contracts.ml b/src/proto_alpha/lib_client/test/test_client_proto_contracts.ml index 3112cbbe99844ee26c05efcc041cdd209fba0342..e81abe7e818c6ab00d098dc1030b5166512f98c7 100644 --- a/src/proto_alpha/lib_client/test/test_client_proto_contracts.ml +++ b/src/proto_alpha/lib_client/test/test_client_proto_contracts.ml @@ -88,11 +88,13 @@ let test_find_destination _ = test "Expected test_alias bootstrap1" "test_alias" bootstrap1 let () = - Alcotest_lwt.run + let protocol = (module Protocol : Tezt_protocol.PROTOCOL) in + Protocol_alcotest_lwt.run + protocol ~__FILE__ "tezos-lib-client-proto-contracts" [ - ( Protocol.name ^ ": client_proto_contracts", + ( "client_proto_contracts", [Tztest.tztest "test_find_destination" `Quick test_find_destination] ); ] |> Lwt_main.run diff --git a/src/proto_alpha/lib_client/test/test_michelson_v1_macros.ml b/src/proto_alpha/lib_client/test/test_michelson_v1_macros.ml index 8f210533c699d8553bfad904c4772a6437524031..abd06778350d3cb209e55674fa0a9438c53fff75 100644 --- a/src/proto_alpha/lib_client/test/test_michelson_v1_macros.ml +++ b/src/proto_alpha/lib_client/test/test_michelson_v1_macros.ml @@ -1340,8 +1340,10 @@ let wrap (n, f) = Format.kasprintf Stdlib.failwith "%a" pp_print_trace error) let () = - Alcotest_lwt.run + let protocol = (module Protocol : Tezt_protocol.PROTOCOL) in + Protocol_alcotest_lwt.run + protocol ~__FILE__ "tezos-lib-client" - [(Protocol.name ^ ": micheline v1 macros", List.map wrap tests)] + [("micheline v1 macros", List.map wrap tests)] |> Lwt_main.run diff --git a/src/proto_alpha/lib_client/test/test_proxy.ml b/src/proto_alpha/lib_client/test/test_proxy.ml index 92fb592b07136252eb466107910b7a7863110a61..c55ad1f6e0fc6aacd1f96070befc58fcee03d00f 100644 --- a/src/proto_alpha/lib_client/test/test_proxy.ml +++ b/src/proto_alpha/lib_client/test/test_proxy.ml @@ -83,7 +83,9 @@ let test_split_key = key let () = - Alcotest.run + let protocol = (module Protocol : Tezt_protocol.PROTOCOL) in + Protocol_alcotest.run + protocol ~__FILE__ "tezos-lib-client-proxy" - [(Protocol.name ^ ": proxy", Qcheck2_helpers.qcheck_wrap [test_split_key])] + [("proxy", Qcheck2_helpers.qcheck_wrap [test_split_key])] diff --git a/src/proto_alpha/lib_dac_plugin/test/dune b/src/proto_alpha/lib_dac_plugin/test/dune index 3b4e454d6e252d7f9a05c0750534bbab7d23bc45..ba0abe68ed4ef6a99dd4b5efc27c596463e30500 100644 --- a/src/proto_alpha/lib_dac_plugin/test/dune +++ b/src/proto_alpha/lib_dac_plugin/test/dune @@ -13,7 +13,7 @@ tezos-alpha-test-helpers tezos-dac-lib tezos_dac_node_lib - octez-alcotezt) + tezos-alpha-test-helpers.alcotezt) (library_flags (:standard -linkall)) (flags (:standard) @@ -27,7 +27,7 @@ -open Tezos_alpha_test_helpers -open Tezos_dac_lib -open Tezos_dac_node_lib - -open Octez_alcotezt) + -open Tezos_alpha_test_helpers_alcotezt) (modules test_dac_pages_encoding test_dac_plugin_registration test_helpers)) (executable diff --git a/src/proto_alpha/lib_dac_plugin/test/test_dac_pages_encoding.ml b/src/proto_alpha/lib_dac_plugin/test/test_dac_pages_encoding.ml index 2d1f0892fbc8f2d1ab9b2de2c70ba75ab5fe34bc..38e671ea0206a78b92fe3ab63a4ef622238fe53c 100644 --- a/src/proto_alpha/lib_dac_plugin/test/test_dac_pages_encoding.ml +++ b/src/proto_alpha/lib_dac_plugin/test/test_dac_pages_encoding.ml @@ -711,9 +711,5 @@ let () = Alcotest_lwt.run ~__FILE__ "protocol > unit" - [ - Test_helpers.Unit_test.spec - (Protocol.name ^ ": Dac_pages_encoding.ml") - tests; - ] + [Test_helpers.Unit_test.spec "Dac_pages_encoding.ml" tests] |> Lwt_main.run diff --git a/src/proto_alpha/lib_dac_plugin/test/test_dac_plugin_registration.ml b/src/proto_alpha/lib_dac_plugin/test/test_dac_plugin_registration.ml index cdab557320f42cf7e2f965a1f7e128d3f6fe5e3b..ec696e4dd24fe5db4b1ba7fa82633a2119d44bde 100644 --- a/src/proto_alpha/lib_dac_plugin/test/test_dac_plugin_registration.ml +++ b/src/proto_alpha/lib_dac_plugin/test/test_dac_plugin_registration.ml @@ -154,9 +154,5 @@ let () = Alcotest_lwt.run ~__FILE__ "protocol > unit" - [ - Test_helpers.Unit_test.spec - (Protocol.name ^ ": Dac_plugin_registration.ml") - tests; - ] + [Test_helpers.Unit_test.spec "Dac_plugin_registration.ml" tests] |> Lwt_main.run diff --git a/src/proto_alpha/lib_dal/test/dune b/src/proto_alpha/lib_dal/test/dune index 2ba69866c9a57bf8d73a2312fe2a679f6a588400..052659d1e42a7d55cb281a95bccfb12a3c486455 100644 --- a/src/proto_alpha/lib_dal/test/dune +++ b/src/proto_alpha/lib_dal/test/dune @@ -11,7 +11,7 @@ tezos-protocol-alpha tezos-base-test-helpers tezos-alpha-test-helpers - octez-alcotezt) + tezos-alpha-test-helpers.alcotezt) (library_flags (:standard -linkall)) (flags (:standard) @@ -23,7 +23,7 @@ -open Tezos_protocol_alpha -open Tezos_base_test_helpers -open Tezos_alpha_test_helpers - -open Octez_alcotezt) + -open Tezos_alpha_test_helpers_alcotezt) (modules test_dal_slot_frame_encoding test_helpers)) (executable diff --git a/src/proto_alpha/lib_dal/test/test_dal_slot_frame_encoding.ml b/src/proto_alpha/lib_dal/test/test_dal_slot_frame_encoding.ml index 775505cb992ad250b0540ff00942ea93c0d677a6..06595283de8b392cc010f978c53a0f1981c864ab 100644 --- a/src/proto_alpha/lib_dal/test/test_dal_slot_frame_encoding.ml +++ b/src/proto_alpha/lib_dal/test/test_dal_slot_frame_encoding.ml @@ -415,9 +415,5 @@ let () = Alcotest_lwt.run ~__FILE__ "protocol > unit" - [ - Test_helpers.Unit_test.spec - (Protocol.name ^ ": Slot_framing_protocol.ml") - tests; - ] + [Test_helpers.Unit_test.spec "Slot_framing_protocol.ml" tests] |> Lwt_main.run diff --git a/src/proto_alpha/lib_delegate/test/dune b/src/proto_alpha/lib_delegate/test/dune index 706b888e7f2fc691f2781843b0e9cac2e9d74a1a..29e4610e705c775e19377eb111b96e6d1b7b363d 100644 --- a/src/proto_alpha/lib_delegate/test/dune +++ b/src/proto_alpha/lib_delegate/test/dune @@ -15,7 +15,7 @@ tezos-baking-alpha tezos-protocol-alpha.parameters tezos-crypto - octez-alcotezt + tezos-alpha-test-helpers.alcotezt uri) (library_flags (:standard -linkall)) (flags @@ -30,7 +30,7 @@ -open Tezos_base_test_helpers -open Tezos_alpha_mockup_simulator -open Tezos_baking_alpha - -open Octez_alcotezt) + -open Tezos_alpha_test_helpers_alcotezt) (modules test_scenario)) (executable diff --git a/src/proto_alpha/lib_delegate/test/test_scenario.ml b/src/proto_alpha/lib_delegate/test/test_scenario.ml index 667374a3718fb92c3e186273ba2d734f00b31d81..641c672544f8eddfa012f4f0a012185b07e7a7be 100644 --- a/src/proto_alpha/lib_delegate/test/test_scenario.ml +++ b/src/proto_alpha/lib_delegate/test/test_scenario.ml @@ -1594,22 +1594,21 @@ let () = let open Tezos_base_test_helpers.Tztest in (title, [tztest title `Quick body])) [ - (Protocol.name ^ ": reaches level 5", test_level_5); - ( Protocol.name ^ ": cannot progress without new head", - test_preendorse_on_valid ); - (Protocol.name ^ ": reset delayed pqc", test_reset_delayed_pqc); - (Protocol.name ^ ": scenario t1", test_scenario_t1); - (Protocol.name ^ ": scenario t2", test_scenario_t2); - (Protocol.name ^ ": scenario t3", test_scenario_t3); - (Protocol.name ^ ": scenario f1", test_scenario_f1); - (Protocol.name ^ ": scenario f2", test_scenario_f2); - (Protocol.name ^ ": scenario m1", test_scenario_m1); - (Protocol.name ^ ": scenario m2", test_scenario_m2); - (Protocol.name ^ ": scenario m3", test_scenario_m3); - (Protocol.name ^ ": scenario m4", test_scenario_m4); - (Protocol.name ^ ": scenario m5", test_scenario_m5); - (Protocol.name ^ ": scenario m6", test_scenario_m6); - (Protocol.name ^ ": scenario m7", test_scenario_m7); - (Protocol.name ^ ": scenario m8", test_scenario_m8); + ("reaches level 5", test_level_5); + ("cannot progress without new head", test_preendorse_on_valid); + ("reset delayed pqc", test_reset_delayed_pqc); + ("scenario t1", test_scenario_t1); + ("scenario t2", test_scenario_t2); + ("scenario t3", test_scenario_t3); + ("scenario f1", test_scenario_f1); + ("scenario f2", test_scenario_f2); + ("scenario m1", test_scenario_m1); + ("scenario m2", test_scenario_m2); + ("scenario m3", test_scenario_m3); + ("scenario m4", test_scenario_m4); + ("scenario m5", test_scenario_m5); + ("scenario m6", test_scenario_m6); + ("scenario m7", test_scenario_m7); + ("scenario m8", test_scenario_m8); ] |> Lwt_main.run diff --git a/src/proto_alpha/lib_plugin/test/dune b/src/proto_alpha/lib_plugin/test/dune index 5cdafd3624a42a2b0a2010ff2eadc08b76e431f5..78055d66a7a0c5ebe92fde6c0d0bc5a3b9308159 100644 --- a/src/proto_alpha/lib_plugin/test/dune +++ b/src/proto_alpha/lib_plugin/test/dune @@ -9,7 +9,7 @@ tezos-base tezos-base-test-helpers tezos-base.unix - octez-alcotezt + tezos-alpha-test-helpers.alcotezt tezos-test-helpers qcheck-alcotest tezos-stdlib-unix @@ -26,7 +26,7 @@ -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_base_test_helpers - -open Octez_alcotezt + -open Tezos_alpha_test_helpers_alcotezt -open Tezos_test_helpers -open Tezos_micheline -open Tezos_protocol_plugin_alpha diff --git a/src/proto_alpha/lib_plugin/test/test_conflict_handler.ml b/src/proto_alpha/lib_plugin/test/test_conflict_handler.ml index 7ca63242579edb4eb56a93fe7f502847d9fcb9ea..40f307622c2d4f0c297b113abd8ce65257d6d312 100644 --- a/src/proto_alpha/lib_plugin/test/test_conflict_handler.ml +++ b/src/proto_alpha/lib_plugin/test/test_conflict_handler.ml @@ -263,7 +263,7 @@ let () = ~__FILE__ "conflict_handler" [ - ( Protocol.name ^ ": conflict_handler", + ( "conflict_handler", [ Tztest.tztest "Random operations (not both manager)" diff --git a/src/proto_alpha/lib_plugin/test/test_consensus_filter.ml b/src/proto_alpha/lib_plugin/test/test_consensus_filter.ml index 1445191ab587d742084d6518beee8373b05c0710..d467b88706d6f40a3cd21a889923de479b007565 100644 --- a/src/proto_alpha/lib_plugin/test/test_consensus_filter.ml +++ b/src/proto_alpha/lib_plugin/test/test_consensus_filter.ml @@ -436,7 +436,7 @@ let () = ~__FILE__ "Filter" [ - ( Protocol.name ^ ": pre_filter", + ( "pre_filter", qcheck_wrap [ test_acceptable_past_level; diff --git a/src/proto_alpha/lib_plugin/test/test_filter_state.ml b/src/proto_alpha/lib_plugin/test/test_filter_state.ml index 646e8f5b37dcd95219455cef7fff6222818cae24..d333281ae10f217cfe5504a89f255290767e311a 100644 --- a/src/proto_alpha/lib_plugin/test/test_filter_state.ml +++ b/src/proto_alpha/lib_plugin/test/test_filter_state.ml @@ -188,7 +188,6 @@ let () = ~__FILE__ "Filter_state" [ - (Protocol.name ^ ": add_manager_op", qcheck_wrap [test_add_manager_op]); - ( Protocol.name ^ ": remove", - qcheck_wrap [test_remove_present; test_remove_unknown] ); + ("add_manager_op", qcheck_wrap [test_add_manager_op]); + ("remove", qcheck_wrap [test_remove_present; test_remove_unknown]); ] diff --git a/src/proto_alpha/lib_plugin/test/test_plugin.ml b/src/proto_alpha/lib_plugin/test/test_plugin.ml index ea5fa5efdf1530d7b091f11f71e860c9c3c5aa0f..420ac1dc4999d574c07c007becd36dcb9f2d224f 100644 --- a/src/proto_alpha/lib_plugin/test/test_plugin.ml +++ b/src/proto_alpha/lib_plugin/test/test_plugin.ml @@ -72,7 +72,7 @@ let () = ~__FILE__ "Plugin" [ - ( Protocol.name ^ ": on_flush", + ( "on_flush", [ Tztest.tztest "[on_flush ~validation_state ...] yields an empty state " diff --git a/src/proto_alpha/lib_protocol/test/helpers/alcotezt/alcotest.ml b/src/proto_alpha/lib_protocol/test/helpers/alcotezt/alcotest.ml new file mode 100644 index 0000000000000000000000000000000000000000..faa66ffe9592e29abb356f81470944c36db9a1bb --- /dev/null +++ b/src/proto_alpha/lib_protocol/test/helpers/alcotezt/alcotest.ml @@ -0,0 +1,28 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2023 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. *) +(* *) +(*****************************************************************************) + +include Octez_protocol_alcotezt.Protocol_alcotest + +let run = Octez_protocol_alcotezt.Protocol_alcotest.run Tezt_protocol.protocol diff --git a/src/proto_alpha/lib_protocol/test/helpers/alcotezt/alcotest.mli b/src/proto_alpha/lib_protocol/test/helpers/alcotezt/alcotest.mli new file mode 100644 index 0000000000000000000000000000000000000000..b3188151e2215076a3e92bebfeb4139334304f9d --- /dev/null +++ b/src/proto_alpha/lib_protocol/test/helpers/alcotezt/alcotest.mli @@ -0,0 +1,43 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2023 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. *) +(* *) +(*****************************************************************************) + +(** Protocol-specific Alcotezt wrapper. *) + +(** This modules shadows the function [run] in + [Octez_alcotezt.Alcotest] to automatically add the protocol name + to the title and tags of registered tests. *) +include module type of Octez_alcotezt.Alcotest + +(** Shadowed version of {!Octez_alcotezt.Alcotest.run}, with + protocol-prefixed titles and protocol-specific tags. + + This modules shadows the function [run] in + [Octez_alcotezt.Alcotest] to prefix Alcotest suite names with the + "pretty" version of the protocol name (e.g. [Alpha], [Mumbai], + ... ). It also adds a tag to each registered test identifying the + test. As in integration tests, this is the pretty name lowercased + (e.g. [alpha], [mumbai]). *) +val run : + __FILE__:string -> ?tags:string list -> string -> unit test list -> return diff --git a/src/proto_alpha/lib_protocol/test/helpers/alcotezt/alcotest_lwt.ml b/src/proto_alpha/lib_protocol/test/helpers/alcotezt/alcotest_lwt.ml new file mode 100644 index 0000000000000000000000000000000000000000..1214d7e3c937576575a2475d2bc5178f228f84f3 --- /dev/null +++ b/src/proto_alpha/lib_protocol/test/helpers/alcotezt/alcotest_lwt.ml @@ -0,0 +1,29 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2023 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. *) +(* *) +(*****************************************************************************) + +include Octez_protocol_alcotezt.Protocol_alcotest_lwt + +let run = + Octez_protocol_alcotezt.Protocol_alcotest_lwt.run Tezt_protocol.protocol diff --git a/src/proto_alpha/lib_protocol/test/helpers/alcotezt/alcotest_lwt.mli b/src/proto_alpha/lib_protocol/test/helpers/alcotezt/alcotest_lwt.mli new file mode 100644 index 0000000000000000000000000000000000000000..a02fe4aa0d90ab9ee293542d946e011bae851ff4 --- /dev/null +++ b/src/proto_alpha/lib_protocol/test/helpers/alcotezt/alcotest_lwt.mli @@ -0,0 +1,43 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2023 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. *) +(* *) +(*****************************************************************************) + +(** Protocol-specific Alcotezt_lwt wrapper. *) + +(** This modules shadows the function [run] in + [Octez_alcotezt.Alcotest_lwt] to automatically add the protocol name + to the title and tags of registered tests. *) +include module type of Octez_alcotezt.Alcotest_lwt + +(** Shadowed version of {!Octez_alcotezt.Alcotest_lwt.run}, with + protocol-prefixed titles and protocol-specific tags. + + This modules shadows the function [run] in + [Octez_alcotezt.Alcotest] to prefix Alcotest suite names with the + "pretty" version of the protocol name (e.g. [Alpha], [Mumbai], + ... ). It also adds a tag to each registered test identifying the + test. As in integration tests, this is the pretty name lowercased + (e.g. [alpha], [mumbai]). *) +val run : + __FILE__:string -> ?tags:string list -> string -> unit test list -> return diff --git a/src/proto_alpha/lib_protocol/test/helpers/alcotezt/dune b/src/proto_alpha/lib_protocol/test/helpers/alcotezt/dune new file mode 100644 index 0000000000000000000000000000000000000000..bdb4df4e8cc01645bbb74daa1298cdd4ccff4091 --- /dev/null +++ b/src/proto_alpha/lib_protocol/test/helpers/alcotezt/dune @@ -0,0 +1,15 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(library + (name tezos_alpha_test_helpers_alcotezt) + (public_name tezos-alpha-test-helpers.alcotezt) + (instrumentation (backend bisect_ppx)) + (libraries + tezos-protocol-environment + tezos-protocol-alpha + octez-protocol-alcotezt) + (flags + (:standard) + -open Tezos_protocol_alpha + -open Octez_protocol_alcotezt)) diff --git a/src/proto_alpha/lib_protocol/test/helpers/alcotezt/tezt_protocol.ml b/src/proto_alpha/lib_protocol/test/helpers/alcotezt/tezt_protocol.ml new file mode 100644 index 0000000000000000000000000000000000000000..77a32313194208d6bfc4a92e8038458500e0c0a2 --- /dev/null +++ b/src/proto_alpha/lib_protocol/test/helpers/alcotezt/tezt_protocol.ml @@ -0,0 +1,33 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2023 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. *) +(* *) +(*****************************************************************************) + +let protocol = + (module Protocol : Octez_protocol_alcotezt.Tezt_protocol.PROTOCOL) + +let tag = + (* Get protocol tag from Tezt_tezos *) + Octez_protocol_alcotezt.Tezt_protocol.tag protocol + +let name = Octez_protocol_alcotezt.Tezt_protocol.name protocol diff --git a/src/proto_alpha/lib_protocol/test/helpers/alcotezt/tezt_protocol.mli b/src/proto_alpha/lib_protocol/test/helpers/alcotezt/tezt_protocol.mli new file mode 100644 index 0000000000000000000000000000000000000000..4fc2d66a4608a2bf7bb9ab75d11b8d815e086ff1 --- /dev/null +++ b/src/proto_alpha/lib_protocol/test/helpers/alcotezt/tezt_protocol.mli @@ -0,0 +1,36 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2023 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. *) +(* *) +(*****************************************************************************) + +val protocol : Octez_protocol_alcotezt.Tezt_protocol.protocol + +(** TODO: document *) +val name : string + +(** The protocol-specific Tezt tag of this prototcol + + The protocol tag is the same as defined by + {!Tezt_tezos.Protocol.tag}, that is, the lower-cased "pretty" name + of the protocol (e.g. [Alpha], [Mumbai], ...). *) +val tag : string diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/dune b/src/proto_alpha/lib_protocol/test/integration/consensus/dune index da75d5a3f0b5a8c766509abd4e627240c1a98f8f..8b92e289986c5e8a0ae6426cf829a930f302c3e7 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/dune +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/dune @@ -6,7 +6,7 @@ (instrumentation (backend bisect_ppx)) (libraries tezt.core - octez-alcotezt + tezos-alpha-test-helpers.alcotezt tezos-base tezos-protocol-alpha tezos-alpha-test-helpers @@ -18,7 +18,7 @@ (:standard) -open Tezt_core -open Tezt_core.Base - -open Octez_alcotezt + -open Tezos_alpha_test_helpers_alcotezt -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_alpha 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 index 7e4523930be76abb89bc2c12ad4aae73341f35aa..5d8adb3c8a77f7f3422a41de1491cde9fa250052 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_main.ml +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/test_main.ml @@ -35,19 +35,18 @@ let () = ~__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); + ("endorsement", Test_endorsement.tests); + ("preendorsement", Test_preendorsement.tests); + ("double endorsement", Test_double_endorsement.tests); + ("double preendorsement", Test_double_preendorsement.tests); + ("double baking", Test_double_baking.tests); + ("seed", Test_seed.tests); + ("baking", Test_baking.tests); + ("delegation", Test_delegation.tests); + ("deactivation", Test_deactivation.tests); + ("helpers rpcs", Test_helpers_rpcs.tests); + ("participation monitoring", Test_participation.tests); + ("frozen deposits", Test_frozen_deposits.tests); + ("consensus key", Test_consensus_key.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 b6c3ac7dfcda5392b6fe0f6efb51bb6708171e09..64080a553f16cd2a45f71d5cfb1140234c3b0ba0 100644 --- a/src/proto_alpha/lib_protocol/test/integration/dune +++ b/src/proto_alpha/lib_protocol/test/integration/dune @@ -8,7 +8,7 @@ tezt.core tezt tezos-context - octez-alcotezt + tezos-alpha-test-helpers.alcotezt tezos-base tezos-client-alpha tezos-protocol-alpha @@ -20,7 +20,7 @@ (:standard) -open Tezt_core -open Tezt_core.Base - -open Octez_alcotezt + -open Tezos_alpha_test_helpers_alcotezt -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_client_alpha diff --git a/src/proto_alpha/lib_protocol/test/integration/gas/dune b/src/proto_alpha/lib_protocol/test/integration/gas/dune index 8af85ef19f2ca55835bef016f9e7d9f45e2310df..6f2b81974de8af28855ed3995853633a174e747a 100644 --- a/src/proto_alpha/lib_protocol/test/integration/gas/dune +++ b/src/proto_alpha/lib_protocol/test/integration/gas/dune @@ -6,7 +6,7 @@ (instrumentation (backend bisect_ppx)) (libraries tezt.core - octez-alcotezt + tezos-alpha-test-helpers.alcotezt tezos-base tezos-protocol-alpha tezos-alpha-test-helpers @@ -16,7 +16,7 @@ (:standard) -open Tezt_core -open Tezt_core.Base - -open Octez_alcotezt + -open Tezos_alpha_test_helpers_alcotezt -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_alpha 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 index c5bb194a141618c1179c38ed7cc88dbd4de2f8ee..997b1ba7049cee08c41355ba7541a9065288f849 100644 --- a/src/proto_alpha/lib_protocol/test/integration/gas/test_main.ml +++ b/src/proto_alpha/lib_protocol/test/integration/gas/test_main.ml @@ -35,7 +35,7 @@ let () = ~__FILE__ "protocol > integration > gas" [ - (Protocol.name ^ ": gas levels", Test_gas_levels.tests); - (Protocol.name ^ ": gas cost functions", Test_gas_costs.tests); + ("gas levels", Test_gas_levels.tests); + ("gas cost functions", Test_gas_costs.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 86fa7880924f527994a534d160876ba59a72a07b..5bcfe89917c3b8f7a6c483a6262926400d086031 100644 --- a/src/proto_alpha/lib_protocol/test/integration/michelson/dune +++ b/src/proto_alpha/lib_protocol/test/integration/michelson/dune @@ -6,7 +6,7 @@ (instrumentation (backend bisect_ppx)) (libraries tezt.core - octez-alcotezt + tezos-alpha-test-helpers.alcotezt tezos-base tezos-protocol-alpha tezos-alpha-test-helpers @@ -23,7 +23,7 @@ (:standard) -open Tezt_core -open Tezt_core.Base - -open Octez_alcotezt + -open Tezos_alpha_test_helpers_alcotezt -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_alpha 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 index 082975311139d28db66aa394eb6e9d2e98b51161..f65ed6fbedfb2f859cb7f095c17e9babf1441334 100644 --- a/src/proto_alpha/lib_protocol/test/integration/michelson/test_main.ml +++ b/src/proto_alpha/lib_protocol/test/integration/michelson/test_main.ml @@ -35,31 +35,27 @@ let () = ~__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 ^ ": timelock", Test_timelock.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); + ("global table of constants", Test_global_constants_storage.tests); + ("interpretation", Test_interpretation.tests); + ("lazy storage diff", Test_lazy_storage_diff.tests); + ("sapling", Test_sapling.tests); + ("script typed ir size", Test_script_typed_ir_size.tests); + ("temp big maps", Test_temp_big_maps.tests); + ("ticket balance key", Test_ticket_balance_key.tests); + ("ticket scanner", Test_ticket_scanner.tests); + ("ticket storage", Test_ticket_storage.tests); + ("ticket lazy storage diff", Test_ticket_lazy_storage_diff.tests); + ("ticket operations diff", Test_ticket_operations_diff.tests); + ("ticket accounting", Test_ticket_accounting.tests); + ("ticket balance", Test_ticket_balance.tests); + ("ticket manager", Test_ticket_manager.tests); + ("timelock", Test_timelock.tests); + ("typechecking", Test_typechecking.tests); + ("script cache", Test_script_cache.tests); + ("block time instructions", Test_block_time_instructions.tests); + ("annotations", Test_annotations.tests); + ("event logging", Test_contract_event.tests); + ("patched contracts", Test_patched_contracts.tests); + ("lambda normalization", Test_lambda_normalization.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 3a1f9cd62dc213a029cc6831d90b9ad969c15753..65e1518dfbb8f106758bf19be4a7ccb03cfa8487 100644 --- a/src/proto_alpha/lib_protocol/test/integration/operations/dune +++ b/src/proto_alpha/lib_protocol/test/integration/operations/dune @@ -6,7 +6,7 @@ (instrumentation (backend bisect_ppx)) (libraries tezt.core - octez-alcotezt + tezos-alpha-test-helpers.alcotezt tezos-base tezos-protocol-alpha tezos-client-alpha @@ -18,7 +18,7 @@ (:standard) -open Tezt_core -open Tezt_core.Base - -open Octez_alcotezt + -open Tezos_alpha_test_helpers_alcotezt -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_alpha 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 index d63ba82de880afe9fe5184d5cc7118654aa3d80a..394caad30cc84abe32b6d4122b214c326d7a275d 100644 --- a/src/proto_alpha/lib_protocol/test/integration/operations/test_main.ml +++ b/src/proto_alpha/lib_protocol/test/integration/operations/test_main.ml @@ -35,18 +35,17 @@ let () = ~__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); + ("voting", Test_voting.tests); + ("origination", Test_origination.tests); + ("revelation", Test_reveal.tests); + ("transfer", Test_transfer.tests); + ("activation", Test_activation.tests); + ("paid storage increase", Test_paid_storage_increase.tests); + ("combined", Test_combined_operations.tests); + ("failing_noop operation", Test_failing_noop.tests); + ("sc rollup", Test_sc_rollup.tests); + ("sc rollup transfer", Test_sc_rollup_transfer.tests); + ("zk rollup", Test_zk_rollup.tests); + ("transfer ticket", Test_transfer_ticket.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 index 4ba3dd6d77d4f1c209066c924e23753901cde1d9..248c4260221dd6840ad416f2cc6038c48ea99fc4 100644 --- a/src/proto_alpha/lib_protocol/test/integration/test_main.ml +++ b/src/proto_alpha/lib_protocol/test/integration/test_main.ml @@ -35,12 +35,12 @@ let () = ~__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); - (Protocol.name ^ ": sc rollup wasm", Test_sc_rollup_wasm.tests); + ("constants", Test_constants.tests); + ("liquidity baking", Test_liquidity_baking.tests); + ("storage description", Test_storage.tests); + ("storage tests", Test_storage_functions.tests); + ("token movements", Test_token.tests); + ("frozen bonds", Test_frozen_bonds.tests); + ("sc rollup wasm", Test_sc_rollup_wasm.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 712841be8ca419bc6ee39b7c0184a4df1b7be6e8..e1427963c96ecf09054aba0ad5ee06bf73f9bb02 100644 --- a/src/proto_alpha/lib_protocol/test/integration/validate/dune +++ b/src/proto_alpha/lib_protocol/test/integration/validate/dune @@ -6,7 +6,7 @@ (instrumentation (backend bisect_ppx)) (libraries tezt.core - octez-alcotezt + tezos-alpha-test-helpers.alcotezt tezos-base tezos-protocol-alpha qcheck-alcotest @@ -20,7 +20,7 @@ (:standard) -open Tezt_core -open Tezt_core.Base - -open Octez_alcotezt + -open Tezos_alpha_test_helpers_alcotezt -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_alpha 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 index 031eadd44399ee1e1480162e3d401f4d754dfa68..c80a95b018bf97501304fb868baf0f2eb78bfeec 100644 --- a/src/proto_alpha/lib_protocol/test/integration/validate/test_main.ml +++ b/src/proto_alpha/lib_protocol/test/integration/validate/test_main.ml @@ -35,13 +35,11 @@ let () = ~__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); + ("sanity checks", Test_sanity.tests); + ("mempool", Test_mempool.tests); + ("single manager validation", Test_manager_operation_validation.tests); + ("batched managers validation", Test_validation_batch.tests); + ("one-manager restriction", Test_1m_restriction.tests); + ("covalidity", Test_covalidity.tests); ] |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/pbt/dune b/src/proto_alpha/lib_protocol/test/pbt/dune index cf9aa4066635a65de3219c7f570318f490bf937a..40ccdf23a3b84559c1391cd9ff5bc1c638425735 100644 --- a/src/proto_alpha/lib_protocol/test/pbt/dune +++ b/src/proto_alpha/lib_protocol/test/pbt/dune @@ -13,7 +13,7 @@ tezos-context.merkle_proof_encoding tezos-test-helpers tezos-alpha-test-helpers - octez-alcotezt + tezos-alpha-test-helpers.alcotezt qcheck-alcotest tezos-benchmark tezos-benchmark-alpha @@ -33,7 +33,7 @@ -open Tezos_protocol_alpha -open Tezos_test_helpers -open Tezos_alpha_test_helpers - -open Octez_alcotezt + -open Tezos_alpha_test_helpers_alcotezt -open Tezos_benchmark_alpha -open Tezos_benchmark_type_inference_alpha -open Tezos_smart_rollup_alpha 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 f1a80e207cb71656192c45ab3d0b8dae68c0ed0c..41e7f38ef0953d5f2af45b8176f5f8fc7166a120 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 @@ -321,7 +321,6 @@ let () = ~__FILE__ "protocol > pbt > liquidity baking" [ - ( 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 12c54af32b5c6b3695c8731b924042ed532f128c..e6360ed7be52199ee1bb230bed18f89396793b68 100644 --- a/src/proto_alpha/lib_protocol/test/pbt/saturation_fuzzing.ml +++ b/src/proto_alpha/lib_protocol/test/pbt/saturation_fuzzing.ml @@ -192,10 +192,10 @@ let () = ~__FILE__ "protocol > pbt > saturation" [ - (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 dcb57ea9c95384d6aad5fc4e29892763fd609937..69711dbd89d3315fb53c5bd82ee61570cb897599 100644 --- a/src/proto_alpha/lib_protocol/test/pbt/test_bitset.ml +++ b/src/proto_alpha/lib_protocol/test/pbt/test_bitset.ml @@ -97,7 +97,7 @@ let () = ~__FILE__ "bits" [ - ( Protocol.name ^ ": quantity", + ( "quantity", qcheck_wrap [ QCheck2.Test.make 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 797fbfde0d9f31575b0ec7686517df6b51290551..04d29a0df5596a238817ba8fe1b0bcb8f7a4d42b 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 @@ -547,4 +547,4 @@ let () = Alcotest.run ~__FILE__ "protocol > pbt > carbonated map" - [(Protocol.name ^ ": Carbonated map", tests ~rand)] + [("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 97d862a2e9c5a4acf949cfa37c5e927b2c54a508..55b386ce2a5ea838e60fc154d4150c77f14b32a2 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 @@ -98,6 +98,4 @@ let () = Alcotest.run ~__FILE__ "Compare operations" - [ - (Protocol.name ^ ": Compare_operations", Qcheck2_helpers.qcheck_wrap tests); - ] + [("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 8072df01b76c7f01d77451aad071ffd3f8152752..680cf7d07583baf36e8dca5346a6be25a7ca906c 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 @@ -252,8 +252,5 @@ let () = let dal_parameters = constants_test.dal end) in - Alcotest_lwt.run - ~__FILE__ - (Protocol.name ^ ": Dal slots refutation game") - Test.tests + Alcotest_lwt.run ~__FILE__ "Dal slots refutation game" Test.tests |> Lwt_main.run 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 ca9d505ab6988f06d4a278a246b8ca138deaa8ef..9f89456827adf1bbb20afa6593718e8b2ef6cb0f 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 @@ -143,4 +143,4 @@ let () = Alcotest.run ~__FILE__ "protocol > pbt > gas" - [(Protocol.name ^ ": gas properties", qcheck_wrap tests)] + [("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 56c824bd1ca6936a36ee1a551b05ae0ffbefb687..03f10758db517d09fc56f0bc07d67d0adf961a57 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 @@ -113,13 +113,13 @@ let () = ~__FILE__ "Merkle list" [ - ( 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 08bd36fcfcea1795cb8c925f222da9bc3cdf122f..aa78dcf78d19cbe7110872611d1e6cb1b27b5463 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 @@ -63,4 +63,4 @@ let () = Alcotest.run ~__FILE__ "Operation_encoding" - [(Protocol.name ^ ": roundtrip", qcheck_wrap [test_operation])] + [("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 7f0a6b92c670c889ae32de3c3052fe689ead0eaf..058c99ed2e894ea479999bd9778ebd5c78bc6c97 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 @@ -1802,4 +1802,4 @@ let tests = let tests = [tests; Dissection.tests] -let () = Alcotest.run ~__FILE__ (Protocol.name ^ ": Refutation_game") tests +let () = Alcotest.run ~__FILE__ "Refutation_game" tests 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 e1c507d1f5dd666853db9e0720c08b09714309db..da8ca6b5cd1471f2ca2a7734d076d8a04585f1e0 100644 --- a/src/proto_alpha/lib_protocol/test/pbt/test_sampler.ml +++ b/src/proto_alpha/lib_protocol/test/pbt/test_sampler.ml @@ -267,7 +267,4 @@ let () = Alcotest.run ~__FILE__ "protocol > pbt > sampling" - [ - ( Protocol.name ^ ": sampling", - qcheck_wrap [alias_float_test; alias_z_test] ); - ] + [("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 51f7d0f32046fc029cbc23bb800cbec0e599d075..ca6109e84e1a6c9c88e941abe03dc30e8ee55855 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 @@ -290,7 +290,4 @@ let tests = ] let () = - Alcotest.run - ~__FILE__ - "SC rollup encoding" - [(Protocol.name ^ ": roundtrip", qcheck_wrap tests)] + Alcotest.run ~__FILE__ "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 58f36f75288b782ba1554618f5adfa16867963fe..1e65af134b2363c21083ef1c8819be76aad8ac6d 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 @@ -74,7 +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)] + Alcotest.run ~__FILE__ "Smart rollup inbox" [("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 fd09d78ec0d9d81ebd98c9a4c5d97d36a6f6bbec..10db1f2c255a64619754a4bb9328676583bdb5fe 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 @@ -106,4 +106,4 @@ let () = Alcotest.run ~__FILE__ "Tick_repr" - [(Protocol.name ^ ": Tick_repr", Qcheck2_helpers.qcheck_wrap tests)] + [("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 74c16fe5d08ba6174d75b63d581caaf2c1da2b6c..d2016c98e01e7c1eec0b56e503d2372390b54745 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 @@ -345,12 +345,10 @@ let () = ~__FILE__ "protocol > pbt > script_comparison" [ - ( 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 167d79de53e3966367a005899cd75adc931fc2a9..2a2c0be49df9cac4c281c4005f70ce8fac9415c7 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 @@ -133,4 +133,4 @@ let () = Alcotest.run ~__FILE__ "protocol > pbt > tez_repr" - [(Protocol.name ^ ": Tez_repr", Qcheck2_helpers.qcheck_wrap tests)] + [("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 8db8cd119c4c083d9a0a0933e7397393b3b46746..d40128fb68467bf7697716658ba2add0212c4f24 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 @@ -224,6 +224,6 @@ let () = ~__FILE__ "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/regression/dune b/src/proto_alpha/lib_protocol/test/regression/dune index 2fd1dde8bad67360213df3145c9dfeda1001cd73..6ec6b745a50c49a4de707ae925c70c25832d19b4 100644 --- a/src/proto_alpha/lib_protocol/test/regression/dune +++ b/src/proto_alpha/lib_protocol/test/regression/dune @@ -12,7 +12,8 @@ tezos-client-alpha tezos-protocol-plugin-alpha tezos-alpha-test-helpers - tezos-micheline) + tezos-micheline + octez-protocol-alcotezt) (library_flags (:standard -linkall)) (flags (:standard) @@ -24,7 +25,8 @@ -open Tezos_client_alpha -open Tezos_protocol_plugin_alpha -open Tezos_alpha_test_helpers - -open Tezos_micheline) + -open Tezos_micheline + -open Octez_protocol_alcotezt) (modules test_logging)) (executable diff --git a/src/proto_alpha/lib_protocol/test/regression/test_logging.ml b/src/proto_alpha/lib_protocol/test/regression/test_logging.ml index 8607cdb218469df0e263536f0604c3615aa90675..8315d1ef9085d130eb1d07868cea9d40c62ef635 100644 --- a/src/proto_alpha/lib_protocol/test/regression/test_logging.ml +++ b/src/proto_alpha/lib_protocol/test/regression/test_logging.ml @@ -259,22 +259,19 @@ let fail_on_error f () = | Ok () -> return () | Error e -> Test.fail "%a" Error_monad.pp_print_trace e -(* Make sure that after a snapshot the snapshotted version of the test - has a different [~title], because all tests are linked in [tezt/tests/main.exe]. *) -let protocol = - match __FILE__ =~* rex "^src/proto_([0-9a-zA-Z_]*)/" with - | None -> - Stdlib.failwith ("failed to extract protocol name from path: " ^ __FILE__) - | Some name -> name - let register_script transaction = (* [~title] must be unique across the codebase, so we prefix it with the protocol name. [~file] however is better kept the same across protocols to simplify snapshotting. *) let file = filename transaction in + let protocol = + (module Protocol : Octez_protocol_alcotezt.Tezt_protocol.PROTOCOL) + in + let tag = Tezt_protocol.tag protocol in + let name = Tezt_protocol.name protocol in Regression.register ~__FILE__ - ~title:(protocol ^ ": " ^ file) - ~tags:["protocol"; "regression"; "logging"] + ~title:(name ^ ": " ^ file) + ~tags:[tag; "protocol"; "regression"; "logging"] ~file (fail_on_error @@ run_script transaction) diff --git a/src/proto_alpha/lib_protocol/test/unit/dune b/src/proto_alpha/lib_protocol/test/unit/dune index c1be5bf09ec9580b92e1b6353db5d26dade58dac..dd1cd50edcad5538d30daad890c9bf4962fef6f3 100644 --- a/src/proto_alpha/lib_protocol/test/unit/dune +++ b/src/proto_alpha/lib_protocol/test/unit/dune @@ -17,7 +17,7 @@ tezos-protocol-alpha tezos-test-helpers tezos-alpha-test-helpers - octez-alcotezt + tezos-alpha-test-helpers.alcotezt tezos-scoru-wasm-helpers tezos-stdlib tezos-crypto-dal @@ -37,7 +37,7 @@ -open Tezos_protocol_alpha -open Tezos_test_helpers -open Tezos_alpha_test_helpers - -open Octez_alcotezt + -open Tezos_alpha_test_helpers_alcotezt -open Tezos_scoru_wasm_helpers -open Tezos_stdlib -open Tezos_crypto_dal diff --git a/src/proto_alpha/lib_protocol/test/unit/test_main.ml b/src/proto_alpha/lib_protocol/test/unit/test_main.ml index 2e1e0906871f4afd017489c8490f9d9428c36e43..eaaa6eec95821502240162f9b49322b0fb0b61fc 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_main.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_main.ml @@ -50,69 +50,37 @@ let () = ~__FILE__ "protocol > unit" [ - Unit_test.spec (Protocol.name ^ ": Tez_repr.ml") Test_tez_repr.tests; + Unit_test.spec "Tez_repr.ml" Test_tez_repr.tests; + Unit_test.spec "Contract_repr.ml" Test_contract_repr.tests; + Unit_test.spec "Destination_repr.ml" Test_destination_repr.tests; + Unit_test.spec "Operation_repr.ml" Test_operation_repr.tests; Unit_test.spec - (Protocol.name ^ ": Contract_repr.ml") - Test_contract_repr.tests; - Unit_test.spec - (Protocol.name ^ ": Destination_repr.ml") - Test_destination_repr.tests; - Unit_test.spec - (Protocol.name ^ ": Operation_repr.ml") - Test_operation_repr.tests; - Unit_test.spec - (Protocol.name ^ ": Global_constants_storage.ml") + "Global_constants_storage.ml" Test_global_constants_storage.tests; - Unit_test.spec (Protocol.name ^ ": fitness") Test_fitness.tests; - Unit_test.spec - (Protocol.name ^ ": fixed point computation") - Test_fixed_point.tests; - Unit_test.spec (Protocol.name ^ ": level module") Test_level_module.tests; - Unit_test.spec (Protocol.name ^ ": qty") Test_qty.tests; - Unit_test.spec (Protocol.name ^ ": round") Test_round_repr.tests; - Unit_test.spec (Protocol.name ^ ": time") Test_time_repr.tests; - Unit_test.spec (Protocol.name ^ ": receipt encodings") Test_receipt.tests; - Unit_test.spec - (Protocol.name ^ ": saturation arithmetic") - Test_saturation.tests; - Unit_test.spec (Protocol.name ^ ": gas monad") Test_gas_monad.tests; - Unit_test.spec - (Protocol.name ^ ": sc rollup storage") - Test_sc_rollup_storage.tests; - Unit_test.spec - (Protocol.name ^ ": sc rollup game") - Test_sc_rollup_game.tests; - Unit_test.spec - (Protocol.name ^ ": liquidity baking") - Test_liquidity_baking_repr.tests; - Unit_test.spec - (Protocol.name ^ ": sc rollup wasm") - Test_sc_rollup_wasm.tests; - Unit_test.spec - (Protocol.name ^ ": sc rollup arith") - Test_sc_rollup_arith.tests; - Unit_test.spec (Protocol.name ^ ": merkle list") Test_merkle_list.tests; - Unit_test.spec - (Protocol.name ^ ": sc rollup inbox") - Test_sc_rollup_inbox.tests; - Unit_test.spec (Protocol.name ^ ": skip list") Test_skip_list_repr.tests; - Unit_test.spec - (Protocol.name ^ ": sc rollup management protocol") + Unit_test.spec "fitness" Test_fitness.tests; + Unit_test.spec "fixed point computation" Test_fixed_point.tests; + Unit_test.spec "level module" Test_level_module.tests; + Unit_test.spec "qty" Test_qty.tests; + Unit_test.spec "round" Test_round_repr.tests; + Unit_test.spec "time" Test_time_repr.tests; + Unit_test.spec "receipt encodings" Test_receipt.tests; + Unit_test.spec "saturation arithmetic" Test_saturation.tests; + Unit_test.spec "gas monad" Test_gas_monad.tests; + Unit_test.spec "sc rollup storage" Test_sc_rollup_storage.tests; + Unit_test.spec "sc rollup game" Test_sc_rollup_game.tests; + Unit_test.spec "liquidity baking" Test_liquidity_baking_repr.tests; + Unit_test.spec "sc rollup wasm" Test_sc_rollup_wasm.tests; + Unit_test.spec "sc rollup arith" Test_sc_rollup_arith.tests; + Unit_test.spec "merkle list" Test_merkle_list.tests; + Unit_test.spec "sc rollup inbox" Test_sc_rollup_inbox.tests; + Unit_test.spec "skip list" Test_skip_list_repr.tests; + Unit_test.spec + "sc rollup management protocol" Test_sc_rollup_management_protocol.tests; - Unit_test.spec - (Protocol.name ^ ": Bond_id_repr.ml") - Test_bond_id_repr.tests; - Unit_test.spec - (Protocol.name ^ ": zk rollup storage") - Test_zk_rollup_storage.tests; - Unit_test.spec - (Protocol.name ^ ": Delegate_consensus_key.ml") - Test_consensus_key.tests; - Unit_test.spec - (Protocol.name ^ ": local_contexts") - Test_local_contexts.tests; - Unit_test.spec - (Protocol.name ^ ": dal slot proof") - Test_dal_slot_proof.tests; + Unit_test.spec "Bond_id_repr.ml" Test_bond_id_repr.tests; + Unit_test.spec "zk rollup storage" Test_zk_rollup_storage.tests; + Unit_test.spec "Delegate_consensus_key.ml" Test_consensus_key.tests; + Unit_test.spec "local_contexts" Test_local_contexts.tests; + Unit_test.spec "dal slot proof" Test_dal_slot_proof.tests; ] |> Lwt_main.run diff --git a/tezt/lib_alcotezt/alcotest.ml b/tezt/lib_alcotezt/alcotest.ml index ec3a1cf6066b99055b8ae6e2e01706612d86e538..f4101cae17378bf7bad41d16d10f89dffda9daf7 100644 --- a/tezt/lib_alcotezt/alcotest.ml +++ b/tezt/lib_alcotezt/alcotest.ml @@ -37,13 +37,13 @@ exception Test_error type 'a test = string * 'a test_case list -let run ~__FILE__ library_name tests = +let run ~__FILE__ ?(tags = []) library_name tests = tests |> List.iter @@ fun (test_name, test_cases) -> Test.register ~__FILE__ ~title:(library_name ^ ": " ^ test_name) - ~tags:["alcotezt"] + ~tags:("alcotezt" :: tags) @@ fun () -> (test_cases |> List.iter @@ fun (test_case_name, speed_level, body) -> diff --git a/tezt/lib_alcotezt/alcotest.mli b/tezt/lib_alcotezt/alcotest.mli index 0e5cd54a37ef6b6248bde3e02a7782c1536fd501..e501e5388d836af26560615dfe3236340a36f35e 100644 --- a/tezt/lib_alcotezt/alcotest.mli +++ b/tezt/lib_alcotezt/alcotest.mli @@ -68,8 +68,13 @@ type 'a test = string * 'a test_case list (** Run a test suite. In Tezt, this calls [Test.register] but does not actually run the test suite. - The name of the test suite is used as the filename for the Tezt test. *) -val run : __FILE__:string -> string -> unit test list -> return + + This function extends the original [Alcotest_lwt.run] with the + optional argument [?tags] that are passed to [Test.register], + along with a default ["alcotest"] tag. Likewise, the mandatory + [__FILE__] parameter is added and passed along to [Test.register]. *) +val run : + __FILE__:string -> ?tags:string list -> string -> unit test list -> return (** Values that can be tested with {!check}. *) type 'a testable = (module Tezt_core.Check.EQUALABLE with type t = 'a) diff --git a/tezt/lib_alcotezt/alcotest_lwt.ml b/tezt/lib_alcotezt/alcotest_lwt.ml index 0b91a01a25354e94b80f7d59a10b8f238ddf0b11..25e4a3b7ece1c2d81fcf1a04fdeee2f5e107deee 100644 --- a/tezt/lib_alcotezt/alcotest_lwt.ml +++ b/tezt/lib_alcotezt/alcotest_lwt.ml @@ -47,13 +47,13 @@ let test_case_sync name speed_level body = type 'a test = string * 'a test_case list -let run ~__FILE__ library_name tests = +let run ~__FILE__ ?(tags = []) library_name tests = (tests |> List.iter @@ fun (test_name, test_cases) -> Test.register ~__FILE__ ~title:(library_name ^ ": " ^ test_name) - ~tags:["alcotezt"] + ~tags:("alcotezt" :: tags) @@ fun () -> test_cases |> Lwt_list.iter_s @@ fun (test_case_name, speed_level, body) -> diff --git a/tezt/lib_alcotezt/alcotest_lwt.mli b/tezt/lib_alcotezt/alcotest_lwt.mli index db4c16875ce92b6d02c5db935503d8e653d9db73..40c2ffb8533b205b057bf474bb50e2ba546383ab 100644 --- a/tezt/lib_alcotezt/alcotest_lwt.mli +++ b/tezt/lib_alcotezt/alcotest_lwt.mli @@ -63,5 +63,10 @@ type 'a test = string * 'a test_case list (** Run a test suite. In Tezt, this calls [Test.register] but does not actually run the test suite. - The name of the test suite is used as the filename for the Tezt test. *) -val run : __FILE__:string -> string -> unit test list -> return + + This function extends the original [Alcotest_lwt.run] with the + optional argument [?tags] that are passed to [Test.register], + along with a default ["alcotest"] tag. Likewise, the mandatory + [__FILE__] parameter is added and passed along to [Test.register]. *) +val run : + __FILE__:string -> ?tags:string list -> string -> unit test list -> return diff --git a/tezt/lib_protocol_alcotezt/dune b/tezt/lib_protocol_alcotezt/dune new file mode 100644 index 0000000000000000000000000000000000000000..678a7b30c484afc046649cf7016913fd02ba4d8d --- /dev/null +++ b/tezt/lib_protocol_alcotezt/dune @@ -0,0 +1,15 @@ +; This file was automatically generated, do not edit. +; Edit file manifest/main.ml instead. + +(library + (name octez_protocol_alcotezt) + (public_name octez-protocol-alcotezt) + (instrumentation (backend bisect_ppx)) + (libraries + octez-alcotezt + tezt-tezos + tezos-protocol-environment) + (flags + (:standard) + -open Octez_alcotezt + -open Tezos_protocol_environment)) diff --git a/tezt/lib_protocol_alcotezt/protocol_alcotest.ml b/tezt/lib_protocol_alcotezt/protocol_alcotest.ml new file mode 100644 index 0000000000000000000000000000000000000000..d8ba3d01ef4b5722c782fee6636150db2ba4ace5 --- /dev/null +++ b/tezt/lib_protocol_alcotezt/protocol_alcotest.ml @@ -0,0 +1,34 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2023 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. *) +(* *) +(*****************************************************************************) + +include Alcotest + +let run protocol ~__FILE__ ?(tags = []) library_name tests = + let library_name = Tezt_protocol.name protocol ^ ": " ^ library_name in + Alcotest.run + ~__FILE__ + ~tags:(Tezt_protocol.tag protocol :: tags) + library_name + tests diff --git a/tezt/lib_protocol_alcotezt/protocol_alcotest.mli b/tezt/lib_protocol_alcotezt/protocol_alcotest.mli new file mode 100644 index 0000000000000000000000000000000000000000..f8dedbbf1603ee681a46e932e97e7a406993b7c4 --- /dev/null +++ b/tezt/lib_protocol_alcotezt/protocol_alcotest.mli @@ -0,0 +1,48 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2023 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. *) +(* *) +(*****************************************************************************) + +(** Protocol-specific Alcotezt wrapper. *) + +(** This modules shadows the function [run] in + [Octez_alcotezt.Alcotest] to automatically add the protocol name + to the title and tags of registered tests. *) +include module type of Alcotest + +(** Shadowed version of {!Octez_alcotezt.Alcotest.run}, with + protocol-prefixed titles and protocol-specific tags. + + This modules shadows the function [run] in + [Octez_alcotezt.Alcotest] to prefix Alcotest suite names with the + "pretty" version of the protocol name (e.g. [Alpha], [Mumbai], + ... ). It also adds a tag to each registered test identifying the + test. As in integration tests, this is the pretty name lowercased + (e.g. [alpha], [mumbai]). *) +val run : + Tezt_protocol.protocol -> + __FILE__:string -> + ?tags:string list -> + string -> + unit test list -> + return diff --git a/tezt/lib_protocol_alcotezt/protocol_alcotest_lwt.ml b/tezt/lib_protocol_alcotezt/protocol_alcotest_lwt.ml new file mode 100644 index 0000000000000000000000000000000000000000..a9ceb5eb2883d34185d8eb609232c0756614964d --- /dev/null +++ b/tezt/lib_protocol_alcotezt/protocol_alcotest_lwt.ml @@ -0,0 +1,34 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2023 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. *) +(* *) +(*****************************************************************************) + +include Alcotest_lwt + +let run protocol ~__FILE__ ?(tags = []) library_name tests = + let library_name = Tezt_protocol.name protocol ^ ": " ^ library_name in + Alcotest_lwt.run + ~__FILE__ + ~tags:(Tezt_protocol.tag protocol :: tags) + library_name + tests diff --git a/tezt/lib_protocol_alcotezt/protocol_alcotest_lwt.mli b/tezt/lib_protocol_alcotezt/protocol_alcotest_lwt.mli new file mode 100644 index 0000000000000000000000000000000000000000..e0ba23cd1f9519623b2b2c3f8c835cfc6911ff1d --- /dev/null +++ b/tezt/lib_protocol_alcotezt/protocol_alcotest_lwt.mli @@ -0,0 +1,48 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2023 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. *) +(* *) +(*****************************************************************************) + +(** Protocol-specific Alcotezt_lwt wrapper. *) + +(** This modules shadows the function [run] in + [Octez_alcotezt.Alcotest_lwt] to automatically add the protocol name + to the title and tags of registered tests. *) +include module type of Alcotest_lwt + +(** Shadowed version of {!Octez_alcotezt.Alcotest_lwt.run}, with + protocol-prefixed titles and protocol-specific tags. + + This modules shadows the function [run] in + [Octez_alcotezt.Alcotest] to prefix Alcotest suite names with the + "pretty" version of the protocol name (e.g. [Alpha], [Mumbai], + ... ). It also adds a tag to each registered test identifying the + test. As in integration tests, this is the pretty name lowercased + (e.g. [alpha], [mumbai]). *) +val run : + Tezt_protocol.protocol -> + __FILE__:string -> + ?tags:string list -> + string -> + unit test list -> + return diff --git a/tezt/lib_protocol_alcotezt/tezt_protocol.ml b/tezt/lib_protocol_alcotezt/tezt_protocol.ml new file mode 100644 index 0000000000000000000000000000000000000000..7f8583d981b974cf6219758f0d14040c9045856c --- /dev/null +++ b/tezt/lib_protocol_alcotezt/tezt_protocol.ml @@ -0,0 +1,57 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2023 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. *) +(* *) +(*****************************************************************************) + +module type PROTOCOL = sig + val hash : Tezos_crypto.Hashed.Protocol_hash.t + + val name : string +end + +type protocol = (module PROTOCOL) + +let name_internal (p : protocol) = + let module Protocol = (val p) in + Protocol.name + +let hash (p : protocol) = + let module Protocol = (val p) in + Protocol.hash + +let tezt_protocol (p : protocol) = + p |> hash |> Tezos_crypto.Hashed.Protocol_hash.to_b58check + |> Tezt_tezos.Protocol.of_hash_opt + +let tag (p : protocol) = + match tezt_protocol p with + | Some tezt_protocol -> Tezt_tezos.Protocol.tag tezt_protocol + | None -> + name_internal p |> String.lowercase_ascii + |> String.map (fun c -> + match c with 'a' .. 'z' | '0' .. '9' -> c | _ -> '_') + +let name (p : protocol) = + match tezt_protocol p with + | Some tezt_protocol -> Tezt_tezos.Protocol.name tezt_protocol + | None -> name_internal p diff --git a/tezt/lib_protocol_alcotezt/tezt_protocol.mli b/tezt/lib_protocol_alcotezt/tezt_protocol.mli new file mode 100644 index 0000000000000000000000000000000000000000..f03d1b48edaea6af74220375228103b08b601d81 --- /dev/null +++ b/tezt/lib_protocol_alcotezt/tezt_protocol.mli @@ -0,0 +1,53 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2023 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. *) +(* *) +(*****************************************************************************) + +(** This module provides a bridge between the a Tezos protocols own + notion of a protocol (a [Protocol] module) and Tezts + [Protocol.t]. It is used to simplify registration of Alcotezts in + protocols while enforcing a test naming and tagging policies. *) + +(** Minimal signature of a Protocol. *) +module type PROTOCOL = sig + val hash : Tezos_crypto.Hashed.Protocol_hash.t + + val name : string +end + +(** [protocol] packs modules of signature [PROTOCOL]. *) +type protocol = (module PROTOCOL) + +(** Return the "pretty name" of a [protocol]. + + The pretty name is the same as defined by + {!Tezt_tezos.Protocol.name}, that is, the capitalized, + non-numbered name of a protocol, e.g. [Alpha], [Mumbai], ... *) +val name : protocol -> string + +(** The protocol-specific Tezt tag of this prototcol + + The protocol tag is the same as defined by + {!Tezt_tezos.Protocol.tag}, that is, the lower-cased "pretty" name + of the protocol (e.g. [alpha], [mumbai], ...). *) +val tag : protocol -> string diff --git a/tezt/lib_tezos/protocol.ml b/tezt/lib_tezos/protocol.ml index 05c0c6618d1c36b77d180c1803a51d1009f6aadb..99067fbe4e9f5b2edfb0ec080140285af346fbe0 100644 --- a/tezt/lib_tezos/protocol.ml +++ b/tezt/lib_tezos/protocol.ml @@ -56,6 +56,17 @@ let hash = function | Mumbai -> "PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1" | Nairobi -> "PtNairobi9MxcBmKF7avFwkUohUu9KuxHt3w9cBmJ7ULqPD7cY5" +let of_hash_opt = function + | "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK" -> Some Alpha + | "PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW" -> Some Lima + | "PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1" -> Some Mumbai + | _ -> None + +let of_hash hash = + match of_hash_opt hash with + | Some protocol -> protocol + | None -> failwith (sf "[Protocol.of_hash] unknown protocol hash '%s'" hash) + let genesis_hash = "ProtoGenesisGenesisGenesisGenesisGenesisGenesk612im" let demo_noops_hash = "ProtoDemoNoopsDemoNoopsDemoNoopsDemoNoopsDemo6XBoYp" diff --git a/tezt/lib_tezos/protocol.mli b/tezt/lib_tezos/protocol.mli index 655b1f7e7ba61577f5695eb2543a614510606c71..2a7e54ed97d84d13aa6e538f7403267902c7903f 100644 --- a/tezt/lib_tezos/protocol.mli +++ b/tezt/lib_tezos/protocol.mli @@ -37,6 +37,14 @@ val default_constants : constants (** Get the name of a protocol, capitalized (e.g. ["Edo"]). *) val name : t -> string +(** Get the protocol corresponding to a given full hash. + + Raises an error if the hash is not one of the protocols of {!all}. *) +val of_hash : string -> t + +(** As [of_hash], but return [None] instead of raising an error. *) +val of_hash_opt : string -> t option + (** Get the number of a protocol, e.g. 012 for Ithaca. The number for [Alpha] is the number it will have once snapshotted.