Skip to content

Commit

Permalink
Merge pull request #396 from yallop/opam-travis
Browse files Browse the repository at this point in the history
Use the opam file to drive the Travis builds
  • Loading branch information
yallop committed Jun 6, 2016
2 parents 8a2ab50 + 0891e6f commit 71d6dad
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 31 deletions.
40 changes: 10 additions & 30 deletions .travis-ci.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
if test $COVERAGE -a $TRAVIS_OS_NAME != osx ; then
USE_BISECT=true;
fi

OPAM_DEPENDS="ocamlfind ounit lwt"
if test $USE_BISECT ; then
OPAM_DEPENDS="$OPAM_DEPENDS bisect_ppx ocveralls"
MAKE="make COVERAGE=true"
else
MAKE="make"
fi
case "$OCAML_VERSION" in
4.01.0) ppa=avsm/ocaml41+opam12 ;;
4.02.3) ppa=avsm/ocaml42+opam12 ;;
Expand Down Expand Up @@ -56,26 +45,17 @@ ocaml -version
echo OPAM versions
opam --version
opam --git-version
opam install ${OPAM_DEPENDS}


eval `opam config env`
$MAKE
# build and run the tests
$MAKE test
# build and run the examples
$MAKE examples
_build/date.native
_build/date-cmd.native
_build/fts-cmd.native examples

if test $USE_BISECT ; then
ocveralls --send bisect*.out _build/bisect*.out > coveralls.json
# Optional dependencies for coverage testing
if test $COVERAGE -a $TRAVIS_OS_NAME != osx ; then
opam install bisect_ppx ocveralls
fi

# check Xen support builds too
set -eu
if opam install mirage-xen; then
make XEN=enable
ls -l _build/libctypes_stubs_xen.a
else
echo "Mirage not installable, so not testing Xen build."
fi
# Optional dependencies for Xen build
opam install mirage-xen || echo "Mirage not installable, so not testing Xen build."

opam pin add -n ctypes $(pwd)
opam install --build-test --yes ctypes
6 changes: 6 additions & 0 deletions Makefile.examples
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ EXAMPLES += ncurses ncurses-stubs ncurses-cmd-build ncurses-
EXAMPLES += fts fts-stubs fts-stub-generator fts-cmd-build fts-cmd
EXAMPLES += date date-stubs date-stub-generator date-cmd-build date-cmd

run-examples: examples
# this doesn't run the ncurses example, which takes control of the terminal
_build/date.native
_build/date-cmd.native
_build/fts-cmd.native src

.PHONY: build $(EXAMPLES)

examples: build $(EXAMPLES)
16 changes: 15 additions & 1 deletion ctypes.opam
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ dev-repo: "http://github.com/ocamllabs/ocaml-ctypes.git"
bug-reports: "http://github.com/ocamllabs/ocaml-ctypes/issues"
license: "MIT"
build: [
[make "XEN=%{mirage-xen:enable}%" "libffi.config" "ctypes-base" "ctypes-stubs"]
[make
"XEN=%{mirage-xen:enable}%"
"COVERAGE=true" {bisect_ppx:installed}
"libffi.config"
"ctypes-base"
"ctypes-stubs"]
[make "XEN=%{mirage-xen:enable}%" "ctypes-foreign"] {ctypes-foreign:installed}
]
install: [
Expand All @@ -21,10 +26,19 @@ depends: [
"ocamlfind" {build}
"conf-pkg-config" {build}
"lwt" {test}
"ctypes-foreign" {test}
"ounit" {test}
]
depopts: [
"ctypes-foreign"
"mirage-xen"
"bisect_ppx" {test}
"ocveralls" {test}
]
build-test: [
[make "COVERAGE=true" {bisect_ppx:installed} "test"]
[make "COVERAGE=true" {bisect_ppx:installed} "run-examples"]
["sh" "-c" "ocveralls" "--send bisect*.out" "_build/bisect*.out" ">" "coveralls.json"] {bisect_ppx:installed}
]
tags: ["org:ocamllabs" "org:mirage"]
available: [ ocaml-version >= "4.01.0" ]

0 comments on commit 71d6dad

Please sign in to comment.