Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolás Ojeda Bär <[email protected]>
  • Loading branch information
nojb committed Sep 14, 2023
1 parent d8a59d2 commit 7a3bf06
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(lang dune 3.0)
5 changes: 5 additions & 0 deletions test/blackbox-tests/test-cases/utop/utop-stubs.t/forutop/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(library
(name forutop)
(foreign_stubs
(language c)
(names forutop_stubs)))
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
external hello_in_utop: unit -> string = "hello_in_utop"
let run () = print_endline (hello_in_utop ())
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include <caml/alloc.h>

value hello_in_utop(value v_unit)
{
return caml_copy_string("hello in utop");
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Forutop.run ();;
2 changes: 2 additions & 0 deletions test/blackbox-tests/test-cases/utop/utop-stubs.t/run.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$ dune utop forutop -- init_forutop.ml
hello in utop

0 comments on commit 7a3bf06

Please sign in to comment.