Skip to content

Commit 7481b7a

Browse files
committed
Almost fix self-coverage
The patches apply, but there is something wrong with the test cases. Delaying fixing it for later.
1 parent 685ac06 commit 7481b7a

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed

test/self/meta_bisect_ppx.diff

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
diff -ru src/common/bisect_common.ml _self/meta_bisect_ppx/src/common/bisect_common.ml
22
--- src/common/bisect_common.ml
33
+++ _self/meta_bisect_ppx/src/common/bisect_common.ml
4-
@@ -95,5 +95,5 @@
5-
Random.State.make_self_init () [@coverage off]
6-
4+
@@ -110,4 +110,4 @@
75
let random_filename ~prefix =
8-
- Printf.sprintf "%s%09d.coverage"
9-
+ Printf.sprintf "%s%09d.meta"
10-
prefix (abs (Random.State.int prng 1000000000))
6+
prefix ^
7+
(string_of_int (abs (Random.State.int prng 1000000000))) ^
8+
- ".coverage"
9+
+ ".meta"
1110
diff -ru src/common/dune _self/meta_bisect_ppx/src/common/dune
1211
--- src/common/dune
1312
+++ _self/meta_bisect_ppx/src/common/dune
@@ -42,15 +41,15 @@ diff -ru src/ppx/dune _self/meta_bisect_ppx/src/ppx/dune
4241
diff -ru src/ppx/instrument.ml _self/meta_bisect_ppx/src/ppx/instrument.ml
4342
--- src/ppx/instrument.ml
4443
+++ _self/meta_bisect_ppx/src/ppx/instrument.ml
45-
@@ -986,7 +986,7 @@
44+
@@ -996,7 +996,7 @@
4645
let ___bisect_visit___ =
4746
let points = [%e points_data] in
4847
let `Visit visit =
4948
- Bisect.Runtime.register_file
5049
+ Meta_bisect.Runtime.register_file
51-
~bisect_file:[%e bisect_file] ~bisect_silent:[%e bisect_silent]
52-
~filename:[%e filename] ~points
53-
in
50+
~bisect_file:[%e bisect_file]
51+
~bisect_silent:[%e bisect_silent]
52+
~filename:[%e filename]
5453
diff -ru src/report/cobertura.ml _self/meta_bisect_ppx/src/report/cobertura.ml
5554
--- src/report/cobertura.ml
5655
+++ _self/meta_bisect_ppx/src/report/cobertura.ml
@@ -106,6 +105,18 @@ diff -ru src/report/input.mli _self/meta_bisect_ppx/src/report/input.mli
106105
(* This file is part of Bisect_ppx, released under the MIT license. See
107106
LICENSE.md for details, or visit
108107
https://github.com/aantron/bisect_ppx/blob/master/LICENSE.md. *)
108+
diff -ru src/report/merge.ml _self/meta_bisect_ppx/src/report/merge.ml
109+
--- src/report/merge.ml
110+
+++ _self/meta_bisect_ppx/src/report/merge.ml
111+
@@ -7,7 +7,7 @@
112+
let coverage =
113+
Input.load_coverage
114+
~coverage_files ~coverage_paths ~expect:[] ~do_not_expect:[]
115+
- |> Bisect_common.write_coverage
116+
+ |> Meta_bisect_common.write_coverage
117+
in
118+
let () = Util.mkdirs (Filename.dirname to_file) in
119+
let oc = open_out to_file in
109120
diff -ru src/report/text.ml _self/meta_bisect_ppx/src/report/text.ml
110121
--- src/report/text.ml
111122
+++ _self/meta_bisect_ppx/src/report/text.ml
@@ -138,7 +149,7 @@ diff -ru src/runtime/native/runtime.ml _self/meta_bisect_ppx/src/runtime/native/
138149

139150
let default_bisect_file = ref "bisect"
140151

141-
@@ -76,8 +76,17 @@
152+
@@ -88,8 +88,17 @@
142153
in
143154
create_file 100
144155

0 commit comments

Comments
 (0)