anchor.diff:      Suite = rebar_config:get_global(suite, undefined),
       EunitOpts = get_eunit_opts(Config),
   
  -    OrigEnv = set_proc_env(),
  +    %% Move down into ?EUNIT_DIR while we run tests so any generated files
  +    %% are created there (versus in the source dir)
  +    Cwd = rebar_utils:get_cwd(),
  +    file:set_cwd(?EUNIT_DIR),
  +
       EunitResult = perform_eunit(EunitOpts, Modules, Suite),
  -    restore_proc_env(OrigEnv),
  +
  +    %% Return to original working dir
  +    file:set_cwd(Cwd),
  +
       EunitResult.
   
   perform_eunit(EunitOpts, Modules, undefined) ->
       (catch eunit:test(Modules, EunitOpts));
   perform_eunit(EunitOpts, _Modules, Suite) ->
       (catch eunit:test(list_to_atom(Suite), EunitOpts)).
  -
  -set_proc_env() ->
  -    %% Save current code path and then prefix ?EUNIT_DIR on it so that our modules
  -    %% are found there
  -    CodePath = code:get_path(),
  -    true = code:add_patha(eunit_dir()),
  -
  -    %% Move down into ?EUNIT_DIR while we run tests so any generated files
  -    %% are created there (versus in the source dir)
  -    Cwd = rebar_utils:get_cwd(),
  -    file:set_cwd(?EUNIT_DIR),
  -    {CodePath, Cwd}.
  -
  -restore_proc_env({CodePath, Cwd}) ->
  -    %% Return to original working dir
  -    file:set_cwd(Cwd),
  -    %% Restore code path
  -    true = code:set_path(CodePath).
   
   get_eunit_opts(Config) ->
       %% Enable verbose in eunit if so requested..
  
positive.code:         ok ->
              ok;
          _ ->
              ?CONSOLE("One or more eunit tests failed.~n", []),
              ?FAIL
      end,
      ok.
  
  clean(_Config, _File) ->
  
negative.code: 
  eunit_dir() ->
      filename:join(rebar_utils:get_cwd(), ?EUNIT_DIR).
  
  ebin_dir() ->
      filename:join(rebar_utils:get_cwd(), "ebin").
  
  perform_eunit(Config, Modules) ->
      %% suite defined, so only specify the module that relates to the
  