c-cube / qcheck

QuickCheck inspired property-based testing for OCaml.
https://c-cube.github.io/qcheck/
BSD 2-Clause "Simplified" License
343 stars 37 forks source link

Converted OUnit tests have ANSI escape sequences #149

Open hongchangwu opened 3 years ago

hongchangwu commented 3 years ago

e.g., https://github.com/c-cube/qcheck/blob/48afef1dd3d6fb76c3b312990ad2a23f1f6c4a36/src/ounit/QCheck_ounit.ml#L36 causes problem in the JUnit output.

To reproduce, run converted OUnit tests with -output-junit-file junit.xml and examine the XML (I used OUnit2.run_test_tt_main as the runner).

Maybe color output should be opt-in? For example, the OUnit has an option:

  -ci {true|false}                Display logs for CI, like Travis and AppVeyor, in the console with colors. (default: false)
c-cube commented 2 years ago

I've tried dune exec -- example/ounit/QCheck_ounit_test.exe -output-junit-file foo.xml -verbose true but I'm not sure what exactly to look at, or how to find the escape sequences in the xml file. There's no raw escape code, but is the problem about xml escaping of them?