123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778openPpxlibtypemaybe_drop=|Keep|Dropletdrop_mode=refKeepletmaybe_droploccode=match!drop_modewith|Keep->[%strlet()=[%ecode]]|Drop->Attribute.explicitly_drop#expressioncode;[%str]let()=Driver.add_arg"-inline-test-drop"(Unit(fun()->drop_mode:=Drop))~doc:"Drop unit tests"let()=Driver.Cookies.add_simple_handler"inline-test"Ast_pattern.(pexp_ident(lident__'))~f:(function|None->()|Someid->matchid.txtwith|"enabled"->drop_mode:=Drop|"disabled"->drop_mode:=Keep|s->Location.raise_errorf~loc:id.loc"invalid 'inline_alcotests' cookie (%s), expected one of: enabled or disabled"s)lettags=letopenAst_patterninAttribute.declare"tags"Attribute.Context.pattern(single_expr_payload(pexp_tuple(many(estring__))|||map(estring__)~f:(funfx->f[x])))(funx->x)letlist_of_option=functionNone->[]|Somev->vletname_and_exprexpr=letopenAst_patterninpstr((pstr_valuenonrecursive(value_binding~pat:(pstring__)~expr^::nil)^::nil))letexpand_test~loc~path:(path:label)ide=letopenAst_builder.Defaultinletloc={locwithloc_ghost=true}inletexpr=[%exprPpx_inline_alcotest_runner.add_test~path:[%epexp_constant~loc(Pconst_string(path,loc,None))]~test_name:[%epexp_constant~loc(Pconst_string(id,loc,None))](fun()->[%ee])]inmaybe_droplocexprlettest=Extension.declare_inline"inline_alcotest.test"Extension.Context.structure_itemAst_pattern.(name_and_expr__)expand_testletextensions=[test]let()=Driver.register_transformation"inline-alcotest"~extensions