From 4580fe685f6b620036a8ba0d029d43a8aa334984 Mon Sep 17 00:00:00 2001 From: Richard Carlsson Date: Mon, 21 Apr 2014 00:08:58 +0200 Subject: [PATCH] eliminate pointless diffs between this code and the version in OTP --- src/eunit_server.erl | 3 ++- src/eunit_test.erl | 60 ++++++++++++++++++++++---------------------- 2 files changed, 32 insertions(+), 31 deletions(-) diff --git a/src/eunit_server.erl b/src/eunit_server.erl index 348383b..f6e85c4 100644 --- a/src/eunit_server.erl +++ b/src/eunit_server.erl @@ -205,7 +205,8 @@ server_command(From, stop, St) -> server(St#state{stopped = true}); server_command(From, {watch, Target, _Opts}, St) -> %% the code watcher is only started on demand - code_monitor:monitor(self()), + %% FIXME: this is disabled for now in the OTP distribution + %%code_monitor:monitor(self()), %% TODO: propagate options to testing stage St1 = add_watch(Target, St), server_command_reply(From, ok), diff --git a/src/eunit_test.erl b/src/eunit_test.erl index 6d5bbc0..add30da 100644 --- a/src/eunit_test.erl +++ b/src/eunit_test.erl @@ -143,12 +143,12 @@ macro_test_() -> = run_testfun(F) end), ?_test(begin - {?LINE, F} = ?_assertNotMatch(ok, error), - {ok, ok} = run_testfun(F) - end), + {?LINE, F} = ?_assertNotMatch(ok, error), + {ok, ok} = run_testfun(F) + end), ?_test(begin - {?LINE, F} = ?_assertNotMatch([_], [42]), - {error,{error,{assertNotMatch_failed, + {?LINE, F} = ?_assertNotMatch([_], [42]), + {error,{error,{assertNotMatch_failed, [{module,_}, {line,_}, {expression,_}, @@ -156,7 +156,7 @@ macro_test_() -> {value,[42]}]}, _}} = run_testfun(F) - end), + end), ?_test(begin {?LINE, F} = ?_assertEqual(ok, ok), {ok, ok} = run_testfun(F) @@ -173,19 +173,19 @@ macro_test_() -> = run_testfun(F) end), ?_test(begin - {?LINE, F} = ?_assertNotEqual(1, 0), - {ok, ok} = run_testfun(F) - end), + {?LINE, F} = ?_assertNotEqual(1, 0), + {ok, ok} = run_testfun(F) + end), ?_test(begin - {?LINE, F} = ?_assertNotEqual(2, 1+1), - {error,{error,{assertNotEqual_failed, + {?LINE, F} = ?_assertNotEqual(2, 1+1), + {error,{error,{assertNotEqual_failed, [{module,_}, {line,_}, {expression,_}, {value,2}]}, _}} = run_testfun(F) - end), + end), ?_test(begin {?LINE, F} = ?_assertException(error, badarith, erlang:error(badarith)), @@ -214,33 +214,33 @@ macro_test_() -> {error,badarith,_}}]}, _}} = run_testfun(F) - end), + end), ?_test(begin - {?LINE, F} = ?_assertError(badarith, + {?LINE, F} = ?_assertError(badarith, erlang:error(badarith)), - {ok, ok} = run_testfun(F) - end), + {ok, ok} = run_testfun(F) + end), ?_test(begin - {?LINE, F} = ?_assertExit(normal, exit(normal)), - {ok, ok} = run_testfun(F) - end), + {?LINE, F} = ?_assertExit(normal, exit(normal)), + {ok, ok} = run_testfun(F) + end), ?_test(begin - {?LINE, F} = ?_assertThrow(foo, throw(foo)), - {ok, ok} = run_testfun(F) - end), + {?LINE, F} = ?_assertThrow(foo, throw(foo)), + {ok, ok} = run_testfun(F) + end), ?_test(begin - {?LINE, F} = ?_assertNotException(error, badarith, 42), - {ok, ok} = run_testfun(F) - end), + {?LINE, F} = ?_assertNotException(error, badarith, 42), + {ok, ok} = run_testfun(F) + end), ?_test(begin - {?LINE, F} = ?_assertNotException(error, badarith, + {?LINE, F} = ?_assertNotException(error, badarith, erlang:error(badarg)), - {ok, ok} = run_testfun(F) - end), + {ok, ok} = run_testfun(F) + end), ?_test(begin - {?LINE, F} = ?_assertNotException(error, badarith, + {?LINE, F} = ?_assertNotException(error, badarith, erlang:error(badarith)), - {error,{error,{assertNotException_failed, + {error,{error,{assertNotException_failed, [{module,_}, {line,_}, {expression,_},