Skip to content

Commit

Permalink
Merge 5a77967 into a4b8cb6
Browse files Browse the repository at this point in the history
  • Loading branch information
aantron authored Oct 10, 2020
2 parents a4b8cb6 + 5a77967 commit aaf7c5c
Show file tree
Hide file tree
Showing 17 changed files with 53 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ scripts:
WD=`pwd`
if [ ! -f node_modules/.bin/esy ]
then
npm install --no-save esy
npm install --no-save esy@0.6.4
export PATH="$WD/node_modules/.bin:$PATH"
else
mkdir -p _wrapped_esy
Expand Down
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.PHONY : build
build :
dune build
dune build -p bisect_ppx

.PHONY : test
test : build
dune runtest --force --no-buffer -j 1
dune runtest -p bisect_ppx --force --no-buffer -j 1

SELF_COVERAGE := _self

Expand Down Expand Up @@ -105,8 +105,9 @@ EXPECTED_FILES := \
.PHONY : self-coverage-test
self-coverage-test :
cd $(SELF_COVERAGE) && rm -f bisect*.meta
cd $(SELF_COVERAGE) && dune build @install
cd $(SELF_COVERAGE) && dune runtest --force --no-buffer -j 1
cd $(SELF_COVERAGE) && dune build @install --instrument-with meta_bisect_ppx
cd $(SELF_COVERAGE) && \
dune runtest --force --no-buffer -j 1 --instrument-with meta_bisect_ppx
rm -rf _coverage
cd $(SELF_COVERAGE) && \
_build/install/default/bin/meta-bisect-ppx-report \
Expand Down
2 changes: 1 addition & 1 deletion binaries.esy.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"dependencies": {
"ocaml": ">= 4.2.0",
"@opam/cmdliner": "^1.0.0",
"@opam/dune": "*",
"@opam/dune": "^2.7.0",
"@opam/ocaml-migrate-parsetree": "^1.7.0",
"@opam/ppx_tools_versioned": "^5.4.0"
},
Expand Down
2 changes: 1 addition & 1 deletion bisect_ppx.opam
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ maintainer: [
depends: [
"base-unix"
"cmdliner" {>= "1.0.0"}
"dune"
"dune" {>= "2.7.0"}
"ocaml" {>= "4.02.0"}
"ocaml-migrate-parsetree" {>= "1.7.0"}
"ppx_tools_versioned" {>= "5.4.0"}
Expand Down
4 changes: 3 additions & 1 deletion dune-project
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
(lang dune 1.0)
(lang dune 2.7)

(formatting disabled)
1 change: 1 addition & 0 deletions src/ppx/bucklescript/dune
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
(executable
(modes byte exe)
(name ppx)
(libraries bisect_ppx ocaml-migrate-parsetree))
1 change: 1 addition & 0 deletions src/ppx/dune
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
(name bisect_ppx)
(public_name bisect_ppx)
(kind ppx_rewriter)
(instrumentation.backend (ppx bisect_ppx))
(synopsis "Code coverage for OCaml")
(ppx_runtime_libraries bisect_ppx.runtime)
(preprocess (pps ppx_tools_versioned.metaquot_411))
Expand Down
1 change: 1 addition & 0 deletions src/report/dune
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(executable
(modes byte exe)
(name report)
(public_name bisect-ppx-report)
(package bisect_ppx)
Expand Down
2 changes: 1 addition & 1 deletion test/dune
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(ignored_subdirs (bucklescript))
(dirs (:standard \ bucklescript))
15 changes: 7 additions & 8 deletions test/self/bisect_ppx.diff
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,25 @@ diff -ru src/common/dune _self/bisect_ppx/src/common/dune
(library
(name bisect_common)
(public_name bisect_ppx.common)
+ (preprocess (pps meta_bisect_ppx))
+ (instrumentation (backend meta_bisect_ppx))
(synopsis "Bisect_ppx internal functions (internal)"))
diff -ru src/ppx/dune _self/bisect_ppx/src/ppx/dune
--- src/ppx/dune
+++ _self/bisect_ppx/src/ppx/dune
@@ -7,5 +7,5 @@
(kind ppx_rewriter)
@@ -9,4 +9,5 @@
(synopsis "Code coverage for OCaml")
(ppx_runtime_libraries bisect_ppx.runtime)
- (preprocess (pps ppx_tools_versioned.metaquot_410))
+ (preprocess (pps meta_bisect_ppx ppx_tools_versioned.metaquot_410))
(preprocess (pps ppx_tools_versioned.metaquot_411))
+ (instrumentation (backend meta_bisect_ppx))
(libraries bisect_ppx.common ocaml-migrate-parsetree ppx_tools_versioned str))
diff -ru src/report/dune _self/bisect_ppx/src/report/dune
--- src/report/dune
+++ _self/bisect_ppx/src/report/dune
@@ -2,6 +2,7 @@
@@ -3,6 +3,7 @@
(name report)
(public_name bisect-ppx-report)
(package bisect_ppx)
+ (preprocess (pps meta_bisect_ppx))
+ (instrumentation (backend meta_bisect_ppx))
(libraries bisect_ppx.common cmdliner unix))

(rule
Expand All @@ -35,5 +34,5 @@ diff -ru src/runtime/native/dune _self/bisect_ppx/src/runtime/native/dune
(name bisect)
(public_name bisect_ppx.runtime)
(synopsis "Bisect_ppx runtime library (internal)")
+ (preprocess (pps meta_bisect_ppx))
+ (instrumentation (backend meta_bisect_ppx))
(libraries bisect_ppx.common unix))
19 changes: 11 additions & 8 deletions test/self/meta_bisect_ppx.diff
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
diff -ru src/common/bisect_common.ml _self/meta_bisect_ppx/src/common/bisect_common.ml
--- src/common/bisect_common.ml
+++ _self/meta_bisect_ppx/src/common/bisect_common.ml
@@ -167,7 +167,7 @@
@@ -175,7 +175,7 @@
Random.self_init ()

let random_filename base_name =
Expand All @@ -23,7 +23,7 @@ diff -ru src/common/dune _self/meta_bisect_ppx/src/common/dune
diff -ru src/ppx/dune _self/meta_bisect_ppx/src/ppx/dune
--- src/ppx/dune
+++ _self/meta_bisect_ppx/src/ppx/dune
@@ -2,10 +2,10 @@
@@ -2,11 +2,11 @@
(ocamlyacc exclude_parser)

(library
Expand All @@ -32,25 +32,27 @@ diff -ru src/ppx/dune _self/meta_bisect_ppx/src/ppx/dune
+ (name meta_bisect_ppx)
+ (public_name meta_bisect_ppx)
(kind ppx_rewriter)
- (instrumentation.backend (ppx bisect_ppx))
+ (instrumentation.backend (ppx meta_bisect_ppx))
(synopsis "Code coverage for OCaml")
- (ppx_runtime_libraries bisect_ppx.runtime)
+ (ppx_runtime_libraries meta_bisect_ppx.runtime)
(preprocess (pps ppx_tools_versioned.metaquot_410))
(preprocess (pps ppx_tools_versioned.metaquot_411))
- (libraries bisect_ppx.common ocaml-migrate-parsetree ppx_tools_versioned str))
+ (libraries meta_bisect_ppx.common ocaml-migrate-parsetree ppx_tools_versioned str))
diff -ru src/ppx/instrument.ml _self/meta_bisect_ppx/src/ppx/instrument.ml
--- src/ppx/instrument.ml
+++ _self/meta_bisect_ppx/src/ppx/instrument.ml
@@ -54,7 +54,7 @@
module Ast_mapper_class = Ast_mapper_class_410
module Ast_mapper_class = Ast_mapper_class_411

(* From Bisect_ppx. *)
-module Common = Bisect_common
+module Common = Meta_bisect_common



@@ -907,7 +907,7 @@
@@ -905,7 +905,7 @@
let ___bisect_visit___ =
let point_definitions = [%e points_data] in
let `Staged cb =
Expand All @@ -74,8 +76,9 @@ diff -ru src/ppx/register.ml _self/meta_bisect_ppx/src/ppx/register.ml
diff -ru src/report/dune _self/meta_bisect_ppx/src/report/dune
--- src/report/dune
+++ _self/meta_bisect_ppx/src/report/dune
@@ -1,8 +1,8 @@
@@ -1,9 +1,9 @@
(executable
(modes byte exe)
(name report)
- (public_name bisect-ppx-report)
- (package bisect_ppx)
Expand Down Expand Up @@ -120,8 +123,8 @@ diff -ru src/report/report_html.ml _self/meta_bisect_ppx/src/report/report_html.
-module Common = Bisect_common
+module Common = Meta_bisect_common

let css_variables =
["unvisited_color", "#ffecec";
type theme = [
| `Light
diff -ru src/report/report.ml _self/meta_bisect_ppx/src/report/report.ml
--- src/report/report.ml
+++ _self/meta_bisect_ppx/src/report/report.ml
Expand Down
4 changes: 2 additions & 2 deletions test/unit/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
(name test_main)
(libraries bisect_ppx.runtime compiler-libs.common ounit2))

(alias
(name runtest)
(rule
(alias runtest)
(deps (:tester test_main.exe) (source_tree fixtures))
(action (run %{tester} -runner processes -shards 6)))
13 changes: 13 additions & 0 deletions test/usage/dune-integration/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.PHONY : test
test : clean
dune exec ./source.exe
! test -f bisect*.coverage
dune clean
dune exec --instrument-with bisect_ppx ./source.exe
ls -l _build
test -f bisect*.coverage

.PHONY : clean
clean :
dune clean
rm -f bisect*.coverage
3 changes: 3 additions & 0 deletions test/usage/dune-integration/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(executable
(name source)
(instrumentation (backend bisect_ppx)))
1 change: 1 addition & 0 deletions test/usage/dune-integration/dune-project
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(lang dune 2.7)
Empty file.
1 change: 1 addition & 0 deletions test/usage/dune-integration/source.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let () = ()

0 comments on commit aaf7c5c

Please sign in to comment.