diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5b09341..dcc4d18 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,4 +33,9 @@ jobs: - name: Build run: opam exec -- dune build @install - name: Test - run: opam exec -- dune runtest + run: BISECT_FILE=`pwd`/bisect opam exec -- dune runtest --force --instrument-with bisect_ppx + - name: Upload coverage + if: matrix.os == 'ubuntu-latest' + run: opam exec -- bisect-ppx-report send-to Coveralls + env: + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} diff --git a/.gitignore b/.gitignore index 316f7fc..eb84997 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,10 @@ # OCaml Generated Files -_build +_build/ +_coverage/ +*.coverage # MacOS Files .DS_Store # VSCode Files -.vscode \ No newline at end of file +.vscode diff --git a/README.md b/README.md index bbc9f90..134526c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Whilloc +# Whilloc [![Build](https://github.com/formalsec/whilloc/actions/workflows/build.yml/badge.svg)](https://github.com/formalsec/whilloc/actions/workflows/build.yml) [![Coverage Status](https://coveralls.io/repos/github/formalsec/whilloc/badge.svg?branch=HEAD)](https://coveralls.io/github/formalsec/whilloc?branch=HEAD) A simple "while"-like programming language that includes memory allocation support. diff --git a/bin/dune b/bin/dune index 041732f..da7ffa5 100644 --- a/bin/dune +++ b/bin/dune @@ -6,4 +6,6 @@ (modules main options dir cmd_execute cmd_test doc_execute doc_test) (libraries whilloc cmdliner bos ppx_deriving_yojson.runtime) (preprocess - (pps ppx_deriving_yojson))) + (pps ppx_deriving_yojson)) + (instrumentation + (backend bisect_ppx))) diff --git a/dune-project b/dune-project index ee09e88..31e949e 100644 --- a/dune-project +++ b/dune-project @@ -25,15 +25,16 @@ (name whilloc) (synopsis "A short synopsis") (description "A longer description") - (depends - ocaml - dune - z3 - menhir - bos - cmdliner + (depends + ocaml + dune + z3 + menhir + bos + cmdliner ppx_deriving_yojson - (encoding (= "dev"))) + (encoding (= "dev")) + (bisect_ppx (and :with-test (>= "2.5.0")))) (tags (topics "to describe" your project))) diff --git a/lib/dune b/lib/dune index 5a4416f..b14a274 100644 --- a/lib/dune +++ b/lib/dune @@ -4,7 +4,9 @@ (name whilloc) (libraries z3 ppx_deriving_yojson.runtime encoding) (preprocess - (pps ppx_deriving_yojson))) + (pps ppx_deriving_yojson)) + (instrumentation + (backend bisect_ppx))) (ocamllex (modules lexer)) diff --git a/whilloc.opam b/whilloc.opam index 62a271c..b8d9444 100644 --- a/whilloc.opam +++ b/whilloc.opam @@ -18,6 +18,7 @@ depends: [ "cmdliner" "ppx_deriving_yojson" "encoding" {= "dev"} + "bisect_ppx" {with-test & >= "2.5.0"} "odoc" {with-doc} ] build: [