aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2015-04-10 16:12:48 +0200
committerPeter Andersson <[email protected]>2015-05-04 15:33:43 +0200
commitcb0f971faaf04fc0270f51e688e84b8279c33afb (patch)
tree92db4c0512d1f6c810d40c8de9e5c8187e08276f /lib/common_test
parentff1e0b2fe44a347670a5d72c45c061fefa6abc7f (diff)
downloadotp-cb0f971faaf04fc0270f51e688e84b8279c33afb.tar.gz
otp-cb0f971faaf04fc0270f51e688e84b8279c33afb.tar.bz2
otp-cb0f971faaf04fc0270f51e688e84b8279c33afb.zip
Fix error in ct_logs, not handling long names correctly
Diffstat (limited to 'lib/common_test')
-rw-r--r--lib/common_test/src/ct_logs.erl15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/common_test/src/ct_logs.erl b/lib/common_test/src/ct_logs.erl
index dc118ed149..fa55a9754e 100644
--- a/lib/common_test/src/ct_logs.erl
+++ b/lib/common_test/src/ct_logs.erl
@@ -1908,13 +1908,14 @@ sort_all_runs(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).
+ lists:sort(
+ fun(Dir1,Dir2) ->
+ [SS1,MM1,DateHH1 | _] =
+ lists:reverse(string:tokens(filename:dirname(Dir1),[$.])),
+ [SS2,MM2,DateHH2 | _] =
+ lists:reverse(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