anchor.diff:  -author('schuett@zib.de').
   -vsn('$Id$').
   
  --export([test/4]).
  +-export([test/4, test_log/4]).
   
   -include("tester.hrl").
   -include("unittest.hrl").
  
positive.code:     end;
  parse_type({var, _Line, Atom}, _Module, ParseState) when is_atom(Atom) ->
      {{tuple, {typedef, tester, test_any}}, ParseState};
  parse_type(TypeSpec, Module, ParseState) ->
      ct:pal("unknown type ~p in module ~p", [TypeSpec, Module]),
      {unkown, ParseState}.
  
negative.code:         exit:Reason2 -> ?ct_fail("exception (exit) in ~p:~p(): ~p~n", [Module, Func, {exception, Reason2}]);
          error:Reason2 -> ?ct_fail("exception (error) in ~p:~p(): ~p~n", [Module, Func, {exception, {Reason2, erlang:get_stacktrace()}}])
      end,
      run(Module, Func, Arity, Iterations, ParseState),
      ok.
  
  -spec test_log/4 :: (module(), atom(), non_neg_integer(), non_neg_integer()) -> ok.
  test_log(Module, Func, Arity, Iterations) ->
      EmptyParseState = tester_parse_state:new_parse_state(),
      ParseState = try collect_fun_info(Module, Func, Arity,
                                        EmptyParseState)
      catch
          throw:Term2 -> ?ct_fail("exception (throw) in ~p:~p(): ~p~n", [Module, Func, {exception, Term2}]);
          % special handling for exits that come from a ct:fail() call:
          exit:{test_case_failed, Reason2} -> ?ct_fail("error ~p:~p() failed with ~p~n", [Module, Func, Reason2]);
          exit:Reason2 -> ?ct_fail("exception (exit) in ~p:~p(): ~p~n", [Module, Func, {exception, Reason2}]);
          error:Reason2 -> ?ct_fail("exception (error) in ~p:~p(): ~p~n", [Module, Func, {exception, {Reason2, erlang:get_stacktrace()}}])
      end,
      io:format(""),
      run(Module, Func, Arity, Iterations, ParseState),
      ok.
  
  