Merge pull request #11 from apache/optional-proper
Make PropEr an optional (test) dependency
diff --git a/rebar.config b/rebar.config
deleted file mode 100644
index b25fdb5..0000000
--- a/rebar.config
+++ /dev/null
@@ -1,11 +0,0 @@
-{deps, [
- {proper, ".*", {git, "https://github.com/manopapad/proper.git", "master"}}
-]}.
-
-{eunit_opts, [
- verbose,
- {report, {
- eunit_surefire, [{dir,"."}]
- }}
-]}.
-
diff --git a/rebar.config.script b/rebar.config.script
new file mode 100644
index 0000000..09fc8af
--- /dev/null
+++ b/rebar.config.script
@@ -0,0 +1,18 @@
+WithProper = code:lib_dir(proper) /= {error, bad_name}.
+
+
+ErlOpts =
+ case WithProper of
+ true ->
+ [{d, 'WITH_PROPER'}];
+ false ->
+ []
+ end,
+
+[{eunit_opts, [
+ verbose,
+ {report, {
+ eunit_surefire, [{dir,"."}]
+ }}
+]},
+{erl_opts, [{i, "../"} | ErlOpts]}].
diff --git a/test/ioq_kv_tests.erl b/test/ioq_kv_tests.erl
index 3c34573..48ee464 100644
--- a/test/ioq_kv_tests.erl
+++ b/test/ioq_kv_tests.erl
@@ -11,6 +11,7 @@
% the License.
-module(ioq_kv_tests).
+-ifdef(WITH_PROPER).
-behaviour(proper_statem).
-include_lib("proper/include/proper.hrl").
@@ -147,3 +148,4 @@
?LAZY(loose_tuple(almost_any())),
?LAZY(list(almost_any()))
]).
+-endif.