Git Product home page Git Product logo

Comments (7)

Khady avatar Khady commented on June 12, 2024

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.

rleonid avatar rleonid commented on June 12, 2024

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.

Khady avatar Khady commented on June 12, 2024

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.

rleonid avatar rleonid commented on June 12, 2024

@Khady did it work?

from bisect_ppx.

Khady avatar Khady commented on June 12, 2024

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.

Khady avatar Khady commented on June 12, 2024

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.

rleonid avatar rleonid commented on June 12, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.