Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/liskin/proper_eunit
simple parse transformation that creates an EUnit test generator for every proper property
https://github.com/liskin/proper_eunit
Last synced: 20 days ago
JSON representation
simple parse transformation that creates an EUnit test generator for every proper property
- Host: GitHub
- URL: https://github.com/liskin/proper_eunit
- Owner: liskin
- License: other
- Created: 2014-04-25T15:12:42.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-06-09T12:45:35.000Z (over 10 years ago)
- Last Synced: 2024-10-16T00:44:31.269Z (2 months ago)
- Language: Erlang
- Size: 211 KB
- Stars: 4
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# proper\_eunit
A simple parse transformation that creates an [EUnit][] test generator for every
[proper][] property.[EUnit]: http://www.erlang.org/doc/apps/eunit/chapter.html
[proper]: https://github.com/manopapad/proper## Usage example
ex1.erl:
-module( ex1 ).
-include_lib( "proper_eunit/include/pt_proper_eunit.hrl" ).prop_1() ->
?FORALL( X, integer( 0, 10 ), X =:= X ).erl:
Eshell V5.10.4 (abort with ^G)
1> eunit:test( ex1, [verbose] ).
======================== EUnit ========================
ex1:4: prop_1_test_ (module 'ex1')...[0.028 s] ok
=======================================================
Test passed.
ok## Specifying options
Options for `proper:quickcheck/2` may be specified using the `proper_opts`
attribute:-proper_opts([500, any_to_integer]).
Options specific to one property may be specified as well:
-proper_opts([{prop_1, [500, any_to_integer]}]).
To customize the eunit test object, `proper_eunit` understands the `eunit_env`
option:-proper_opts([{eunit_env, foo/1}])
foo(Test) ->
{setup, …, Test}.Note that `foo/1` is equivalent to `{foo, 1}`, and `{M, F, A}` is supported as
well.To just change the timeout, timeout may be specified directly (one doesn't
need to create a function that wraps `Test` in `{timeout, …}`):-proper_opts([{prop_1, {eunit_env, {timeout, 10}}}]).