Eunit helpers #49

Closed
Motiejus opened this Issue Oct 5, 2012 · 4 comments

Comments

Projects
None yet
3 participants
Contributor

Motiejus commented Oct 5, 2012

We want to run PropEr from within eunit, but there are 2 problems:

  1. eunit captures stdout
  2. proper:quickcheck/2 does not return eunit generator :)

I am overcoming these problems with these eunit helpers:
https://github.com/Motiejus/z_string/blob/master/src/proper_utils.erl

Example:

z_string_test_() ->
    [
        proper_utils:qc_(test1()),
        proper_utils:qc_(test2())
    ].

test1() -> ?FORALL(I, pos_integer(), 0 < I).
test2() -> ?FORALL( ... ).

Might be useful for others?

If yes, please let me know if "proper_eunit" module name is fine, I will submit a pull request.

arjan commented Oct 16, 2012

+1

Collaborator

kostis commented Oct 17, 2012

Althoug not really something necessary (the user can use PropEr in eunit tests without this wrapper), I at least see that this addition can come in handy in some applications, so go ahead and submit a pull request.

The proper_eunit module name is fine, but I see that in your proper_utils module you have a lot of functions that are exported and I am not sure all of them should be. Also, we would appreciate if your pull request came with PropEr edoc-umentation (see http://proper.softlab.ntua.gr/doc/) and with one or two tests so that we do not accidentally break the core functionality of the new module.

Thanks in advance.

arjan commented Oct 17, 2012

Nice, I agree with you.
@Motiejus do you want to take this on?

Contributor

Motiejus commented Oct 17, 2012

I am doing it. Takes some time, because I want to do it properly(tm).

Testing is the tricky part, but can be done.

Hope to submit this some time today.

kostis closed this in f931688 Oct 18, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment