diff --git a/manifest/main.ml b/manifest/main.ml index 9926e98f2a392e9d722df7b45999d99832950307..c72bfc39adfe5cf7cca7fde1d3fd578a92541921 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -857,8 +857,22 @@ let octez_crypto = ~js_compatible:true let _octez_crypto_tests = - tests - ["test_run"; "test_prop_signature"] + tezt + [ + "test_run"; + "test_prop_signature"; + "roundtrips"; + "key_encoding_vectors"; + "test_base58"; + "test_blake2b"; + "test_crypto_box"; + "test_deterministic_nonce"; + "test_merkle"; + "test_signature"; + "test_signature_encodings"; + "test_timelock"; + "test_context_hash"; + ] ~path:"src/lib_crypto/test" ~opam:"tezos-crypto" ~deps: @@ -870,7 +884,7 @@ let _octez_crypto_tests = zarith_stubs_js; octez_hacl; data_encoding |> open_; - alcotest; + alcotezt; qcheck_alcotest; octez_test_helpers |> open_; ] @@ -878,7 +892,7 @@ let _octez_crypto_tests = ~js_compatible:true let _octez_crypto_tests_unix = - tests + tezt ["test_crypto_box"] ~path:"src/lib_crypto/test-unix" ~opam:"tezos-crypto" @@ -891,8 +905,7 @@ let _octez_crypto_tests_unix = zarith_stubs_js; octez_hacl; data_encoding |> open_; - alcotest; - alcotest_lwt; + alcotezt; lwt_unix; qcheck_alcotest; octez_test_helpers |> open_; diff --git a/opam/tezos-crypto.opam b/opam/tezos-crypto.opam index 717abc0cf11b70e519aea37ebf42177a5188c8f7..9453efa4d09ceb29acce511d70114f97b94eb693 100644 --- a/opam/tezos-crypto.opam +++ b/opam/tezos-crypto.opam @@ -23,14 +23,15 @@ depends: [ "zarith_stubs_js" "bls12-381" { >= "6.0.1" & < "6.1.0" } "bls12-381-signature" { = "1.0.0" } - "alcotest" { with-test & >= "1.5.0" } + "tezt" { with-test & >= "3.0.0" } + "octez-alcotezt" {with-test} "qcheck-alcotest" { with-test & >= "0.20" } "tezos-test-helpers" {with-test} - "alcotest-lwt" { with-test & >= "1.5.0" } ] 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: library with all the cryptographic primitives used by Tezos" diff --git a/src/lib_crypto/test-unix/dune b/src/lib_crypto/test-unix/dune index c59f705fde4b2f4a6a9874056f1c7a54a99b413c..450a8d25728194b1036e1acc1bf6ce889765a33c 100644 --- a/src/lib_crypto/test-unix/dune +++ b/src/lib_crypto/test-unix/dune @@ -1,9 +1,11 @@ ; This file was automatically generated, do not edit. ; Edit file manifest/main.ml instead. -(executable - (name test_crypto_box) +(library + (name src_lib_crypto_test_unix_tezt_lib) + (instrumentation (backend bisect_ppx)) (libraries + tezt.core tezos-stdlib tezos-crypto tezos-error-monad @@ -11,20 +13,32 @@ zarith_stubs_js tezos-hacl data-encoding - alcotest - alcotest-lwt + octez-alcotezt lwt.unix qcheck-alcotest tezos-test-helpers) + (library_flags (:standard -linkall)) (flags (:standard) + -open Tezt_core + -open Tezt_core.Base -open Tezos_stdlib -open Tezos_crypto -open Tezos_error_monad.TzLwtreslib -open Data_encoding - -open Tezos_test_helpers)) + -open Octez_alcotezt + -open Tezos_test_helpers) + (modules test_crypto_box)) + +(executable + (name main) + (libraries + src_lib_crypto_test_unix_tezt_lib + tezt) + (modules main)) + +(rule (alias runtezt) (package tezos-crypto) (action (run %{dep:./main.exe}))) (rule - (alias runtest) - (package tezos-crypto) - (action (run %{dep:./test_crypto_box.exe}))) + (targets main.ml) + (action (with-stdout-to %{targets} (echo "let () = Tezt.Test.run ()")))) diff --git a/src/lib_crypto/test/dune b/src/lib_crypto/test/dune index 9ceaa2c9e182f7ca21f5a176090f045e5ced788a..4cb9c0ef0c0531b65d1d8ea9b79d4a0b292038bd 100644 --- a/src/lib_crypto/test/dune +++ b/src/lib_crypto/test/dune @@ -3,10 +3,11 @@ (env (_ (env-vars (NODE_PRELOAD hacl-wasm,ocaml-bls12-381,secp256k1-wasm)))) -(executables - (names test_run test_prop_signature) - (modes native js) +(library + (name src_lib_crypto_test_tezt_lib) + (instrumentation (backend bisect_ppx)) (libraries + tezt.core tezos-stdlib tezos-crypto tezos-error-monad @@ -14,34 +15,64 @@ zarith_stubs_js tezos-hacl data-encoding - alcotest + octez-alcotezt qcheck-alcotest tezos-test-helpers) (js_of_ocaml) + (library_flags (:standard -linkall)) (flags (:standard) + -open Tezt_core + -open Tezt_core.Base -open Tezos_stdlib -open Tezos_crypto -open Tezos_error_monad.TzLwtreslib -open Data_encoding - -open Tezos_test_helpers)) + -open Octez_alcotezt + -open Tezos_test_helpers) + (modules + test_run + test_prop_signature + roundtrips + key_encoding_vectors + test_base58 + test_blake2b + test_crypto_box + test_deterministic_nonce + test_merkle + test_signature + test_signature_encodings + test_timelock + test_context_hash)) -(rule - (alias runtest) - (package tezos-crypto) - (action (run %{dep:./test_run.exe}))) +(executable + (name main) + (modes native) + (libraries + src_lib_crypto_test_tezt_lib + tezt) + (modules main)) + +(rule (alias runtezt) (package tezos-crypto) (action (run %{dep:./main.exe}))) (rule - (alias runtest) - (package tezos-crypto) - (action (run %{dep:./test_prop_signature.exe}))) + (targets main.ml) + (action (with-stdout-to %{targets} (echo "let () = Tezt.Test.run ()")))) + +(executable + (name main_js) + (modes js) + (libraries + src_lib_crypto_test_tezt_lib + tezt.js) + (js_of_ocaml) + (modules main_js)) (rule - (alias runtest_js) + (alias runtezt_js) (package tezos-crypto) - (action (run node %{dep:./test_run.bc.js}))) + (action (run node %{dep:./main_js.bc.js}))) (rule - (alias runtest_js) - (package tezos-crypto) - (action (run node %{dep:./test_prop_signature.bc.js}))) + (targets main_js.ml) + (action (with-stdout-to %{targets} (echo "let () = Tezt_js.Test.run ()")))) diff --git a/tezt/tests/dune b/tezt/tests/dune index b9b233223ff5b4ac8af94ccc73fcd56d8a2e089e..67b5c99cefd1e267bfcbda9e79c4bfb3102ae21e 100644 --- a/tezt/tests/dune +++ b/tezt/tests/dune @@ -60,6 +60,8 @@ src_lib_lwt_result_stdlib_test_tezt_lib src_lib_lazy_containers_test_tezt_lib src_lib_error_monad_test_tezt_lib + src_lib_crypto_test_unix_tezt_lib + src_lib_crypto_test_tezt_lib src_lib_context_test_tezt_lib src_lib_context_memory_test_tezt_lib src_lib_client_base_unix_test_tezt_lib