Skip to content

Commit 7ac582d

Browse files
committed
test(ctypes): add example of inline dep on a path
Signed-off-by: Louis Roché (Ahrefs) <[email protected]>
1 parent 3ddcca6 commit 7ac582d

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

test/blackbox-tests/test-cases/ctypes/deps-full-spec.t/dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
baz.h)
1212
(headers
1313
(preamble
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}\""))
1515
(type_description
1616
(instance Types)
1717
(functor Type_description))
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#define QUX_VERSION 1

test/blackbox-tests/test-cases/ctypes/deps-full-spec.t/run.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ run the executable that tests the library through the cstubs.
88
$ LIBEX=$(realpath "$PWD/../libexample")
99
$ DYLD_LIBRARY_PATH="$LIBEX" LD_LIBRARY_PATH="$LIBEX" PKG_CONFIG_PATH="$LIBEX/pkgconfig" PKG_CONFIG_ARGN="--define-prefix" dune exec ./example.exe
1010
File "dune", line 14, characters 38-46:
11-
14 | "#include <example.h>\n#include \"%{foo_h}\"\n#include \"%{bar_h}\"\n#include \"baz.h\""))
11+
14 | "#include <example.h>\n#include \"%{foo_h}\"\n#include \"%{bar_h}\"\n#include \"baz.h\"\n#include \"%{dep:qux.h}\""))
1212
^^^^^^^^
1313
Error: %{foo_h} isn't allowed in this position.
1414
File "dune", line 14, characters 61-69:
15-
14 | "#include <example.h>\n#include \"%{foo_h}\"\n#include \"%{bar_h}\"\n#include \"baz.h\""))
15+
14 | "#include <example.h>\n#include \"%{foo_h}\"\n#include \"%{bar_h}\"\n#include \"baz.h\"\n#include \"%{dep:qux.h}\""))
1616
^^^^^^^^
1717
Error: %{bar_h} isn't allowed in this position.
1818
[1]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
module Types (F : Ctypes.TYPE) = struct
2+
open F
3+
4+
let qux_version = constant "QUX_VERSION" int
25

36
end

0 commit comments

Comments
 (0)