Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Added travis-ci continuous integration
  • Loading branch information
maelvls committed Oct 26, 2016
commit fd75e34ba98e9aca1a86576d8c47d1e1cd8cb162
26 changes: 26 additions & 0 deletions .travis-ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Inspired from repo's .travis-ci.sh ocaml/oasis2opam
export OPAMYES=1

if [ -f "$HOME/.opam/config" ]; then
opam update
opam upgrade
else
opam init
fi

if [ -n "${OPAM_SWITCH}" ]; then
opam switch ${OPAM_SWITCH}
fi
eval `opam config env`

opam install ocamlfind

export OCAMLRUNPARAM=b

ocaml setup.ml -configure --enable-tests
ocaml setup.ml -build
ocaml setup.ml -test

opam pin add minisat .
opam remove minisat
[ -z "`ocamlfind query minisat`" ] || (echo "It uninstalled fine!" && exit 1)
20 changes: 20 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
language: c
sudo: false
addons:
apt:
sources:
- avsm
packages:
- ocaml
- opam

script: bash -ex .travis-ci.sh
env:
- OPAM_SWITCH=system
- OPAM_SWITCH=4.01.0
- OPAM_SWITCH=4.02.2
- OPAM_SWITCH=4.02.3
- OPAM_SWITCH=4.03.0
cache:
directories:
- $HOME/.opam
4 changes: 2 additions & 2 deletions _oasis
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Library minisat
CSources: libminisat_stubs.c, vec.h, solver.h, solver.c
CCOpt: -fPIC -std=c99

Test test1
Command: ./tests/test1.ml
Test alltests
Command: ocaml tests/test1.ml
TestTools:
Run$: flag(tests)

Expand Down
55 changes: 55 additions & 0 deletions appveyor-opam.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/usr/bin/env sh

# default setttings
SWITCH='4.02.3+mingw64c'
OPAM_URL='https://dl.dropboxusercontent.com/s/b2q2vjau7if1c1b/opam64.tar.xz'
OPAM_ARCH=opam64

if [ "$PROCESSOR_ARCHITECTURE" != "AMD64" ] && \
[ "$PROCESSOR_ARCHITEW6432" != "AMD64" ]; then
OPAM_URL='https://dl.dropboxusercontent.com/s/eo4igttab8ipyle/opam32.tar.xz'
OPAM_ARCH=opam32
fi

if [ $# -gt 0 ] && [ -n "$1" ]; then
SWITCH=$1
fi

export OPAM_LINT="false"
export CYGWIN='winsymlinks:native'
export OPAMYES=1

set -eu

curl -fsSL -o "${OPAM_ARCH}.tar.xz" "${OPAM_URL}"
tar -xf "${OPAM_ARCH}.tar.xz"
"${OPAM_ARCH}/install.sh"

opam init -a default "https://github.com/fdopen/opam-repository-mingw.git" --comp "$SWITCH" --switch "$SWITCH"
eval $(opam config env)
ocaml_system="$(ocamlc -config | awk '/^system:/ { print $2 }')"
case "$ocaml_system" in
*mingw64*)
PATH="/usr/x86_64-w64-mingw32/sys-root/mingw/bin:${PATH}"
export PATH
;;
*mingw*)
PATH="/usr/i686-w64-mingw32/sys-root/mingw/bin:${PATH}"
export PATH
;;
*)
echo "ocamlc reports a dubious system: ${ocaml_system}. Good luck!" >&2
esac

# Now, the actual opam install, build and test
opam install ocamlfind
eval $(opam config env)

cd "${APPVEYOR_BUILD_FOLDER}"
ocaml setup.ml -configure --enable-tests
ocaml setup.ml -build
ocaml setup.ml -test

opam pin add minisat .
opam remove minisat
[ -z "`ocamlfind query minisat`" ] || (echo "It uninstalled fine!" && exit 1)
16 changes: 16 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
platform:
- x86

environment:
CYG_ROOT: "C:\\cygwin"
CYG_BASH: "%CYG_ROOT%\\bin\\bash -lc"

cache:
- "%CYG_ROOT%\\home\\appveyor\\.opam"


install:
- "%CYG_ROOT%\\setup-x86.exe -qnNdO -R %CYG_ROOT% -s http://cygwin.mirror.constant.com -l C:/cygwin/var/cache/setup -P rsync -P patch -P diffutils -P make -P unzip -P git -P m4 -P perl -P mingw64-x86_64-gcc-core"

build_script:
- "%CYG_BASH% '${APPVEYOR_BUILD_FOLDER}/appveyor-opam.sh'"
26 changes: 14 additions & 12 deletions setup.ml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(* setup.ml generated for the first time by OASIS v0.4.6 *)

(* OASIS_START *)
(* DO NOT EDIT (digest: dab889f3fde042939d5eee750f13af5d) *)
(* DO NOT EDIT (digest: 3afef100aea41c76156560c932a230a4) *)
(*
Regenerated by OASIS v0.4.7
Visit http://oasis.forge.ocamlcore.org for more information and
Expand Down Expand Up @@ -6983,11 +6983,11 @@ let setup_t =
build = OCamlbuildPlugin.build [];
test =
[
("test1",
("alltests",
CustomPlugin.Test.main
{
CustomPlugin.cmd_main =
[(OASISExpr.EBool true, ("./tests/test1.ml", []))];
[(OASISExpr.EBool true, ("ocaml", ["tests/test1.ml"]))];
cmd_clean = [(OASISExpr.EBool true, None)];
cmd_distclean = [(OASISExpr.EBool true, None)]
})
Expand All @@ -7009,11 +7009,11 @@ let setup_t =
clean = [OCamlbuildPlugin.clean];
clean_test =
[
("test1",
("alltests",
CustomPlugin.Test.clean
{
CustomPlugin.cmd_main =
[(OASISExpr.EBool true, ("./tests/test1.ml", []))];
[(OASISExpr.EBool true, ("ocaml", ["tests/test1.ml"]))];
cmd_clean = [(OASISExpr.EBool true, None)];
cmd_distclean = [(OASISExpr.EBool true, None)]
})
Expand All @@ -7033,11 +7033,11 @@ let setup_t =
distclean = [];
distclean_test =
[
("test1",
("alltests",
CustomPlugin.Test.distclean
{
CustomPlugin.cmd_main =
[(OASISExpr.EBool true, ("./tests/test1.ml", []))];
[(OASISExpr.EBool true, ("ocaml", ["tests/test1.ml"]))];
cmd_clean = [(OASISExpr.EBool true, None)];
cmd_distclean = [(OASISExpr.EBool true, None)]
})
Expand Down Expand Up @@ -7224,14 +7224,17 @@ let setup_t =
});
Test
({
cs_name = "test1";
cs_name = "alltests";
cs_data = PropList.Data.create ();
cs_plugin_data = []
},
{
test_type = (`Test, "custom", Some "0.4");
test_command =
[(OASISExpr.EBool true, ("./tests/test1.ml", []))];
[
(OASISExpr.EBool true,
("ocaml", ["tests/test1.ml"]))
];
test_custom =
{
pre_command = [(OASISExpr.EBool true, None)];
Expand Down Expand Up @@ -7323,16 +7326,15 @@ let setup_t =
};
oasis_fn = Some "_oasis";
oasis_version = "0.4.7";
oasis_digest =
Some "r&7\198\213\023\004\133\234\201\198\222}\004\234\236";
oasis_digest = Some "\175>\165w\181\188b\166\181;\245>\000s\171\158";
oasis_exec = None;
oasis_setup_args = [];
setup_update = false
};;

let setup () = BaseSetup.setup setup_t;;

# 7336 "setup.ml"
# 7338 "setup.ml"
let setup_t = BaseCompat.Compat_0_4.adapt_setup_t setup_t
open BaseCompat.Compat_0_4
(* OASIS_STOP *)
Expand Down