diff options
author | Björn Gustavsson <[email protected]> | 2012-04-25 08:10:59 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2012-05-02 15:31:02 +0200 |
commit | c2e3aaf3ae8025b19605b7db00fdeb4b11e0f1bd (patch) | |
tree | 8b4e18c2d5e13243b73797474682c52ab6978e1f /erts/test/otp_SUITE.erl | |
parent | 50176a20c64ccd98a5d534b3c388593ff654fc8e (diff) | |
download | otp-c2e3aaf3ae8025b19605b7db00fdeb4b11e0f1bd.tar.gz otp-c2e3aaf3ae8025b19605b7db00fdeb4b11e0f1bd.tar.bz2 otp-c2e3aaf3ae8025b19605b7db00fdeb4b11e0f1bd.zip |
otp_SUITE: Prefix MFAs with the application they belong to
Diffstat (limited to 'erts/test/otp_SUITE.erl')
-rw-r--r-- | erts/test/otp_SUITE.erl | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/erts/test/otp_SUITE.erl b/erts/test/otp_SUITE.erl index f146bf1d69..644b54f0e1 100644 --- a/erts/test/otp_SUITE.erl +++ b/erts/test/otp_SUITE.erl @@ -97,9 +97,11 @@ undefined_functions(Config) when is_list(Config) -> Fd = open_log(Config, "undefined_functions"), foreach(fun ({MFA1,MFA2}) -> io:format("~s calls undefined ~s", - [format_mfa(MFA1),format_mfa(MFA2)]), + [format_mfa(Server, MFA1), + format_mfa(MFA2)]), io:format(Fd, "~s ~s\n", - [format_mfa(MFA1),format_mfa(MFA2)]) + [format_mfa(Server, MFA1), + format_mfa(MFA2)]) end, Undef), close_log(Fd), ?line ?t:fail({length(Undef),undefined_functions_in_otp}) @@ -215,9 +217,9 @@ deprecated_not_in_obsolete(Config) when is_list(Config) -> _ -> io:put_chars("The following functions have -deprecated() attributes,\n" "but are not listed in otp_internal:obsolete/3.\n"), - ?line print_mfas(group_leader(), L), + print_mfas(group_leader(), Server, L), Fd = open_log(Config, "deprecated_not_obsolete"), - print_mfas(Fd, L), + print_mfas(Fd, Server, L), close_log(Fd), ?line ?t:fail({length(L),deprecated_but_not_obsolete}) end. @@ -239,9 +241,9 @@ obsolete_but_not_deprecated(Config) when is_list(Config) -> io:put_chars("The following functions are listed " "in otp_internal:obsolete/3,\n" "but don't have -deprecated() attributes.\n"), - ?line print_mfas(group_leader(), L), + print_mfas(group_leader(), Server, L), Fd = open_log(Config, "obsolete_not_deprecated"), - print_mfas(Fd, L), + print_mfas(Fd, Server, L), close_log(Fd), ?line ?t:fail({length(L),obsolete_but_not_deprecated}) end. @@ -310,15 +312,22 @@ strong_components(Config) when is_list(Config) -> %%% Common help functions. %%% - -print_mfas(Fd, [MFA|T]) -> - io:format(Fd, "~s\n", [format_mfa(MFA)]), - print_mfas(Fd, T); -print_mfas(_, []) -> ok. +print_mfas(Fd, Server, MFAs) -> + [io:format(Fd, "~s\n", [format_mfa(Server, MFA)]) || MFA <- MFAs], + ok. format_mfa({M,F,A}) -> lists:flatten(io_lib:format("~s:~s/~p", [M,F,A])). +format_mfa(Server, MFA) -> + MFAString = format_mfa(MFA), + AQ = "(App)" ++ MFAString, + AppPrefix = case xref:q(Server, AQ) of + {ok,[App]} -> "[" ++ atom_to_list(App) ++ "]"; + _ -> "" + end, + AppPrefix ++ MFAString. + open_log(Config, Name) -> PrivDir = ?config(priv_dir, Config), RunDir = filename:dirname(filename:dirname(PrivDir)), |