anchor.diff:              Target
       end.
   
  -compile_dir(State, Dir, OutDir) ->
  -    NewState = replace_src_dirs(State, [Dir]),
  -    ok = rebar_erlc_compiler:compile(NewState, rebar_dir:base_dir(State), OutDir),
  +compile_dir(State, Dir) ->
  +    NewState = replace_src_dirs(State, [filename:absname(Dir)]),
  +    ok = rebar_erlc_compiler:compile(NewState, rebar_dir:base_dir(State), Dir),
       ok = maybe_cover_compile(State, Dir),
  -    OutDir.
  +    Dir.
   
   retarget_path(State, Path) ->
       ProjectApps = rebar_state:project_apps(State),
  
positive.code: replace_src_dirs(State, Dirs) ->
      %% replace any `src_dirs` with the test dirs
      ErlOpts = rebar_state:get(State, erl_opts, []),
      StrippedOpts = filter_src_dirs(ErlOpts),
      rebar_state:set(State, erl_opts, [{extra_src_dirs, Dirs}|StrippedOpts]).
  
  filter_src_dirs(ErlOpts) ->
      lists:filter(fun({src_dirs, _}) -> false; ({extra_src_dirs, _}) -> false; (_) -> true end, ErlOpts).
  
negative.code:             Dirs = find_suite_dirs(AllSuites),
              lists:foreach(fun(S) ->
                  NewPath = copy(State, S),
                  compile_dir(State, NewPath)
              end, Dirs),
              NewSuites = lists:map(fun(S) -> retarget_path(State, S) end, AllSuites),
              [{suite, NewSuites}|lists:keydelete(suite, 1, Opts)]
  