From e615baf1fe689bc35eb68d7d2b3656d6582c389f Mon Sep 17 00:00:00 2001 From: lykimq Date: Fri, 3 Mar 2023 13:54:32 +0100 Subject: [PATCH] Alcotezt: port [src/proto_/lib_protocol/test/integration/gas] --- manifest/main.ml | 6 ++-- .../lib_protocol/test/integration/gas/dune | 34 ++++++++++++++----- .../integration/gas/{main.ml => test_main.ml} | 4 +-- .../lib_protocol/test/integration/gas/dune | 34 ++++++++++++++----- .../integration/gas/{main.ml => test_main.ml} | 4 +-- .../lib_protocol/test/integration/gas/dune | 34 ++++++++++++++----- .../integration/gas/{main.ml => test_main.ml} | 4 +-- tezt/tests/dune | 3 ++ 8 files changed, 90 insertions(+), 33 deletions(-) rename src/proto_015_PtLimaPt/lib_protocol/test/integration/gas/{main.ml => test_main.ml} (94%) rename src/proto_016_PtMumbai/lib_protocol/test/integration/gas/{main.ml => test_main.ml} (94%) rename src/proto_alpha/lib_protocol/test/integration/gas/{main.ml => test_main.ml} (94%) diff --git a/manifest/main.ml b/manifest/main.ml index 244412fef35e..ef683f6bdbec 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -3929,14 +3929,14 @@ end = struct ] in let _integration_gas = - test - "main" + tezt + ["test_main"; "test_gas_costs"; "test_gas_levels"] ~path:(path // "lib_protocol/test/integration/gas") ~opam:(sf "tezos-protocol-%s-tests" name_dash) ~with_macos_security_framework:true ~deps: [ - alcotest_lwt; + alcotezt; octez_base |> open_ ~m:"TzPervasives" |> open_ ~m:"TzPervasives.Error_monad.Legacy_monad_globals"; main |> open_; 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 e6d1eefaac39..ab77677d1cf5 100644 --- a/src/proto_015_PtLimaPt/lib_protocol/test/integration/gas/dune +++ b/src/proto_015_PtLimaPt/lib_protocol/test/integration/gas/dune @@ -1,26 +1,44 @@ ; This file was automatically generated, do not edit. ; Edit file manifest/main.ml instead. -(executable - (name main) +(library + (name src_proto_015_PtLimaPt_lib_protocol_test_integration_gas_tezt_lib) + (instrumentation (backend bisect_ppx)) (libraries - alcotest-lwt + tezt.core + octez-alcotezt tezos-base tezos-protocol-015-PtLimaPt tezos-015-PtLimaPt-test-helpers tezos-base-test-helpers) - (link_flags - (:standard) - (:include %{workspace_root}/macos-link-flags.sexp)) + (library_flags (:standard -linkall)) (flags (:standard) + -open Tezt_core + -open Tezt_core.Base + -open Octez_alcotezt -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_015_PtLimaPt -open Tezos_015_PtLimaPt_test_helpers - -open Tezos_base_test_helpers)) + -open Tezos_base_test_helpers) + (modules test_main test_gas_costs test_gas_levels)) + +(executable + (name main) + (libraries + src_proto_015_PtLimaPt_lib_protocol_test_integration_gas_tezt_lib + tezt) + (link_flags + (:standard) + (:include %{workspace_root}/macos-link-flags.sexp)) + (modules main)) (rule - (alias runtest) + (alias runtezt) (package tezos-protocol-015-PtLimaPt-tests) (action (run %{dep:./main.exe}))) + +(rule + (targets main.ml) + (action (with-stdout-to %{targets} (echo "let () = Tezt.Test.run ()")))) diff --git a/src/proto_015_PtLimaPt/lib_protocol/test/integration/gas/main.ml b/src/proto_015_PtLimaPt/lib_protocol/test/integration/gas/test_main.ml similarity index 94% rename from src/proto_015_PtLimaPt/lib_protocol/test/integration/gas/main.ml rename to src/proto_015_PtLimaPt/lib_protocol/test/integration/gas/test_main.ml index bba8b42862d2..36158ba0f06e 100644 --- a/src/proto_015_PtLimaPt/lib_protocol/test/integration/gas/main.ml +++ b/src/proto_015_PtLimaPt/lib_protocol/test/integration/gas/test_main.ml @@ -34,7 +34,7 @@ let () = Alcotest_lwt.run "protocol > integration > gas" [ - ("gas levels", Test_gas_levels.tests); - ("gas cost functions", Test_gas_costs.tests); + (Protocol.name ^ ": gas levels", Test_gas_levels.tests); + (Protocol.name ^ ": gas cost functions", Test_gas_costs.tests); ] |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/dune b/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/dune index b7f8e202695e..3e4a2d02d572 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/dune +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/dune @@ -1,26 +1,44 @@ ; This file was automatically generated, do not edit. ; Edit file manifest/main.ml instead. -(executable - (name main) +(library + (name src_proto_016_PtMumbai_lib_protocol_test_integration_gas_tezt_lib) + (instrumentation (backend bisect_ppx)) (libraries - alcotest-lwt + tezt.core + octez-alcotezt tezos-base tezos-protocol-016-PtMumbai tezos-016-PtMumbai-test-helpers tezos-base-test-helpers) - (link_flags - (:standard) - (:include %{workspace_root}/macos-link-flags.sexp)) + (library_flags (:standard -linkall)) (flags (:standard) + -open Tezt_core + -open Tezt_core.Base + -open Octez_alcotezt -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_016_PtMumbai -open Tezos_016_PtMumbai_test_helpers - -open Tezos_base_test_helpers)) + -open Tezos_base_test_helpers) + (modules test_main test_gas_costs test_gas_levels)) + +(executable + (name main) + (libraries + src_proto_016_PtMumbai_lib_protocol_test_integration_gas_tezt_lib + tezt) + (link_flags + (:standard) + (:include %{workspace_root}/macos-link-flags.sexp)) + (modules main)) (rule - (alias runtest) + (alias runtezt) (package tezos-protocol-016-PtMumbai-tests) (action (run %{dep:./main.exe}))) + +(rule + (targets main.ml) + (action (with-stdout-to %{targets} (echo "let () = Tezt.Test.run ()")))) diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/main.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/test_main.ml similarity index 94% rename from src/proto_016_PtMumbai/lib_protocol/test/integration/gas/main.ml rename to src/proto_016_PtMumbai/lib_protocol/test/integration/gas/test_main.ml index bba8b42862d2..36158ba0f06e 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/main.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/gas/test_main.ml @@ -34,7 +34,7 @@ let () = Alcotest_lwt.run "protocol > integration > gas" [ - ("gas levels", Test_gas_levels.tests); - ("gas cost functions", Test_gas_costs.tests); + (Protocol.name ^ ": gas levels", Test_gas_levels.tests); + (Protocol.name ^ ": gas cost functions", Test_gas_costs.tests); ] |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/gas/dune b/src/proto_alpha/lib_protocol/test/integration/gas/dune index 0615a57c1056..10eeffc0d8e1 100644 --- a/src/proto_alpha/lib_protocol/test/integration/gas/dune +++ b/src/proto_alpha/lib_protocol/test/integration/gas/dune @@ -1,26 +1,44 @@ ; This file was automatically generated, do not edit. ; Edit file manifest/main.ml instead. -(executable - (name main) +(library + (name src_proto_alpha_lib_protocol_test_integration_gas_tezt_lib) + (instrumentation (backend bisect_ppx)) (libraries - alcotest-lwt + tezt.core + octez-alcotezt tezos-base tezos-protocol-alpha tezos-alpha-test-helpers tezos-base-test-helpers) - (link_flags - (:standard) - (:include %{workspace_root}/macos-link-flags.sexp)) + (library_flags (:standard -linkall)) (flags (:standard) + -open Tezt_core + -open Tezt_core.Base + -open Octez_alcotezt -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_protocol_alpha -open Tezos_alpha_test_helpers - -open Tezos_base_test_helpers)) + -open Tezos_base_test_helpers) + (modules test_main test_gas_costs test_gas_levels)) + +(executable + (name main) + (libraries + src_proto_alpha_lib_protocol_test_integration_gas_tezt_lib + tezt) + (link_flags + (:standard) + (:include %{workspace_root}/macos-link-flags.sexp)) + (modules main)) (rule - (alias runtest) + (alias runtezt) (package tezos-protocol-alpha-tests) (action (run %{dep:./main.exe}))) + +(rule + (targets main.ml) + (action (with-stdout-to %{targets} (echo "let () = Tezt.Test.run ()")))) diff --git a/src/proto_alpha/lib_protocol/test/integration/gas/main.ml b/src/proto_alpha/lib_protocol/test/integration/gas/test_main.ml similarity index 94% rename from src/proto_alpha/lib_protocol/test/integration/gas/main.ml rename to src/proto_alpha/lib_protocol/test/integration/gas/test_main.ml index bba8b42862d2..36158ba0f06e 100644 --- a/src/proto_alpha/lib_protocol/test/integration/gas/main.ml +++ b/src/proto_alpha/lib_protocol/test/integration/gas/test_main.ml @@ -34,7 +34,7 @@ let () = Alcotest_lwt.run "protocol > integration > gas" [ - ("gas levels", Test_gas_levels.tests); - ("gas cost functions", Test_gas_costs.tests); + (Protocol.name ^ ": gas levels", Test_gas_levels.tests); + (Protocol.name ^ ": gas cost functions", Test_gas_costs.tests); ] |> Lwt_main.run diff --git a/tezt/tests/dune b/tezt/tests/dune index 91a754fb5a2a..d80ea36d8acb 100644 --- a/tezt/tests/dune +++ b/tezt/tests/dune @@ -16,18 +16,21 @@ src_proto_alpha_lib_protocol_test_regression_tezt_lib src_proto_alpha_lib_protocol_test_pbt_tezt_lib src_proto_alpha_lib_protocol_test_integration_operations_tezt_lib + src_proto_alpha_lib_protocol_test_integration_gas_tezt_lib src_proto_alpha_lib_plugin_test_tezt_lib src_proto_alpha_lib_delegate_test_tezt_lib src_proto_alpha_lib_client_test_tezt_lib src_proto_016_PtMumbai_lib_protocol_test_regression_tezt_lib src_proto_016_PtMumbai_lib_protocol_test_pbt_tezt_lib src_proto_016_PtMumbai_lib_protocol_test_integration_operations_tezt_lib + src_proto_016_PtMumbai_lib_protocol_test_integration_gas_tezt_lib src_proto_016_PtMumbai_lib_plugin_test_tezt_lib src_proto_016_PtMumbai_lib_delegate_test_tezt_lib src_proto_016_PtMumbai_lib_client_test_tezt_lib src_proto_015_PtLimaPt_lib_protocol_test_regression_tezt_lib src_proto_015_PtLimaPt_lib_protocol_test_pbt_tezt_lib src_proto_015_PtLimaPt_lib_protocol_test_integration_operations_tezt_lib + src_proto_015_PtLimaPt_lib_protocol_test_integration_gas_tezt_lib src_proto_015_PtLimaPt_lib_plugin_test_tezt_lib src_proto_015_PtLimaPt_lib_delegate_test_tezt_lib src_proto_015_PtLimaPt_lib_client_test_tezt_lib -- GitLab