Skip to content

Commit

Permalink
Merge pull request #14 from jerith/functional-tests
Browse files Browse the repository at this point in the history
Functional tests
  • Loading branch information
Leonidas-from-XIV authored Jun 4, 2017
2 parents efcb4da + f9678e8 commit b0adb5d
Show file tree
Hide file tree
Showing 19 changed files with 1,456 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .merlin
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
S src
S test
B _build/src
B _build/test
PKG cmdliner
PKG lwt
PKG lwt.ppx
PKG cohttp.lwt
PKG yojson
PKG ppx_deriving_yojson
PKG ppx_deriving.std
PKG oUnit
14 changes: 11 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
language: c
sudo: required
install: wget https://raw.githubusercontent.com/ocaml/ocaml-ci-scripts/master/.travis-opam.sh
install:
- wget https://raw.githubusercontent.com/ocaml/ocaml-ci-scripts/master/.travis-opam.sh
- if [ -n "$COVERAGE" ]; then wget https://raw.githubusercontent.com/simonjbeaumont/ocaml-travis-coveralls/master/travis-coveralls.sh; fi
script: bash -ex .travis-opam.sh
after_success: |
if [ -n "$COVERAGE" ]; then
opam install slacko --deps-only --yes --build-test
bash -ex travis-coveralls.sh
fi
env:
global:
- PACKAGE=slacko
- EXTRA_DEPS="oasis"
- PRE_INSTALL_HOOK="oasis setup"
- TESTS=false
- TESTS=true
- COV_CONF="./configure --enable-tests"
matrix:
- OCAML_VERSION=4.02
- OCAML_VERSION=4.02 COVERAGE=YES
- OCAML_VERSION=4.03
- OCAML_VERSION=4.04
17 changes: 17 additions & 0 deletions _oasis
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,23 @@ Executable "slack-notify"
NativeOpt: -safe-string
CompiledObject: best

Executable "test_slacko"
Path: test
BuildDepends: oUnit, slacko, ppx_deriving.std
MainIs: test_slacko.ml
ByteOpt: -safe-string
NativeOpt: -safe-string
CompiledObject: best
Build$: flag(tests)
Install: false

Test "test_slacko"
Run$: flag(tests)
# We need the "-runner sequential" for lwt-based tests.
# https://forge.ocamlcore.org/tracker/?func=detail&aid=1363&group_id=162&atid=730
Command: $test_slacko -runner sequential
WorkingDirectory: test

SourceRepository head
Type: git
Location: https://github.com/Leonidas-from-XIV/slacko.git
Expand Down
4 changes: 3 additions & 1 deletion opam
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ build: [
["ocaml" "setup.ml" "-configure" "--prefix" prefix]
["ocaml" "setup.ml" "-build"]
]
build-test: [make "test"]
install: [
["ocaml" "setup.ml" "-install"]
]
Expand All @@ -22,10 +23,11 @@ depends: [
"yojson"
"lwt" {>= "2.4.7"}
"tls" | "ssl"
"cohttp" {>= "0.13.0"}
"cohttp" {>= "0.21.1"}
"ppx_deriving_yojson" {>= "3.0"}
# for development. Not to be included in opam-repository
"oasis" {build & >= "0.4.0"}
"ounit" {test}
# /development
]
conflicts: [
Expand Down
2 changes: 1 addition & 1 deletion src/slacko.mli
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
To use the API you first need to either apply for a {!token} from Slack,
or get one via the OAuth2 API. This string can then be converted into
a {!session} by means of {!make_session}. With this {!session} most other
a {!session} by means of {!start_session}. With this {!session} most other
methods from the binding can be called. The result of each API call is
a variant type containing either the JSON result or an error type
describing what kind of error occured.
Expand Down
Loading

0 comments on commit b0adb5d

Please sign in to comment.