proper-testing / proper

PropEr: a QuickCheck-inspired property-based testing tool for Erlang
http://proper-testing.github.io
GNU General Public License v3.0
879 stars 168 forks source link

PropEr should use `printer`. #246

Open kostis opened 4 years ago

kostis commented 4 years ago

I got some strange fffs printed out. It turns out, there are several cases where PropEr(TM) is not using the printer but straight io:format (&co). I'd rather have a consistent noise than inconsistent "silence", and for the users to spend time trying to figure out what in their code is printing some random letters, like I did :wink:

So I think that everything in PropEr should use printer.

Originally posted by @x4lldux in https://github.com/proper-testing/proper/pull/232#issuecomment-618331488

kostis commented 4 years ago

While cleaning and testing the on_output code of PropEr, I've noticed similar things (direct uses of io:format and friends) but never the "f" prints. These happen only when doing parallel stateful testing at a specific place in proper_statem's code, and from some cursory glance in that code they may be there to indicate some special/unusual case which may require user attention.

It may be worthwhile to have some test case that shows these fffs so that we see whether there is some other code refactoring that is needed in proper_statem instead of just io:format -> print.

x4lldux commented 4 years ago

@kostis yeah, those "other things" I was working on (mentioned in the original post) was my work stuff that uses parallel statem testing. Those "f"s are not important. They were just a thing which debugging led me to discover that PropEr uses io:format in some cases, so I wouldn't go as far as writing a tests to force "f"s.

About the solution. If I'm not mistaken, all those io:formats are used in generators where on_output option is not available, so replacing them will require either a gen_server or some other way of handling a global config (maybe a parameter could be used here). Though, you mentioned something about ongoing work on parallelization of PropEr which might collide together.