aboutsummaryrefslogtreecommitdiffstats
path: root/lib/percept/test/percept_db_SUITE.erl
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2016-03-16 19:02:13 +0100
committerBjörn-Egil Dahlberg <[email protected]>2016-03-16 19:44:58 +0100
commit86743354292ef497401303b6e8566b6f3f738b96 (patch)
treeb2d7afd395447ce8568b6ba991b53fa8d626328c /lib/percept/test/percept_db_SUITE.erl
parente7473f6810b249d1115361f005fb8b44fe59f474 (diff)
downloadotp-86743354292ef497401303b6e8566b6f3f738b96.tar.gz
otp-86743354292ef497401303b6e8566b6f3f738b96.tar.bz2
otp-86743354292ef497401303b6e8566b6f3f738b96.zip
Modernize test suites
Diffstat (limited to 'lib/percept/test/percept_db_SUITE.erl')
-rw-r--r--lib/percept/test/percept_db_SUITE.erl36
1 files changed, 7 insertions, 29 deletions
diff --git a/lib/percept/test/percept_db_SUITE.erl b/lib/percept/test/percept_db_SUITE.erl
index 5b878e8462..c1d711060c 100644
--- a/lib/percept/test/percept_db_SUITE.erl
+++ b/lib/percept/test/percept_db_SUITE.erl
@@ -22,54 +22,32 @@
-include_lib("common_test/include/ct.hrl").
%% Test server specific exports
--export([all/1]).
--export([init_per_suite/1, end_per_suite/1]).
--export([init_per_testcase/2, end_per_testcase/2]).
+-export([all/0, suite/0]).
%% Test cases
--export([
- start/1
- ]).
+-export([start/1]).
%% Default timetrap timeout (set in init_per_testcase)
--define(default_timeout, ?t:minutes(2)).
-define(restarts, 10).
-define(alive_timeout, 500).
-init_per_suite(Config) when is_list(Config) ->
- Config.
+suite() ->
+ [{timetrap, {minutes, 2}}].
-end_per_suite(Config) when is_list(Config) ->
- Config.
-
-init_per_testcase(_Case, Config) ->
- Dog = ?t:timetrap(?default_timeout),
- [{max_size, 300}, {watchdog,Dog} | Config].
-
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
- ok.
-
-all(suite) ->
- % Test cases
+all() ->
[start].
%%----------------------------------------------------------------------
%% Tests
%%----------------------------------------------------------------------
-start(suite) ->
- [];
-start(doc) ->
- ["Percept_db start and restart test."];
+%% Percept_db start and restart test.
start(Config) when is_list(Config) ->
ok = restart(?restarts),
{stopped, _DB} = percept_db:stop(),
ok.
-restart(0)->
- ok;
+restart(0)-> ok;
restart(N)->
{_, DB} = percept_db:start(),
timer:sleep(?alive_timeout),