Skip to content

Commit

Permalink
test(ctypes): add example of inline dep on a path
Browse files Browse the repository at this point in the history
  • Loading branch information
Khady committed Feb 5, 2025
1 parent c1d1a3d commit db26e78
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
baz.h)
(headers
(preamble
"#include \"example.h\"\n#include \"%{foo_h}\"\n#include \"%{bar_h}\"\n#include \"baz.h\""))
"#include \"example.h\"\n#include \"%{foo_h}\"\n#include \"%{bar_h}\"\n#include \"baz.h\"\n#include \"%{dep:qux.h}\""))
(type_description
(instance Types)
(functor Type_description))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#define QUX_VERSION 1
4 changes: 2 additions & 2 deletions test/blackbox-tests/test-cases/ctypes/deps-full-spec.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ 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 14, characters 40-48:
14 | "#include \"example.h\"\n#include \"%{foo_h}\"\n#include \"%{bar_h}\"\n#include \"baz.h\""))
14 | "#include \"example.h\"\n#include \"%{foo_h}\"\n#include \"%{bar_h}\"\n#include \"baz.h\"\n#include \"%{dep:qux.h}\""))
^^^^^^^^
Error: %{foo_h} isn't allowed in this position.
File "dune", line 14, characters 63-71:
14 | "#include \"example.h\"\n#include \"%{foo_h}\"\n#include \"%{bar_h}\"\n#include \"baz.h\""))
14 | "#include \"example.h\"\n#include \"%{foo_h}\"\n#include \"%{bar_h}\"\n#include \"baz.h\"\n#include \"%{dep:qux.h}\""))
^^^^^^^^
Error: %{bar_h} isn't allowed in this position.
[1]
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
module Types (F : Ctypes.TYPE) = struct
open F

let qux_version = constant "QUX_VERSION" int

end

0 comments on commit db26e78

Please sign in to comment.