Skip to content

Commit

Permalink
Merge pull request #397 from yallop/inverted-stubs-qualified-names
Browse files Browse the repository at this point in the history
Test inverted stubs in the Travis build; disambiguate unqualified constructor names
  • Loading branch information
yallop committed Jun 6, 2016
2 parents 71d6dad + f8a1c3d commit 4bb94c2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .travis-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,12 @@ opam install mirage-xen || echo "Mirage not installable, so not testing Xen buil

opam pin add -n ctypes $(pwd)
opam install --build-test --yes ctypes

# Check that the inverted stubs package builds with this release
opam pin add -n ctypes-inverted-stubs-example https://github.com/yallop/ocaml-ctypes-inverted-stubs-example.git
if test ! $COVERAGE && opam install --show-actions ctypes-inverted-stubs-example; then
opam install --build-test --yes ctypes-inverted-stubs-example
else
echo "Pinning the inverted stubs example failed, probably due to OCaml version incompatibility"
fi

3 changes: 3 additions & 0 deletions src/cstubs/cstubs_inverted.ml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ let gen_ml fmt register (infos : fn_info list) : unit =
"type 'a fn = 'a@\n@\n";
Format.fprintf fmt
"module CI = Cstubs_internals@\n@\n";
Format.fprintf fmt "type 'a f = 'a CI.fn =@\n";
Format.fprintf fmt " | Returns : 'a CI.typ -> 'a f@\n";
Format.fprintf fmt " | Function : 'a CI.typ * 'b f -> ('a -> 'b) f@\n";
Format.fprintf fmt
"type 'a name = @\n";
ListLabels.iter infos
Expand Down

0 comments on commit 4bb94c2

Please sign in to comment.