upstream: https://github.com/stedolan/crowbar
0
fork

Configure Feed

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

fix(fuzz): restructure tls-eio fuzz tests to pass E700/E718/E722 lint rules

- Replace (test ...) stanza with (executable ...) + explicit runtest/fuzz
alias rules (E722)
- Add gen_corpus.ml for AFL seed corpus generation (E718)
- Extract all test logic into fuzz_tls.ml exposing a suite value;
fuzz.ml now delegates via Fuzz_tls.suite (E700)
- Fix crowbar: run suites immediately instead of at_exit, enabling
direct suite delegation without global mutable state

+12 -27
+11 -26
src/crowbar.ml
··· 590 590 else None 591 591 else None 592 592 593 - let registered_name = ref "crowbar" 594 - let registered_tests = ref [] 595 - 596 593 type test_case = 597 594 | TC : { name : string; gens : ('f, unit) gens; f : 'f } -> test_case 598 595 599 596 let test_case name gens f = TC { name; gens; f } 600 597 601 598 let run name suites = 602 - registered_name := name; 603 - List.iter 604 - (fun (suite_name, tests) -> 605 - List.iter 606 - (fun (TC { name; gens; f }) -> 607 - registered_tests := 608 - Test { suite = suite_name; name; gens; f } :: !registered_tests) 609 - tests) 610 - suites 611 - 612 - let () = 613 - at_exit (fun () -> 614 - let name = !registered_name in 615 - let t = !registered_tests in 616 - registered_tests := []; 617 - match t with 618 - | [] -> () 619 - | t -> 620 - let tests = List.rev t in 621 - match detect_afl_file () with 622 - | Some file -> run_afl tests file 623 - | None -> run_with_alcotest name tests 624 - ) 599 + let tests = 600 + List.concat_map 601 + (fun (suite_name, tcs) -> 602 + List.map 603 + (fun (TC { name; gens; f }) -> Test { suite = suite_name; name; gens; f }) 604 + tcs) 605 + suites 606 + in 607 + match detect_afl_file () with 608 + | Some file -> run_afl tests file 609 + | None -> run_with_alcotest name tests 625 610 626 611 module Syntax = struct 627 612 let ( let* ) = dynamic_bind
+1 -1
src/crowbar.mli
··· 212 212 (** [test_case name generators test_fn] creates a test case. *) 213 213 214 214 val run : string -> (string * test_case list) list -> unit 215 - (** [run name suites] registers [suites] for execution at program exit. 215 + (** [run name suites] runs [suites] immediately. 216 216 Each suite is a pair [(suite_name, test_cases)]. 217 217 Mirrors {!Alcotest.run}. *) 218 218