forked from erlyaws/yaws
-
Notifications
You must be signed in to change notification settings - Fork 0
/
copy_error_log_SUITE.erl
48 lines (35 loc) · 1014 Bytes
/
copy_error_log_SUITE.erl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
-module(copy_error_log_SUITE).
-include("testsuite.hrl").
-compile(export_all).
all() ->
[
error_log_handler
].
groups() ->
[
].
%%====================================================================
init_per_suite(Config) ->
Config.
end_per_suite(_Config) ->
ok.
init_per_group(_Group, Config) ->
Config.
end_per_group(_Group, _Config) ->
ok.
init_per_testcase(_Test, Config) ->
Config.
end_per_testcase(_Test, _Config) ->
ok.
%%====================================================================
error_log_handler(_Config) ->
?assertMatch({ok, _}, yaws_log:start_link()),
GConf = yaws:create_gconf([], default),
SConf = yaws:create_sconf(".", []),
?assertEqual(ok, yaws_log:setup(GConf, [SConf])),
Handlers = gen_event:which_handlers(error_logger),
?assert(lists:member(yaws_log_file_h, Handlers)),
Dir = yaws:gconf_logdir(GConf),
File = filename:join([Dir, "report.log"]),
?assert(filelib:is_regular(File)),
ok.