Skip to content

Alcotest silently fails when aborted from C stub #430

@SturdyPose

Description

@SturdyPose

This example doesn't show if test failed at all.

CAMLprim value caml_crashing_function()
{
  CAMLparam0();
  int* p = NULL;
  *p = 0;
  CAMLreturn(Val_unit);
}
(* link with cstub*)
external crashing_function: unit -> unit = "caml_crashing_function"

let () = 
  run "Tests" ["Crash test", [test_case "call crashing function" `Quick (function _ -> crashing_function ())]]

There's no output and if the test has crashed somewhere in the middle of test, remaining suite isn't executed and it won't show any error.

Environment: win11 x86-64 using msys2-mingw64

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions