Skip to content
Permalink
Browse files
Merge pull request #1 from apache/optional-proper
Make PropEr an optional (test) dependency
  • Loading branch information
rnewson committed Feb 28, 2019
2 parents 151c9bc + 4a51a61 commit b42f55ecfd85807ac82c71d9475461abfa87b9d1
Showing 4 changed files with 24 additions and 13 deletions.

This file was deleted.

@@ -0,0 +1,20 @@
WithProper = code:lib_dir(proper) /= {error, bad_name}.

ErlOpts =
[debug_info] ++
case WithProper of
true ->
[{d, 'WITH_PROPER'}];
false ->
[]
end,

[{port_specs, [
{"priv/hqueue.so", ["c_src/hqueue*.c"]}
]},
{port_env, [
{".*", "CFLAGS", "$CFLAGS -g -Wall -Werror -DHQ_ENIF_ALLOC -O3"}
%% {".*", "CFLAGS", "$CFLAGS -g -Wall -Werror -Wextra"}
]},
{eunit_opts, [verbose]},
{erl_opts, [{i, "../"} | ErlOpts]}].
@@ -12,6 +12,7 @@

-module(hqueue_proper).

-ifdef(WITH_PROPER).
-include_lib("proper/include/proper.hrl").
-include_lib("eunit/include/eunit.hrl").

@@ -31,3 +32,4 @@ prop_simple() ->
simple_test_() ->
?_assertEqual(true, ?QC(prop_simple())).

-endif.
@@ -12,6 +12,7 @@

-module(hqueue_statem).

-ifdef(WITH_PROPER).
-include_lib("proper/include/proper.hrl").
-include_lib("eunit/include/eunit.hrl").

@@ -113,3 +114,4 @@ postcondition(#state{queue=Q}, {call, _, is_empty, [_]}, Result) ->
postcondition(_S, {call, _, max_elems, [_]}, Result) ->
0 < Result.

-endif.

0 comments on commit b42f55e

Please sign in to comment.