anchor.diff:              ct:fail(unknown_module)
       end.
   
  --spec get_compile_flags_for_module(module()) -> list().
  -get_compile_flags_for_module(Module) ->
  -    % we have to be in $SCALARIS/ebin to find the beam file
  -    {ok, CurCWD} = file:get_cwd(),
  -    ok = fix_cwd_ebin(),
  -    Res = beam_lib:chunks(Module, [compile_info]),
  -    ok = file:set_cwd(CurCWD),
  -    case Res of
  -        {ok, {Module, [{compile_info, Options}]}} ->
  -            {options, Opts} = lists:keyfind(options, 1, Options),
  -            Opts;
  -        X ->
  -            ct:pal("~w ~w", [Module, X]),
  -            timer:sleep(1000),
  -            ct:fail(unknown_module),
  -            []
  -    end.
  -
  -% @doc set cwd to $SCALARIS/ebin
  --spec fix_cwd_ebin() -> ok | {error, Reason::file:posix()}.
  -fix_cwd_ebin() ->
  +% @doc set cwd to $SCALARIS/RelPath
  +-spec fix_cwd(RelPath::string()) -> ok | {error, Reason::file:posix()}.
  +fix_cwd(RelPath) ->
       case file:get_cwd() of
           {ok, CurCWD} ->
  -            case string:rstr(CurCWD, "/ebin") =/= (length(CurCWD) - 4 + 1) of
  -                true -> file:set_cwd("../ebin");
  +            case string:rstr(CurCWD, "/" ++ RelPath) =/= (length(CurCWD) - 4 + 1) of
  +                true -> file:set_cwd("../" ++ RelPath);
                   _    -> ok
               end;
           Error -> Error
  
positive.code: % misc. helper functions
  %
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  -spec get_file_for_module(module()) -> string().
  get_file_for_module(Module) ->
      % we have to be in $SCALARIS/ebin to find the beam file
      {ok, CurCWD} = file:get_cwd(),
      ok = fix_cwd_ebin(),
      Res = beam_lib:chunks(Module, [compile_info]),
      ok = file:set_cwd(CurCWD),
      case Res of
          {ok, {Module, [{compile_info, Options}]}} ->
              {source, Filename} = lists:keyfind(source, 1, Options),
              Filename;
          X ->
              ct:pal("~w ~p", [Module, X]),
              ct:pal("~p", [file:get_cwd()]),
  
negative.code: % directory should be in ../ebin
  
  reload_with_options(Module, MyOptions) ->
      {Src, Options} = get_src_and_flags_for_module(Module),
      %ct:pal("~p", [file:get_cwd()]),
      %ct:pal("~p", [Options]),
      {ok, CurCWD} = file:get_cwd(),
      ok = fix_cwd_scalaris(),
  