upstream: github.com/mirleft/ocaml-tls
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

ocaml-tls: flat suite list, move helpers to Test_helpers, fix E617

- Change suite type from list to single tuple across all test modules
- Use flat [Module.suite; ...] list in test.ml runner
- Move cmp_handshake_cstruct/client_hellos/server_hellos to Test_helpers
- Rename testlib.ml → test_helpers.ml
- Fix suite naming: reader_writer → packet, snake_case tls_crypto

+15 -13
+1 -1
test/helpers/dune
··· 1 1 (library 2 2 (name test_helpers) 3 3 (wrapped false) 4 - (modules testlib) 4 + (modules test_helpers) 5 5 (libraries tls alcotest crypto-rng.unix ohex domain-name))
test/helpers/testlib.ml test/helpers/test_helpers.ml
+9 -7
test/test_packet.ml
··· 1 1 open Tls 2 - open Testlib 2 + open Test_helpers 3 3 4 4 let readerwriter_version v _ = 5 5 let buf = Writer.assemble_protocol_version v in ··· 278 278 let buf = Writer.assemble_handshake hs in 279 279 match Reader.parse_handshake buf with 280 280 | Ok hs' -> ( 281 - Testlib.cmp_handshake_cstruct hs hs'; 281 + Test_helpers.cmp_handshake_cstruct hs hs'; 282 282 (* lets get crazy and do it one more time *) 283 283 let buf' = Writer.assemble_handshake hs' in 284 284 match Reader.parse_handshake buf' with 285 - | Ok hs'' -> Testlib.cmp_handshake_cstruct hs hs'' 285 + | Ok hs'' -> Test_helpers.cmp_handshake_cstruct hs hs'' 286 286 | Error _ -> assert_failure "handshake cstruct data inner failed") 287 287 | Error _ -> assert_failure "handshake cstruct data failed" 288 288 ··· 319 319 | Ok hs' -> ( 320 320 Core.( 321 321 match (hs, hs') with 322 - | ClientHello ch, ClientHello ch' -> Testlib.cmp_client_hellos ch ch' 322 + | ClientHello ch, ClientHello ch' -> 323 + Test_helpers.cmp_client_hellos ch ch' 323 324 | _ -> assert_failure "handshake client hello broken"); 324 325 (* lets get crazy and do it one more time *) 325 326 let buf' = Writer.assemble_handshake hs' in ··· 328 329 Core.( 329 330 match (hs, hs'') with 330 331 | ClientHello ch, ClientHello ch'' -> 331 - Testlib.cmp_client_hellos ch ch'' 332 + Test_helpers.cmp_client_hellos ch ch'' 332 333 | _ -> assert_failure "handshake client hello broken")) 333 334 | Error _ -> assert_failure "handshake client hello inner failed") 334 335 | Error _ -> assert_failure "handshake client hello failed" ··· 467 468 | Ok hs' -> ( 468 469 Core.( 469 470 match (hs, hs') with 470 - | ServerHello sh, ServerHello sh' -> Testlib.cmp_server_hellos sh sh' 471 + | ServerHello sh, ServerHello sh' -> 472 + Test_helpers.cmp_server_hellos sh sh' 471 473 | _ -> assert_failure "handshake server hello broken"); 472 474 (* lets get crazy and do it one more time *) 473 475 let buf' = Writer.assemble_handshake hs' in ··· 476 478 Core.( 477 479 match (hs, hs'') with 478 480 | ServerHello sh, ServerHello sh'' -> 479 - Testlib.cmp_server_hellos sh sh'' 481 + Test_helpers.cmp_server_hellos sh sh'' 480 482 | _ -> assert_failure "handshake server hello broken")) 481 483 | Error _ -> assert_failure "handshake server hello inner failed") 482 484 | Error _ -> assert_failure "handshake server hello failed"
+4 -4
test/test_reader.ml
··· 1 1 open Tls 2 - open Testlib 2 + open Test_helpers 3 3 4 4 let good_any_version_parser major minor result _ = 5 5 let ver = list_to_cstruct [ major; minor ] in ··· 9819 9819 Core.Certificate (Writer.assemble_certificates [ gh1; gh2 ]) ); 9820 9820 ] 9821 9821 9822 - let cmp_handshake_cstruct = Testlib.cmp_handshake_cstruct 9822 + let cmp_handshake_cstruct = Test_helpers.cmp_handshake_cstruct 9823 9823 9824 9824 let good_handshake_cstruct_data_parser (xs, res) _ = 9825 9825 let buf = list_to_cstruct xs in ··· 11475 11475 } ); 11476 11476 ]) 11477 11477 11478 - let cmp_client_hellos = Testlib.cmp_client_hellos 11478 + let cmp_client_hellos = Test_helpers.cmp_client_hellos 11479 11479 11480 11480 let good_client_hellos_parser (xs, res) _ = 11481 11481 let buf = list_to_cstruct xs in ··· 12619 12619 } ); 12620 12620 ]) 12621 12621 12622 - let cmp_server_hellos = Testlib.cmp_server_hellos 12622 + let cmp_server_hellos = Test_helpers.cmp_server_hellos 12623 12623 12624 12624 let good_server_hellos_parser (xs, res) _ = 12625 12625 let buf = list_to_cstruct xs in
+1 -1
test/test_writer.ml
··· 1 1 open Tls 2 - open Testlib 2 + open Test_helpers 3 3 4 4 let version_assembler (ver, res) _ = 5 5 let buf = Writer.assemble_protocol_version ver in