Conversation
Factors computation of results and statistics in a single list traversal, but now the output is progressive, which I find convenient for large testsuites
|
Thanks - and apologies for the delay! 🙏 I completely agree that having to wait for, e.g., 10 tests to complete is sub-optimal if the error is already happening in number 1 or 2. Even worse if, e.g., number 8 hangs, that means one will not get any earlier counterexamples printed The question is how we can make the output progressive while still keeping it manageable.
I think we should take a step backward and consider how we would like the output of those cases to be structured?
|
|
I just thought of another thing: 🤔
|
|
From my understanding of
I'm not sure it's easy to do properly without new dependencies and in a cross-platform fashion, but we could probably keep some space for the header and print the rest/logs afterwards?
Agreed!
Is this displayed by default? It could be an option? Or displayed after the summary, and the logs/messages? |
Yes, the statistics are currently printed in both verbose and non-verbose mode. Finally I thought of (yet another) printing option I had forgotten above. With # let t = QCheck.(Test.make ~name:"List.rev test" ~max_fail:3 (list int) (fun xs -> xs = List.rev xs));;
val t : QCheck.Test.t = QCheck2.Test.Test <abstr>
# QCheck_base_runner.run_tests ~verbose:true [t];;
random seed: 361065173
generated error fail pass / total time test name
[✗] 3 0 3 0 / 100 0.0s List.rev test
--- Failure --------------------------------------------------------------------
Test List.rev test failed (132 shrink steps):
[0; 1]
--- Failure --------------------------------------------------------------------
Test List.rev test failed (122 shrink steps):
[0; -1]
--- Failure --------------------------------------------------------------------
Test List.rev test failed (123 shrink steps):
[0; 1]
================================================================================
failure (1 tests failed, 0 tests errored, ran 1 tests)
- : int = 1
|
I was tired of having to wait for the whole tests to finish to get any output. This PR factors computation of results and statistics in a single list traversal, but now the output of results is progressive.
I find this more convenient but I would understand if there are good reasons not to do it that way :)