Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

Commit

Permalink
Added code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Risto-Stevcev committed Mar 22, 2020
1 parent 6bd0687 commit 19d1457
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ node_modules
_build/
_opam/
bastet/src/index.mld
docs/bisect_ppx
coverage.json
28 changes: 26 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ clean-native:
clean-docs:
rm -rf docs/**

.PHONY: clean-coverage
clean-coverage:
rm -rf _coverage *.coverage
rm -f coverage.json

.PHONY: clean
clean: clean-bs clean-native clean-docs
clean: clean-bs clean-native clean-docs clean-coverage

.PHONY: build-bs
build-bs:
Expand Down Expand Up @@ -60,6 +65,25 @@ test-native: build-native
.PHONY: test
test: test-bs test-native

.PHONY: bisect
bisect:
BISECT_ENABLE=yes make test

.PHONY: bisect-html
bisect-html: bisect
bisect-ppx-report html

.PHONY: coveralls-json
coveralls-json: bisect
bisect-ppx-report coveralls --repo-token ${COVERALLS_TOKEN} coverage.json

.PHONY: coveralls-send
coveralls-send:
curl -L -F json_file=@./coverage.json https://coveralls.io/api/v1/jobs

.PHONY: coveralls
coveralls: coveralls-json coveralls-send

.PHONY: watch-native
watch-native:
dune build @all -w
Expand All @@ -71,7 +95,7 @@ watch-bs:
.PHONY: watch-test-bs
watch-test-bs:
yarn run watch-test

.PHONY: watch-test-native
watch-test:
dune runtest --no-buffer -w
Expand Down
3 changes: 2 additions & 1 deletion bastet.opam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
synopsis: "A ReasonML/Ocaml library for category theory and abstract algebra"
synopsis: "A ReasonML/OCaml library for category theory and abstract algebra"
maintainer: ["[email protected]"]
authors: ["Risto Stevcev"]
license: "BSD-3-Clause"
Expand All @@ -14,6 +14,7 @@ depends: [
"qcheck-alcotest" {>= "0.13" & with-test}
"ocamlformat" {>= "0.13.0" & with-test}
"mdx" {>= "1.6.0" & with-test}
"bisect_ppx" {>= "2.1.0" & with-test}
"odoc" {>= "1.5.0" & with-doc}
"mustache" {>= "3.1.0" & with-doc}
"dune" {>= "2.2.0"}
Expand Down
3 changes: 2 additions & 1 deletion bastet/src/dune
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(library
(name bastet)
(public_name bastet))
(public_name bastet)
(preprocess (pps bisect_ppx --conditional)))

(documentation
(package bastet))
2 changes: 2 additions & 0 deletions bastet_js/test/Test_JsArray.re
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
open BsMocha.Mocha;
open BsJsverify.Verify.Arbitrary;

Bisect.Runtime.write_coverage_data_on_exit();

module ArbitraryArray:
Test.ARBITRARY_A with
type t('a) = array('a) and type arbitrary('a) = arbitrary('a) = {
Expand Down
12 changes: 9 additions & 3 deletions bsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,15 @@
"in-source": false
},
"suffix": ".bs.js",
"bs-dependencies": [
"bisect_ppx"
],
"bs-dev-dependencies": [
"bs-jsverify",
"bs-mocha",
"bs-chai"
"bs-jsverify",
"bs-mocha",
"bs-chai"
],
"ppx-flags": [
"bisect_ppx/ppx"
]
}
2 changes: 2 additions & 0 deletions dune
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@
(progn
(run ocaml-mdx test %{x})
(diff? %{x} %{x}.corrected))))

(data_only_dirs node_modules)
3 changes: 2 additions & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

(package
(name bastet)
(synopsis "A ReasonML/Ocaml library for category theory and abstract algebra")
(synopsis "A ReasonML/OCaml library for category theory and abstract algebra")
(depends
(ocaml (>= 4.06.1))
(reason (>= 3.6.0))
Expand All @@ -18,6 +18,7 @@
(qcheck-alcotest (and (>= 0.13) :with-test))
(ocamlformat (and (>= 0.13.0) :with-test))
(mdx (and (>= 1.6.0) :with-test))
(bisect_ppx (and (>= 2.1.0) :with-test))
(odoc (and (>= 1.5.0) :with-doc))
(mustache (and (>= 3.1.0) :with-doc))
(dune (>= 2.2.0))))
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bs-bastet",
"version": "1.1.0",
"description": "A ReasonML/Ocaml library for category theory and abstract algebra",
"description": "A ReasonML/OCaml library for category theory and abstract algebra",
"repository": {
"type": "git",
"url": "git://github.com/Risto-Stevcev/bastet.git"
Expand All @@ -24,6 +24,7 @@
"license": "BSD-3-Clause",
"dependencies": {},
"devDependencies": {
"bisect_ppx": "^2.1.0",
"bs-chai": "^1.0.1",
"bs-jsverify": "0.10.0",
"bs-mocha": "^1.0.0",
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ balanced-match@^1.0.0:
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c=

bisect_ppx@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/bisect_ppx/-/bisect_ppx-2.1.0.tgz#b1f9b0c125a104c41dc6aaddb8b0e112af618ae4"
integrity sha512-wFw+BwOExrX2MbtlNlHY5gNDw8Wsd+aL5ykRdN904aGLrVfuV6YUf1S0+X/4khA8GhibgqC7pLazW4/IvxgPIw==

brace-expansion@^1.1.7:
version "1.1.11"
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
Expand Down

0 comments on commit 19d1457

Please sign in to comment.