diff --git a/test/blackbox-tests/test-cases/ctypes/deps-full-spec.t/bar.h b/test/blackbox-tests/test-cases/ctypes/deps-full-spec.t/bar.h new file mode 100644 index 00000000000..e69de29bb2d diff --git a/test/blackbox-tests/test-cases/ctypes/deps-full-spec.t/baz.h b/test/blackbox-tests/test-cases/ctypes/deps-full-spec.t/baz.h new file mode 100644 index 00000000000..e69de29bb2d diff --git a/test/blackbox-tests/test-cases/ctypes/deps-full-spec.t/dune b/test/blackbox-tests/test-cases/ctypes/deps-full-spec.t/dune new file mode 100644 index 00000000000..1f8e22fd301 --- /dev/null +++ b/test/blackbox-tests/test-cases/ctypes/deps-full-spec.t/dune @@ -0,0 +1,15 @@ +(executable + (name example) + (flags (:standard -w -9-27)) + (ctypes + (external_library_name libexample) + (build_flags_resolver pkg_config) + (deps (:foo_h "foo.h") (:bar_h bar.h) baz.h) + (headers (include "example.h")) + (type_description + (instance Types) + (functor Type_description)) + (function_description + (instance Functions) + (functor Function_description)) + (generated_entry_point C))) diff --git a/test/blackbox-tests/test-cases/ctypes/deps-full-spec.t/dune-project b/test/blackbox-tests/test-cases/ctypes/deps-full-spec.t/dune-project new file mode 100644 index 00000000000..1e9b8cc3eeb --- /dev/null +++ b/test/blackbox-tests/test-cases/ctypes/deps-full-spec.t/dune-project @@ -0,0 +1,5 @@ +(lang dune 3.8) + +(using ctypes 0.3) + +(use_standard_c_and_cxx_flags false) diff --git a/test/blackbox-tests/test-cases/ctypes/deps-full-spec.t/example.ml b/test/blackbox-tests/test-cases/ctypes/deps-full-spec.t/example.ml new file mode 100644 index 00000000000..98a01761fa6 --- /dev/null +++ b/test/blackbox-tests/test-cases/ctypes/deps-full-spec.t/example.ml @@ -0,0 +1,2 @@ +let () = + Printf.printf "%d\n" (C.Functions.add2 2) diff --git a/test/blackbox-tests/test-cases/ctypes/deps-full-spec.t/foo.h b/test/blackbox-tests/test-cases/ctypes/deps-full-spec.t/foo.h new file mode 100644 index 00000000000..e69de29bb2d diff --git a/test/blackbox-tests/test-cases/ctypes/deps-full-spec.t/function_description.ml b/test/blackbox-tests/test-cases/ctypes/deps-full-spec.t/function_description.ml new file mode 100644 index 00000000000..05c43d79e2f --- /dev/null +++ b/test/blackbox-tests/test-cases/ctypes/deps-full-spec.t/function_description.ml @@ -0,0 +1,8 @@ +open Ctypes + +module Types = Types_generated + +module Functions (F : Ctypes.FOREIGN) = struct + open F + let add2 = foreign "example_add2" (int @-> returning int) +end diff --git a/test/blackbox-tests/test-cases/ctypes/deps-full-spec.t/run.t b/test/blackbox-tests/test-cases/ctypes/deps-full-spec.t/run.t new file mode 100644 index 00000000000..16122110776 --- /dev/null +++ b/test/blackbox-tests/test-cases/ctypes/deps-full-spec.t/run.t @@ -0,0 +1,14 @@ +Build an example library as a DLL and set up the environment so that it looks +like a system/distro library that can be probed with pkg-config and dynamically +loaded. + +Then generate cstubs for it, build an executable that uses those cstubs, and +run the executable that tests the library through the cstubs. + + $ LIBEX=$(realpath "$PWD/../libexample") + $ DYLD_LIBRARY_PATH="$LIBEX" LD_LIBRARY_PATH="$LIBEX" PKG_CONFIG_PATH="$LIBEX/pkgconfig" PKG_CONFIG_ARGN="--define-prefix" dune exec ./example.exe + File "dune", line 7, characters 8-24: + 7 | (deps (:foo_h "foo.h") (:bar_h bar.h) baz.h) + ^^^^^^^^^^^^^^^^ + Error: Unexpected list + [1] diff --git a/test/blackbox-tests/test-cases/ctypes/deps-full-spec.t/type_description.ml b/test/blackbox-tests/test-cases/ctypes/deps-full-spec.t/type_description.ml new file mode 100644 index 00000000000..41693fda9b3 --- /dev/null +++ b/test/blackbox-tests/test-cases/ctypes/deps-full-spec.t/type_description.ml @@ -0,0 +1,3 @@ +module Types (F : Ctypes.TYPE) = struct + +end