diff --git a/manifest/main.ml b/manifest/main.ml index 1a29d2fbb15d9157abb53e75ba34699dce982929..ebfa8ee5cebbb9a3a36ca0e9f997f2d70ea65645 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -480,7 +480,7 @@ let octez_stdlib = ~foreign_stubs:{language = C; flags = []; names = ["tzBytes_c"]} let _octez_stdlib_tests = - tests + tezt [ "test_bits"; "test_tzList"; @@ -490,6 +490,7 @@ let _octez_stdlib_tests = "test_functionalArray"; "test_hash_queue"; "test_tzBytes"; + "test_arrays"; ] ~path:"src/lib_stdlib/test" ~opam:"tezos-stdlib" @@ -497,7 +498,7 @@ let _octez_stdlib_tests = ~deps: [ octez_stdlib |> open_; - alcotest; + alcotezt; bigstring; octez_test_helpers |> open_; qcheck_alcotest; @@ -505,7 +506,7 @@ let _octez_stdlib_tests = ~js_compatible:true let _octez_stdlib_test_unix = - tests + tezt [ "test_lwt_pipe"; "test_circular_buffer"; @@ -517,8 +518,7 @@ let _octez_stdlib_test_unix = ~deps: [ octez_stdlib |> open_; - alcotest; - alcotest_lwt; + alcotezt; lwt_log; bigstring; lwt_unix; @@ -1037,8 +1037,8 @@ let octez_stdlib_unix = ] let _octez_stdlib_unix_test = - test - "test_key_value_store_fuzzy" + tezt + ["test_key_value_store_fuzzy"] ~path:"src/lib_stdlib_unix/test/" ~opam:"tezos-stdlib-unix" ~deps: @@ -1046,7 +1046,7 @@ let _octez_stdlib_unix_test = octez_error_monad |> open_ |> open_ ~m:"TzLwtreslib"; octez_stdlib_unix |> open_; qcheck_alcotest; - alcotest_lwt; + alcotezt; ] let octez_clic = diff --git a/opam/tezos-stdlib-unix.opam b/opam/tezos-stdlib-unix.opam index ec825979b16eb38d376c7108d02b584b4abcb682..4e25077d3fe9dd43c95c358a392a68a08db1857c 100644 --- a/opam/tezos-stdlib-unix.opam +++ b/opam/tezos-stdlib-unix.opam @@ -26,12 +26,14 @@ depends: [ "lwt_log" "conf-libev" "uri" { >= "3.1.0" } + "tezt" { with-test & >= "3.0.0" } "qcheck-alcotest" { with-test & >= "0.20" } - "alcotest-lwt" { with-test & >= "1.5.0" } + "octez-alcotezt" {with-test} ] build: [ ["rm" "-r" "vendors"] ["dune" "build" "-p" name "-j" jobs] ["dune" "runtest" "-p" name "-j" jobs] {with-test} + ["dune" "build" "@runtezt" "-p" name "-j" jobs] {with-test} ] synopsis: "Tezos: yet-another local-extension of the OCaml standard library (unix-specific fragment)" diff --git a/opam/tezos-stdlib.opam b/opam/tezos-stdlib.opam index 7581d2f6a3a6e7f4ac9695c4135e7926d164e758..f3bd79d8188e3df4f6dfd34a250dc9f94c5d9ce3 100644 --- a/opam/tezos-stdlib.opam +++ b/opam/tezos-stdlib.opam @@ -16,16 +16,17 @@ depends: [ "zarith_stubs_js" "lwt" { >= "5.6.0" } "aches" { >= "1.0.0" } - "alcotest" { with-test & >= "1.5.0" } + "tezt" { with-test & >= "3.0.0" } + "octez-alcotezt" {with-test} "bigstring" {with-test} "tezos-test-helpers" {with-test} "qcheck-alcotest" { with-test & >= "0.20" } - "alcotest-lwt" { with-test & >= "1.5.0" } "lwt_log" {with-test} ] build: [ ["rm" "-r" "vendors"] ["dune" "build" "-p" name "-j" jobs] ["dune" "runtest" "-p" name "-j" jobs] {with-test} + ["dune" "build" "@runtezt" "-p" name "-j" jobs] {with-test} ] synopsis: "Tezos: yet-another local-extension of the OCaml standard library" diff --git a/src/lib_stdlib/test-unix/dune b/src/lib_stdlib/test-unix/dune index d003644b17dfd28da0a42f689abd780a98f0509a..6168adb3e6a9ea37c4980da7a60c81ccb3c68d86 100644 --- a/src/lib_stdlib/test-unix/dune +++ b/src/lib_stdlib/test-unix/dune @@ -1,42 +1,41 @@ ; This file was automatically generated, do not edit. ; Edit file manifest/main.ml instead. -(executables - (names - test_lwt_pipe - test_circular_buffer - test_circular_buffer_fuzzy - test_hash_queue_lwt) +(library + (name src_lib_stdlib_test_unix_tezt_lib) + (instrumentation (backend bisect_ppx)) (libraries + tezt.core tezos-stdlib - alcotest - alcotest-lwt + octez-alcotezt lwt_log bigstring lwt.unix tezos-test-helpers qcheck-alcotest) + (library_flags (:standard -linkall)) (flags (:standard) + -open Tezt_core + -open Tezt_core.Base -open Tezos_stdlib - -open Tezos_test_helpers)) - -(rule - (alias runtest) - (package tezos-stdlib) - (action (run %{dep:./test_lwt_pipe.exe}))) + -open Octez_alcotezt + -open Tezos_test_helpers) + (modules + test_lwt_pipe + test_circular_buffer + test_circular_buffer_fuzzy + test_hash_queue_lwt)) -(rule - (alias runtest) - (package tezos-stdlib) - (action (run %{dep:./test_circular_buffer.exe}))) +(executable + (name main) + (libraries + src_lib_stdlib_test_unix_tezt_lib + tezt) + (modules main)) -(rule - (alias runtest) - (package tezos-stdlib) - (action (run %{dep:./test_circular_buffer_fuzzy.exe}))) +(rule (alias runtezt) (package tezos-stdlib) (action (run %{dep:./main.exe}))) (rule - (alias runtest) - (package tezos-stdlib) - (action (run %{dep:./test_hash_queue_lwt.exe}))) + (targets main.ml) + (action (with-stdout-to %{targets} (echo "let () = Tezt.Test.run ()")))) diff --git a/src/lib_stdlib/test-unix/test_circular_buffer.ml b/src/lib_stdlib/test-unix/test_circular_buffer.ml index f315f9260cd598588f8ae49de6954b985c3e8cbc..4dc3908cab9c8390d3e4ff9252b92cc0caf51c07 100644 --- a/src/lib_stdlib/test-unix/test_circular_buffer.ml +++ b/src/lib_stdlib/test-unix/test_circular_buffer.ml @@ -359,7 +359,6 @@ let wrap n f = let () = Alcotest.run - ~argv:[|""|] "tezos-stdlib" (List.map (fun (run, descr) -> diff --git a/src/lib_stdlib/test/dune b/src/lib_stdlib/test/dune index f5e0fa6d2268673eca119ca85e1da46dccfe2afc..fb6ca69fe289c94c612408cf797f479abd7c4ee2 100644 --- a/src/lib_stdlib/test/dune +++ b/src/lib_stdlib/test/dune @@ -1,105 +1,64 @@ ; This file was automatically generated, do not edit. ; Edit file manifest/main.ml instead. -(executables - (names - test_bits - test_tzList - test_bounded_heap - test_tzString - test_fallbackArray - test_functionalArray - test_hash_queue - test_tzBytes) - (modes native js) +(library + (name src_lib_stdlib_test_tezt_lib) + (instrumentation (backend bisect_ppx)) (libraries + tezt.core tezos-stdlib - alcotest + octez-alcotezt bigstring tezos-test-helpers qcheck-alcotest) (js_of_ocaml) + (library_flags (:standard -linkall)) (flags (:standard) + -open Tezt_core + -open Tezt_core.Base -open Tezos_stdlib - -open Tezos_test_helpers)) - -(rule - (alias runtest) - (package tezos-stdlib) - (action (run %{dep:./test_bits.exe}))) - -(rule - (alias runtest) - (package tezos-stdlib) - (action (run %{dep:./test_tzList.exe}))) - -(rule - (alias runtest) - (package tezos-stdlib) - (action (run %{dep:./test_bounded_heap.exe}))) - -(rule - (alias runtest) - (package tezos-stdlib) - (action (run %{dep:./test_tzString.exe}))) - -(rule - (alias runtest) - (package tezos-stdlib) - (action (run %{dep:./test_fallbackArray.exe}))) - -(rule - (alias runtest) - (package tezos-stdlib) - (action (run %{dep:./test_functionalArray.exe}))) - -(rule - (alias runtest) - (package tezos-stdlib) - (action (run %{dep:./test_hash_queue.exe}))) - -(rule - (alias runtest) - (package tezos-stdlib) - (action (run %{dep:./test_tzBytes.exe}))) - -(rule - (alias runtest_js) - (package tezos-stdlib) - (action (run node %{dep:./test_bits.bc.js}))) - -(rule - (alias runtest_js) - (package tezos-stdlib) - (action (run node %{dep:./test_tzList.bc.js}))) + -open Octez_alcotezt + -open Tezos_test_helpers) + (modules + test_bits + test_tzList + test_bounded_heap + test_tzString + test_fallbackArray + test_functionalArray + test_hash_queue + test_tzBytes + test_arrays)) -(rule - (alias runtest_js) - (package tezos-stdlib) - (action (run node %{dep:./test_bounded_heap.bc.js}))) +(executable + (name main) + (modes native) + (libraries + src_lib_stdlib_test_tezt_lib + tezt) + (modules main)) -(rule - (alias runtest_js) - (package tezos-stdlib) - (action (run node %{dep:./test_tzString.bc.js}))) +(rule (alias runtezt) (package tezos-stdlib) (action (run %{dep:./main.exe}))) (rule - (alias runtest_js) - (package tezos-stdlib) - (action (run node %{dep:./test_fallbackArray.bc.js}))) + (targets main.ml) + (action (with-stdout-to %{targets} (echo "let () = Tezt.Test.run ()")))) -(rule - (alias runtest_js) - (package tezos-stdlib) - (action (run node %{dep:./test_functionalArray.bc.js}))) +(executable + (name main_js) + (modes js) + (libraries + src_lib_stdlib_test_tezt_lib + tezt.js) + (js_of_ocaml) + (modules main_js)) (rule - (alias runtest_js) + (alias runtezt_js) (package tezos-stdlib) - (action (run node %{dep:./test_hash_queue.bc.js}))) + (action (run node %{dep:./main_js.bc.js}))) (rule - (alias runtest_js) - (package tezos-stdlib) - (action (run node %{dep:./test_tzBytes.bc.js}))) + (targets main_js.ml) + (action (with-stdout-to %{targets} (echo "let () = Tezt_js.Test.run ()")))) diff --git a/src/lib_stdlib_unix/test/dune b/src/lib_stdlib_unix/test/dune index ed0a034ba0d75cda0184327d7dc2bd5101f4847b..5210e8034e4ae0895b621017a5644272a0d66b6a 100644 --- a/src/lib_stdlib_unix/test/dune +++ b/src/lib_stdlib_unix/test/dune @@ -1,20 +1,38 @@ ; This file was automatically generated, do not edit. ; Edit file manifest/main.ml instead. -(executable - (name test_key_value_store_fuzzy) +(library + (name src_lib_stdlib_unix_test__tezt_lib) + (instrumentation (backend bisect_ppx)) (libraries + tezt.core tezos-error-monad tezos-stdlib-unix qcheck-alcotest - alcotest-lwt) + octez-alcotezt) + (library_flags (:standard -linkall)) (flags (:standard) + -open Tezt_core + -open Tezt_core.Base -open Tezos_error_monad -open Tezos_error_monad.TzLwtreslib - -open Tezos_stdlib_unix)) + -open Tezos_stdlib_unix + -open Octez_alcotezt) + (modules test_key_value_store_fuzzy)) + +(executable + (name main) + (libraries + src_lib_stdlib_unix_test__tezt_lib + tezt) + (modules main)) (rule - (alias runtest) + (alias runtezt) (package tezos-stdlib-unix) - (action (run %{dep:./test_key_value_store_fuzzy.exe}))) + (action (run %{dep:./main.exe}))) + +(rule + (targets main.ml) + (action (with-stdout-to %{targets} (echo "let () = Tezt.Test.run ()")))) diff --git a/src/lib_stdlib_unix/test/test_key_value_store_fuzzy.ml b/src/lib_stdlib_unix/test/test_key_value_store_fuzzy.ml index 621f9004e12c94ec89b6bee43d82a3e68d330264..ad778a73ca0f383f7f9cf0ba985ed6f60ff6d6e1 100644 --- a/src/lib_stdlib_unix/test/test_key_value_store_fuzzy.ml +++ b/src/lib_stdlib_unix/test/test_key_value_store_fuzzy.ml @@ -497,4 +497,10 @@ let parallel_test = | Error err -> QCheck2.Test.fail_reportf "%a@." Error_monad.pp_print_trace err) -let () = QCheck_base_runner.run_tests_main [sequential_test; parallel_test] +let () = + Alcotest.run + "test-key-value-store-fuzzy" + [ + ("sequential", [QCheck_alcotest.to_alcotest sequential_test]); + ("parallel", [QCheck_alcotest.to_alcotest parallel_test]); + ] diff --git a/tezt/tests/dune b/tezt/tests/dune index c8bd0f1d30af6aefcdd51a3e8f23d9b9ea7fd377..cfed44a9ad952f014132c7abe8116f43f084742c 100644 --- a/tezt/tests/dune +++ b/tezt/tests/dune @@ -16,6 +16,9 @@ src_proto_alpha_lib_protocol_test_regression_tezt_lib src_proto_016_PtMumbai_lib_protocol_test_regression_tezt_lib src_proto_015_PtLimaPt_lib_protocol_test_regression_tezt_lib + src_lib_stdlib_unix_test__tezt_lib + src_lib_stdlib_test_unix_tezt_lib + src_lib_stdlib_test_tezt_lib src_lib_p2p_tezt_tezt_lib src_lib_lwt_result_stdlib_test_tezt_lib src_lib_error_monad_test_tezt_lib