define skeleton for test suite

This commit is contained in:
Dmitry Kolesnikov 2016-03-21 20:08:20 +02:00
parent 83458f136e
commit f1d264bec6
3 changed files with 115 additions and 0 deletions

11
test/cache.config Normal file
View File

@ -0,0 +1,11 @@
%%
%% logs
{logdir, "/tmp/test/cache/"}.
%%
%% suites
{suites, ".", all}.
%%
%% code coverage
{cover, "cover.spec"}.

103
test/cache_SUITE.erl Normal file
View File

@ -0,0 +1,103 @@
%%
%% Copyright 2015 Dmitry Kolesnikov, All Rights Reserved
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% http://www.apache.org/licenses/LICENSE-2.0
%%
%% Unless required by applicable law or agreed to in writing, software
%% distributed under the License is distributed on an "AS IS" BASIS,
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%% See the License for the specific language governing permissions and
%% limitations under the License.
%%
-module(cache_SUITE).
-include_lib("common_test/include/ct.hrl").
%%
%% common test
-export([
all/0
,groups/0
,init_per_suite/1
,end_per_suite/1
,init_per_group/2
,end_per_group/2
]).
%%
%% primitives
-export([
lifecycle/1
]).
%%
%% cache basic i/o
-export([
put/1
]).
%%%----------------------------------------------------------------------------
%%%
%%% suite
%%%
%%%----------------------------------------------------------------------------
all() ->
[
{group, primitives},
{group, basic_io}
].
groups() ->
[
{primitives, [parallel],
[lifecycle]},
{basic_io, [parallel],
[put]}
].
%%%----------------------------------------------------------------------------
%%%
%%% init
%%%
%%%----------------------------------------------------------------------------
init_per_suite(Config) ->
Config.
end_per_suite(_Config) ->
ok.
%%
%%
init_per_group(_, Config) ->
Config.
end_per_group(_, _Config) ->
ok.
%%%----------------------------------------------------------------------------
%%%
%%% cache primitives
%%%
%%%----------------------------------------------------------------------------
lifecycle(_Config) ->
{ok, Cache} = cache:start_link([]),
ok = cache:drop(Cache).
%%%----------------------------------------------------------------------------
%%%
%%% cache basic i/o
%%%
%%%----------------------------------------------------------------------------
put(_Config) ->
{ok, Cache} = cache:start_link([]),
ok = cache:put(Cache, key, val),
ok = cache:drop(Cache).

1
test/cover.spec Normal file
View File

@ -0,0 +1 @@
{incl_app, cache, details}.