let fail s = failed_tests := s :: !failed_tests; if List.length !failed_tests > max_failures then ( List.iter !failed_tests ~f:(fun t -> eprintf "Failed test: %S\n%!" t ); raise Tests_failed ) else ()