Comments (7)
camlp4 version results are almost the same:
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- generated by Bisect 0.1 (http://bisect.x9c.fr) on 2015-05-21 19:34:10 -->
<bisect-report>
<summary>
<element kind="binding" count="3" total="3"/>
<element kind="sequence" count="0" total="0"/>
<element kind="for" count="0" total="0"/>
<element kind="if/then" count="0" total="0"/>
<element kind="try" count="0" total="0"/>
<element kind="while" count="0" total="0"/>
<element kind="match/function" count="1" total="4"/>
<element kind="class expression" count="0" total="0"/>
<element kind="class initializer" count="0" total="0"/>
<element kind="class method" count="0" total="0"/>
<element kind="class value" count="0" total="0"/>
<element kind="toplevel expression" count="1" total="1"/>
<element kind="lazy operator" count="0" total="0"/>
<element kind="total" count="5" total="8"/>
</summary>
<file path="test.ml">
<summary>
<element kind="binding" count="3" total="3"/>
<element kind="sequence" count="0" total="0"/>
<element kind="for" count="0" total="0"/>
<element kind="if/then" count="0" total="0"/>
<element kind="try" count="0" total="0"/>
<element kind="while" count="0" total="0"/>
<element kind="match/function" count="1" total="4"/>
<element kind="class expression" count="0" total="0"/>
<element kind="class initializer" count="0" total="0"/>
<element kind="class method" count="0" total="0"/>
<element kind="class value" count="0" total="0"/>
<element kind="toplevel expression" count="1" total="1"/>
<element kind="lazy operator" count="0" total="0"/>
<element kind="total" count="5" total="8"/>
</summary>
<point offset="25" count="1" kind="binding"/>
<point offset="83" count="1" kind="match/function"/>
<point offset="119" count="0" kind="match/function"/>
<point offset="155" count="0" kind="match/function"/>
<point offset="191" count="0" kind="match/function"/>
<point offset="227" count="1" kind="binding"/>
<point offset="360" count="1" kind="binding"/>
<point offset="404" count="1" kind="toplevel expression"/>
</file>
</bisect-report>
from bisect_ppx.
Weird. Yea, this is probably related to #7.
As a safety check, the instrumented version seems fine.
$ ocamlfind ocamlc -package bisect_ppx -package oUnit -linkpkg test.ml -dsource -o test.covered
let _ = Bisect.Runtime.init "test.ml"
open OUnit2
let (===) =
Bisect.Runtime.mark "test.ml" 0; assert_equal ~printer:String.escaped
let test_foo _ = Bisect.Runtime.mark "test.ml" 1; "foo" === "foo"
let test_bar _ = Bisect.Runtime.mark "test.ml" 2; "bar" === "bar"
let test_baz _ = Bisect.Runtime.mark "test.ml" 3; "baz" === "baz"
let test_qux _ = Bisect.Runtime.mark "test.ml" 4; "qux" === "qux"
let test_suite =
Bisect.Runtime.mark "test.ml" 5;
"example" >:::
["foo" >:: test_foo;
"bar" >:: test_bar;
"baz" >:: test_baz;
"qux" >:: test_qux]
let suite = Bisect.Runtime.mark "test.ml" 6; "all" >::: [test_suite]
let _ = Bisect.Runtime.mark "test.ml" 7; run_test_tt_main suite
Unfortunately, I won't have time for this bug for the next 2 weeks, but I'll try to take a look later.
Thanks for reporting!
from bisect_ppx.
I tried to use the option -runner sequential
as suggested in sagotch/ocveralls#6 and it works. I'll have a look at BisectThread
soon.
from bisect_ppx.
@Khady did it work?
from bisect_ppx.
I didn't had a lot of time to work on this issue and I have not been able to compile with bisectThread
. Or I didn't see any difference in the results.
from bisect_ppx.
I have the same results than before with ocamlfind ocamlc -package bisect_ppx -package oUnit -thread -linkall -linkpkg test.ml -o test.covered
from bisect_ppx.
@Khady Could you check that the branch ounit_integration works for your purposes?
As you've probably figured out OUnit
is spawning processes to run the tests. When the tests are finished each process, when Bisect instrumented, is competing with the others to write out it's bisect*.out
file. I think detecting this and dealing with such a situation is a little bit beyond the goal of this project. But since I understand how running your tests in parallel would be useful, I've implemented a little workaround.
Now when you link bisect_ppx
with -threads
it will give the bisect*.out
files random suffixes, that hopefully should very rarely overlap and avoid the race condition. Afterwards if you include all of the generated files in the output
$ bisect-report -html report_dir bisect*.out
they'll be joined and the correct coverage reported.
from bisect_ppx.
Related Issues (20)
- Does not seem to instrument cram-style tests HOT 1
- `bisect_ppx` doesn't see the instrumentation clause in my library HOT 4
- Some Coverage Files are not Listed on HTML Coverage Overview HOT 1
- Tips on how to upgrade dependency: ppxlib to latest version? HOT 2
- Question: Does it work with dune's cram test? HOT 15
- Update readme to mention usage in Dune HOT 1
- Support [@coverage off] for or-patterns
- Proposal: add <packages> to cobertura report
- Proposal: support more mandatory fields from cobertura dtd HOT 5
- Bugs in expect_test test? HOT 2
- ppxlib >= 0.28 compatibility HOT 2
- Cannot understand why certain expressions are not instrumented/reported as visited HOT 14
- Don't suppress TRMC optimization
- Consider an optional deuteranopia-friendly theme HOT 1
- The `--expect DIR` switch requires a trailing slash
- Fails to build on rescript 10: "Unbound type constructor out_channel"
- Coverage per folder HOT 2
- Branch (partial) coverage in cobertura report
- Melange compatible version HOT 3
- coverage is only being applied by running specific .exe test files HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bisect_ppx.