From a908160088b654e436bdcdd32369c29603ca5fa7 Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Mon, 19 Nov 2012 15:13:47 +0100 Subject: [test_server] Fix erl2html2.erl to handle badly indented files Line numbering of erlang files that were not correctly indented could be wrong after coverting to html with erl2html2:convert/[2,3]. This has been corrected. This commit also fixes the following: * There are now link targets for each line and not only for each 10th line - meaning that links from test logs are now to the exact line, and not to the last number for which N rem 10 == 0. * there will only be one link target per function, i.e. the faulty link targets for function clauses are removed. * link targets for function now includes the arity (e.g. func/1 has a link target "func-1") And some tests are added. --- lib/test_server/src/test_server_sup.erl | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'lib/test_server/src/test_server_sup.erl') diff --git a/lib/test_server/src/test_server_sup.erl b/lib/test_server/src/test_server_sup.erl index ba5bb9f5d2..c7553cccb5 100644 --- a/lib/test_server/src/test_server_sup.erl +++ b/lib/test_server/src/test_server_sup.erl @@ -568,16 +568,11 @@ format_loc1({Mod,Func,Line}) -> {false,[$E,$T,$I,$U,$S,$_|_]} -> io_lib:format("{~s,~w,~w}", [ModStr,Func,downcase(ModStr),?src_listing_ext, - round_to_10(Line),Line]); + Line,Line]); _ -> io_lib:format("{~s,~w,~w}",[ModStr,Func,Line]) end. -round_to_10(N) when (N rem 10) == 0 -> - N; -round_to_10(N) -> - trunc(N/10)*10. - downcase(S) -> downcase(S, []). downcase([Uc|Rest], Result) when $A =< Uc, Uc =< $Z -> downcase(Rest, [Uc-$A+$a|Result]); -- cgit v1.2.3