Skip to content

Commit 59bcfa2

Browse files
committed
Add Skipping feature
1 parent 5637e21 commit 59bcfa2

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

lib_eio_linux/tests/test.ml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
exception Skip_test of string
2-
let skip _stdenv =
3-
raise (Skip_test "io_uring not available in Docker")
4-
51
open Eio.Std
62

73
let skip_io_uring msg =
84
Eio.traceln "Skipping test: %s" msg;
95
Alcotest.skip ()
106

117
let handle_fallback = function
12-
| `Msg msg ->
8+
| Msg msg ->
139
Eio.traceln "Fallback triggered with message: %s" msg;
1410
skip_io_uring msg
1511

@@ -33,7 +29,7 @@ let read_one_byte ~sw r =
3329
)
3430

3531
let test_poll_add () =
36-
Eio_linux.run @@ fun _stdenv ->
32+
Eio_linux.run ~fallback:handle_fallback @@ fun _stdenv ->
3733
Switch.run @@ fun sw ->
3834
let r, w = Eio_unix.pipe sw in
3935
let thread = read_one_byte ~sw r in
@@ -46,9 +42,9 @@ let test_poll_add () =
4642
assert (sent = 1);
4743
let result = Promise.await_exn thread in
4844
Alcotest.(check string) "Received data" "!" result
49-
)
45+
5046
let test_poll_add_busy () =
51-
Eio_linux.run ~queue_depth:2 @@ fun _stdenv ->
47+
Eio_linux.run ~queue_depth:2 ~fallback:handle_fallback @@ fun _stdenv ->
5248
Switch.run @@ fun sw ->
5349
let r, w = Eio_unix.pipe sw in
5450
let a = read_one_byte ~sw r in
@@ -64,7 +60,7 @@ let test_poll_add_busy () =
6460
Alcotest.(check string) "Received data" "!" a;
6561
let b = Promise.await_exn b in
6662
Alcotest.(check string) "Received data" "!" b
67-
)
63+
6864
(* Write a string to a pipe and read it out again. *)
6965
let test_copy () =
7066
Eio_linux.run ~queue_depth:3 @@ fun _stdenv ->

0 commit comments

Comments
 (0)