Property test specs and add coverage
authorPaul Oliver <puzza007@gmail.com>
Thu, 21 Aug 2014 13:58:57 +0000 (15:58 +0200)
committerPaul Oliver <puzza007@gmail.com>
Thu, 21 Aug 2014 13:58:57 +0000 (15:58 +0200)
Also make tests run in parallel

cover.spec [new file with mode: 0644]
rebar.config
test/hope_dictionary_SUITE.erl
test/hope_list_SUITE.erl
test/hope_result_SUITE.erl

diff --git a/cover.spec b/cover.spec
new file mode 100644 (file)
index 0000000..cc5762d
--- /dev/null
@@ -0,0 +1 @@
+{incl_app, hope, details}.
index 986fa40..8484333 100644 (file)
@@ -4,3 +4,7 @@
 {deps,
  [{proper, ".*", {git, "https://github.com/manopapad/proper.git", {tag, "v1.1"}}}]
 }.
+
+{cover_enabled, true}.
+
+{clean_files, ["test/*.beam"]}.
index f6a3e38..914ae48 100644 (file)
@@ -1,5 +1,7 @@
 -module(hope_dictionary_SUITE).
 
+-include_lib("proper/include/proper.hrl").
+
 %% Callbacks
 -export(
     [ all/0
@@ -14,6 +16,7 @@
     , t_set_existing/1
     , t_pop/1
     , t_fold/1
+    , t_dictionary_specs/1
     ]).
 
 
@@ -34,8 +37,9 @@ groups() ->
         , t_set_existing
         , t_pop
         , t_fold
+        , t_dictionary_specs
         ],
-    Properties = [],
+    Properties = [parallel],
     [{?DICT_MODULE_KV_LIST, Properties, Tests}].
 
 init_per_group(DictModule, Cfg) ->
@@ -85,3 +89,7 @@ t_fold(Cfg) ->
     KVList = [{a, 1}, {a, 5}, {b, 3}, {c, 4}, {c, 4}],
     Dict = DictModule:of_kv_list(KVList),
     17 = DictModule:fold(Dict, fun (_K, V, Acc) -> V + Acc end, 0).
+
+t_dictionary_specs(Cfg) ->
+    {some, DictModule} = hope_kv_list:get(Cfg, ?DICT_MODULE),
+    [] = proper:check_specs(DictModule).
index 819c4fc..fd2393c 100644 (file)
@@ -11,6 +11,7 @@
 %% Test cases
 -export(
     [ t_unique_preserve_order/1
+    , t_hope_list_specs/1
     ]).
 
 
@@ -29,8 +30,9 @@ all() ->
 groups() ->
     Tests =
         [ t_unique_preserve_order
+        , t_hope_list_specs
         ],
-    Properties = [],
+    Properties = [parallel],
     [{?GROUP, Properties, Tests}].
 
 
@@ -48,3 +50,6 @@ prop_unique_preserve_order() ->
                 hope_list:unique_preserve_order(L) ==
                     lists:reverse(lists:reverse(L) -- Duplicates)
             end).
+
+t_hope_list_specs(_) ->
+    [] = proper:check_specs(hope_list).
index de6a7bb..4f16b64 100644 (file)
@@ -1,5 +1,7 @@
 -module(hope_result_SUITE).
 
+-include_lib("proper/include/proper.hrl").
+
 %% Callbacks
 -export(
     [ all/0
@@ -12,6 +14,7 @@
 -export(
     [ t_pipe_ok/1
     , t_pipe_error/1
+    , t_hope_result_specs/1
     ]).
 
 
@@ -29,8 +32,9 @@ groups() ->
     Tests =
         [ t_pipe_ok
         , t_pipe_error
+        , t_hope_result_specs
         ],
-    Properties = [],
+    Properties = [parallel],
     [{?GROUP_PIPE, Properties, Tests}].
 
 init_per_group(?GROUP_PIPE, Cfg) ->
@@ -56,3 +60,6 @@ t_pipe_ok(Cfg) ->
 t_pipe_error(Cfg) ->
     {some, Steps} = hope_kv_list:get(Cfg, steps),
     {error, 1} = hope_result:pipe(Steps, 1).
+
+t_hope_result_specs(_) ->
+    [] = proper:check_specs(hope_result).
This page took 0.02318 seconds and 4 git commands to generate.