aboutsummaryrefslogtreecommitdiffstats
path: root/lib/eunit/include
diff options
context:
space:
mode:
Diffstat (limited to 'lib/eunit/include')
-rw-r--r--lib/eunit/include/eunit.hrl15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/eunit/include/eunit.hrl b/lib/eunit/include/eunit.hrl
index ef617f075f..0f7a15f669 100644
--- a/lib/eunit/include/eunit.hrl
+++ b/lib/eunit/include/eunit.hrl
@@ -51,7 +51,9 @@
%% note that the main switch used within this file is NOTEST; however,
%% both TEST and EUNIT may be used to check whether testing is enabled
-ifndef(NOTEST).
--undef(NOASSERT). % testing requires that assertions are enabled
+-ifndef(ASSERT).
+-define(ASSERT, true). % testing requires that assertions are enabled
+-endif.
-ifndef(TEST).
-define(TEST, true).
-endif.
@@ -135,7 +137,6 @@
-define(_assertThrow(Term, Expr), ?_assertException(throw, Term, Expr)).
-define(_assertNotException(Class, Term, Expr),
?_test(?assertNotException(Class, Term, Expr))).
--define(_assertReceive(Guard, Expr), ?_test(?assertReceive(Guard, Expr))).
%% Macros for running operating system commands. (Note that these
%% require EUnit to be present at runtime, or at least eunit_lib.)
@@ -213,6 +214,7 @@
-define(debugHere, ok).
-define(debugFmt(S, As), ok).
-define(debugVal(E), (E)).
+-define(debugValAll(E), (E)).
-define(debugTime(S, E), (E)).
-else.
-define(debugMsg(S),
@@ -223,13 +225,18 @@
end).
-define(debugHere, (?debugMsg("<-"))).
-define(debugFmt(S, As), (?debugMsg(io_lib:format((S), (As))))).
--define(debugVal(E),
+-define(debugVal(E, D),
begin
((fun (__V) ->
- ?debugFmt(<<"~ts = ~tP">>, [(??E), __V, 15]),
+ ?debugFmt(<<"~ts = ~tP">>,
+ [(??E), __V, D]),
__V
end)(E))
end).
+-ifndef(EUNIT_DEBUG_VAL_DEPTH).
+-define(EUNIT_DEBUG_VAL_DEPTH, 15).
+-endif.
+-define(debugVal(E), ?debugVal(E, ?EUNIT_DEBUG_VAL_DEPTH)).
-define(debugTime(S, E),
begin
((fun () ->