Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
(#481, @samoht, fixes #451 in 1.10.0)
- Fix slow runs of suites with many cases of the same name (#482, @samoht,
fixes #451 in 1.10.0)
- Under Eio, point the failure locations added in 1.10.0 (#451) at the test,
not at the scheduler (#484, fixes #478, @samoht, report by @talex5)

### 1.10.0 (09/11/2026)

Expand Down
2 changes: 1 addition & 1 deletion src/alcotest-engine/core.ml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ let is_internal_frame slot =
|| List.mem library [ "Stdlib"; "Base"; "Core" ]
|| List.exists
(fun affix -> String.is_prefix ~affix library)
[ "Alcotest"; "Lwt"; "Async"; "Cmdliner" ]
[ "Alcotest"; "Lwt"; "Async"; "Eio"; "Cmdliner" ]

(* Reading locations from [Printexc] slots, rather than parsing backtrace text,
follows [Test_fmt.bt_slot_loc] in B0_testing by Daniel Bünzli:
Expand Down
6 changes: 5 additions & 1 deletion test/e2e/alcotest/source_code_position/dune
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@
(modules test_source_code_position)
(modes exe byte))

(library
(name eio_sim)
(modules eio_sim))

(executable
(name test_failure_shapes)
(libraries alcotest)
(libraries alcotest eio_sim)
(modules test_failure_shapes)
(modes exe byte))

Expand Down
3 changes: 3 additions & 0 deletions test/e2e/alcotest/source_code_position/eio_sim.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(* Mimics the Eio scheduler, which re-raises the exception of a fiber in the
caller of [Eio_main.run]. *)
let run f = match f () with v -> v | exception e -> raise e [@@inline never]
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This run has ID `<uuid>'.
[SKIP] shapes 4 raise as tail call.
[SKIP] shapes 5 raise in body.
[FAIL] shapes 6 given position.
[SKIP] shapes 7 check in scheduler.

┌──────────────────────────────────────────────────────────────────────────────┐
│ [FAIL] shapes 0 check in body. │
Expand Down
19 changes: 18 additions & 1 deletion test/e2e/alcotest/source_code_position/failure-shapes.expected
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This run has ID `<uuid>'.
[FAIL] shapes 4 raise as tail call.
[FAIL] shapes 5 raise in body.
[FAIL] shapes 6 given position.
[FAIL] shapes 7 check in scheduler.

┌──────────────────────────────────────────────────────────────────────────────┐
│ [FAIL] shapes 0 check in body. │
Expand Down Expand Up @@ -105,5 +106,21 @@ FAIL different
Logs saved to `<build-context>/_build/_tests/<test-dir>/shapes.006.output'.
──────────────────────────────────────────────────────────────────────────────


┌──────────────────────────────────────────────────────────────────────────────┐
│ [FAIL] shapes 7 check in scheduler. │
└──────────────────────────────────────────────────────────────────────────────┘
File "test/e2e/alcotest/source_code_position/test_failure_shapes.ml", line 6, character 2:
FAIL different

Expected: `1'
Received: `2'

<stacktrace>
Re-raised at Eio_sim.run in file "test/e2e/alcotest/source_code_position/eio_sim.ml", line 3, characters 52-59

Logs saved to `<build-context>/_build/_tests/<test-dir>/shapes.007.output'.
──────────────────────────────────────────────────────────────────────────────

Full test results in `<build-context>/_build/_tests/<test-dir>'.
7 failures! in <test-duration>s. 7 tests run.
8 failures! in <test-duration>s. 8 tests run.
2 changes: 2 additions & 0 deletions test/e2e/alcotest/source_code_position/test_failure_shapes.ml
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,7 @@ let () =
Alcotest.test_case "raise as tail call" `Quick raise_as_tail_call;
Alcotest.test_case "raise in body" `Quick raise_in_body;
Alcotest.test_case "given position" `Quick given_position;
Alcotest.test_case "check in scheduler" `Quick (fun () ->
Eio_sim.run check_in_body);
] );
]
Loading