machinery-erlang/test/ct_sup.erl
Andrey Fadeev 032b66457e
Add formatter (#29)
* Add erlfmt
* Apply erlfmt
* Update build-utils
* Fix module names in elvis config
2020-10-14 12:23:52 +03:00

30 lines
473 B
Erlang

-module(ct_sup).
-export([start/0]).
-export([stop/1]).
%%
-behaviour(supervisor).
-export([init/1]).
%%
-spec start() -> pid().
start() ->
{ok, PID} = supervisor:start_link(?MODULE, []),
true = unlink(PID),
PID.
-spec stop(pid()) -> ok.
stop(PID) ->
true = exit(PID, kill),
ok.
%%
-spec init([]) -> {ok, {supervisor:sup_flags(), [supervisor:child_spec()]}}.
init([]) ->
{ok, {#{strategy => one_for_all, intensity => 1, period => 1}, []}}.