anchor.diff:      Link = filename:join([ResultsDir, "current"]),
       [] = os:cmd(?FMT("rm -f ~s; ln -sf ~s ~s", [Link, TestDir, Link])),
       TestDir.
  -
  -wait_for_stop(Mref, infinity) ->
  -    receive
  -        {'DOWN', Mref, _, _, Info} ->
  -            run_post_hook(),
  -            ?CONSOLE("Test stopped: ~p\n", [Info])
  -    end;
  -wait_for_stop(Mref, DurationMins) ->
  -    Duration = timer:minutes(DurationMins) + timer:seconds(1),
  -    receive
  -        {'DOWN', Mref, _, _, Info} ->
  -            run_post_hook(),
  -            ?CONSOLE("Test stopped: ~p\n", [Info]);
  -        {shutdown, Reason, Exit} ->
  -            run_post_hook(),
  -            basho_bench_app:stop(),
  -            ?CONSOLE("Test shutdown: ~s~n", [Reason]),
  -            halt(Exit)
  -
  -    after Duration ->
  -            run_post_hook(),
  -            basho_bench_app:stop(),
  -            ?CONSOLE("Test completed after ~p mins.\n", [DurationMins])
  -    end.
   
   %%
   %% Construct a string suitable for use as a unique ID for this test run
  
positive.code:                         end
                  end,
      filelib:fold_files(Dir, ".*.erl", false, CompileFn, ok).
  
  run_pre_hook() ->
      run_hook(basho_bench_config:get(pre_hook, no_op)).
  
  run_post_hook() ->
      run_hook(basho_bench_config:get(post_hook, no_op)).
  
  run_hook({Module, Function}) ->
      Module:Function();
  
  run_hook(no_op) ->
      no_op.
  
  get_addr_args() ->
      {ok, IfAddrs} = inet:getifaddrs(),
  
negative.code: -else.
  md5(Bin) -> crypto:md5(Bin).
  -endif.
  
  load_apps([]) ->
      ok;
  load_apps([App | Apps]) ->
      case application:load(App) of
          ok -> load_apps(Apps);
          {error, {already_loaded, basho_bench}} -> load_apps(Apps);
          {error, Reason} -> {error, App, Reason}
      end.
  