From 23b98f7d6522053816e900b129191eaee07db223 Mon Sep 17 00:00:00 2001 From: Thomas Arts Date: Mon, 27 May 2019 14:20:20 +0200 Subject: [PATCH] Add unit test to trigger eqc property --- quickcheck/aeb_fate_code_tests.erl | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 quickcheck/aeb_fate_code_tests.erl diff --git a/quickcheck/aeb_fate_code_tests.erl b/quickcheck/aeb_fate_code_tests.erl new file mode 100644 index 0000000..b780f44 --- /dev/null +++ b/quickcheck/aeb_fate_code_tests.erl @@ -0,0 +1,24 @@ +%%% @author Thomas Arts +%%% @doc Allow to run QuickCheck tests as eunit tests +%%% `rebar3 as eqc eunit --cover` +%%% or `rebar3 as eqc eunit --module=aeb_fate_code` +%%% Note that for obtainign cover file, one needs `rebar3 as eqc cover +%%% +%%% +%%% @end +%%% Created : 13 Dec 2018 by Thomas Arts + +-module(aeb_fate_code_tests). + +-include_lib("eunit/include/eunit.hrl"). + +-compile([export_all, nowarn_export_all]). + +-define(EQC_EUNIT(Module, PropName, Ms), + { atom_to_list(PropName), + {timeout, (Ms * 10) div 1000, ?_assert(eqc:quickcheck(eqc:testing_time(Ms / 1000, Module:PropName())))}}). + +quickcheck_test_() -> + {setup, fun() -> eqc:start() end, + [ ?EQC_EUNIT(aefate_code_eqc, prop_serializes, 3000) + ]}.