From e0479ea3c479547c093ade9f675e5a0a652e8a34 Mon Sep 17 00:00:00 2001 From: Alasdair Armstrong Date: Wed, 26 Dec 2018 15:24:55 +0000 Subject: Add makefile target for building with Bisect coverage --- src/Makefile | 5 ++++- src/_tags | 5 +++-- src/myocamlbuild.ml | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index b658d90d..aeb23b9e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -62,7 +62,7 @@ endif endif -.PHONY: all sail sail.native sail.byte manifest.ml test clean doc lib power test_power test_idempotence +.PHONY: all sail coverage sail.native sail.byte manifest.ml test clean doc lib power test_power test_idempotence # set to -p on command line to enable gprof profiling OCAML_OPTS?= @@ -103,6 +103,9 @@ sail: ast.ml bytecode.ml manifest.ml isail: ast.ml bytecode.ml manifest.ml ocamlbuild -use-ocamlfind isail.native +coverage: ast.ml bytecode.ml manifest.ml + BISECT_COVERAGE=YES ocamlbuild -use-ocamlfind -plugin-tag 'package(bisect_ppx-ocamlbuild)' isail.native + sail.native: sail sail.byte: ast.ml bytecode.ml manifest.ml diff --git a/src/_tags b/src/_tags index 826e87a5..6747424d 100644 --- a/src/_tags +++ b/src/_tags @@ -1,8 +1,9 @@ true: -traverse, debug, use_menhir -<**/*.ml>: bin_annot, annot +<**/parser.ml>: bin_annot, annot +<**/*.ml> and not <**/parser.ml>: bin_annot, annot, coverage : package(zarith), package(linksem), package(lem), package(omd), use_pprint -: package(zarith), package(linenoise), package(linksem), package(lem), package(omd), use_pprint +: package(zarith), package(linenoise), package(linksem), package(lem), package(omd), use_pprint, coverage : package(linenoise) : package(linksem) diff --git a/src/myocamlbuild.ml b/src/myocamlbuild.ml index f408703f..b1f95339 100644 --- a/src/myocamlbuild.ml +++ b/src/myocamlbuild.ml @@ -79,6 +79,8 @@ let lem_opts = [A "-lib"; P "../gen_lib"; dispatch begin function | After_rules -> + Bisect_ppx_plugin.handle_coverage (); + (* ocaml_lib "lem_interp/interp"; *) ocaml_lib ~extern:false ~dir:"pprint/src" ~tag_name:"use_pprint" "pprint/src/PPrintLib"; -- cgit v1.2.3