anchor.diff:              true
       end.
   
  -runtime_dependencies(Config) ->
  +%% Test runtime dependencies when using an Xref server running in
  +%% 'functions' mode.
  +
  +runtime_dependencies_functions(Config) ->
  +    Server = proplists:get_value(xref_server, Config),
  +    runtime_dependencies(Server).
  +
  +%% Test runtime dependencies when using an xref server running in
  +%% 'modules' mode. Note that more module edges can potentially be
  +%% found in this mode because the analysis is based on the BEAM
  +%% code after all optimizations. For example, an apply in the source
  +%% code could after optimizations be resolved to a specific function.
  +%%
  +%% It is important to test 'modules' because reltool runs xref in
  +%% 'modules' mode (the BEAM files to be released might not contain
  +%% debug information).
  +
  +runtime_dependencies_modules(_Config) ->
  +    Server = start_xref_server(?FUNCTION_NAME, modules),
  +    try
  +        runtime_dependencies(Server)
  +    after
  +        catch xref:stop(Server)
  +    end.
  +
  +runtime_dependencies(Server) ->
       %% Ignore applications intentionally not declaring dependencies
       %% found by xref.
       IgnoreApps = [diameter],
  
positive.code: 
  start_xref_server(Server, Mode) ->
      Root = code:root_dir(),
      xref:start(Server),
      xref:set_default(Server, [{xref_mode,Mode},
                                {verbose,false},
                                {warnings,false},
                                {builtins,true}]),
      {ok,_Relname} = xref:add_release(Server, Root, {name,otp}),
  
negative.code:     [AppStr, _VsnStr] = string:lexemes(RDep, "-"),
      case Dep == list_to_atom(AppStr) of
          true ->
              %% io:format("~p -> ~s~n", [App, RDep]),
              true;
          false ->
              have_rdep(App, RDeps, Dep)
  