12345678910111213141516171819202122232425262728293031323334(*
* Copyright (c) 2017 Thomas Gazagnaire <thomas@gazagnaire.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*)letrun_testfnargs=letasync_ex,async_waker=Lwt.wait()inlethandle_exnex=Logs.debug(funf->f"Uncaught async exception: %a"Fmt.exnex);ifLwt.stateasync_ex=Lwt.SleepthenLwt.wakeup_exnasync_wakerexinLwt.async_exception_hook:=handle_exn;Lwt_switch.with_switch(funsw->Lwt.pick[fnswargs;async_ex])moduleV1=structmoduleTester=Alcotest_engine.V1.Cli.Make(Alcotest.Unix_platform)(Lwt)includeTesterlettest_case_syncnsf=test_casens(funx->Lwt.return(fx))lettest_casensf=test_casens(run_testf)endincludeV1