aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/src
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2015-03-12 13:38:45 +0100
committerPeter Andersson <[email protected]>2015-03-12 13:38:45 +0100
commit4e61b42c83984db3da78ff50a4e9f27518fa0110 (patch)
treecf99da8d84197e9e67a2f4dff14942bfc5bb27b1 /lib/common_test/src
parent0796cb716511ae2bf35ee0ee1e0da75f20ad567f (diff)
downloadotp-4e61b42c83984db3da78ff50a4e9f27518fa0110.tar.gz
otp-4e61b42c83984db3da78ff50a4e9f27518fa0110.tar.bz2
otp-4e61b42c83984db3da78ff50a4e9f27518fa0110.zip
Fix problem with directories not listed in expected order
Diffstat (limited to 'lib/common_test/src')
-rw-r--r--lib/common_test/src/ct_logs.erl14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/common_test/src/ct_logs.erl b/lib/common_test/src/ct_logs.erl
index 23332ad268..dc118ed149 100644
--- a/lib/common_test/src/ct_logs.erl
+++ b/lib/common_test/src/ct_logs.erl
@@ -1905,6 +1905,17 @@ sort_all_runs(Dirs) ->
{Date1,HH1,MM1,SS1} > {Date2,HH2,MM2,SS2}
end, Dirs).
+sort_ct_runs(Dirs) ->
+ %% Directory naming: <Prefix>.NodeName.Date_Time[/...]
+ %% Sort on Date_Time string: "YYYY-MM-DD_HH.MM.SS"
+ lists:sort(fun(Dir1,Dir2) ->
+ [_Prefix,_Node1,DateHH1,MM1,SS1] =
+ string:tokens(filename:dirname(Dir1),[$.]),
+ [_Prefix,_Node2,DateHH2,MM2,SS2] =
+ string:tokens(filename:dirname(Dir2),[$.]),
+ {DateHH1,MM1,SS1} =< {DateHH2,MM2,SS2}
+ end, Dirs).
+
dir_diff_all_runs(Dirs, LogCache) ->
case LogCache#log_cache.all_runs of
[] ->
@@ -2217,7 +2228,8 @@ make_all_suites_index(When) when is_atom(When) ->
end
end,
- LogDirs = filelib:wildcard(logdir_prefix()++".*/*"++?logdir_ext),
+ Wildcard = logdir_prefix()++".*/*"++?logdir_ext,
+ LogDirs = sort_ct_runs(filelib:wildcard(Wildcard)),
LogCacheInfo = get_cache_data(UseCache),