4
%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
4
%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
6
6
%% The contents of this file are subject to the Erlang Public License,
7
7
%% Version 1.1, (the "License"); you may not use this file except in
36
36
-define(DEFAULT_TIMEOUT, ?t:minutes(5)).
38
-export([all/1, init_per_testcase/2, fin_per_testcase/2]).
38
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
39
init_per_group/2,end_per_group/2,
40
init_per_testcase/2, end_per_testcase/2]).
40
42
-export([search_for_core_files/1, core_files/1]).
42
-include_lib("test_server/include/test_server.hrl").
44
-include_lib("common_test/include/ct.hrl").
45
47
init_per_testcase(Case, Config) ->
46
48
Dog = ?t:timetrap(?DEFAULT_TIMEOUT),
47
49
[{testcase, Case}, {watchdog, Dog} |Config].
49
fin_per_testcase(_Case, Config) ->
51
end_per_testcase(_Case, Config) ->
50
52
Dog = ?config(watchdog, Config),
51
53
?t:timetrap_cancel(Dog),
56
suite() -> [{ct_hooks,[ts_install_cth]}].
64
init_per_suite(Config) ->
67
end_per_suite(_Config) ->
70
init_per_group(_GroupName, Config) ->
73
end_per_group(_GroupName, Config) ->
148
167
file_inspect(#core_search_conf{file = File}, Core) ->
149
168
FRes0 = os:cmd(File ++ " " ++ Core),
150
FRes = case regexp:match(FRes0, Core) of
169
FRes = case string:str(FRes0, Core) of
152
173
L = length(FRes0),
155
177
lists:sublist(FRes0, E+1, L+1);
161
183
lists:sublist(FRes0, E+1, L+1)
165
case regexp:match(FRes, "[Tt][Ee][Xx][Tt]") of
186
case re:run(FRes, "text|ascii", [caseless,{capture,none}]) of
167
case regexp:match(FRes, "[Aa][Ss][Cc][Ii][Ii]") of
177
193
mk_readable(F) ->