diff options
Diffstat (limited to 'lib/eunit')
-rw-r--r-- | lib/eunit/doc/overview.edoc | 9 | ||||
-rw-r--r-- | lib/eunit/doc/src/notes.xml | 10 | ||||
-rw-r--r-- | lib/eunit/include/eunit.hrl | 10 | ||||
-rw-r--r-- | lib/eunit/vsn.mk | 2 |
4 files changed, 20 insertions, 11 deletions
diff --git a/lib/eunit/doc/overview.edoc b/lib/eunit/doc/overview.edoc index 12ea02f442..3a46e991cb 100644 --- a/lib/eunit/doc/overview.edoc +++ b/lib/eunit/doc/overview.edoc @@ -690,9 +690,12 @@ it like `debugMsg'. The result is always `ok'.</dd> <dt>`debugVal(Expr)'</dt> <dd>Prints both the source code for `Expr' and its current value. E.g., `?debugVal(f(X))' might be displayed as "`f(X) = 42'". (Large terms are -shown truncated.) The result is always the value of `Expr', so this -macro can be wrapped around any expression to display its value when -the code is compiled with debugging enabled.</dd> +truncated to the depth given by the macro `EUNIT_DEBUG_VAL_DEPTH', which +defaults to 15 but can be overridden by the user.) The result is always the +value of `Expr', so this macro can be wrapped around any expression to +display its value when the code is compiled with debugging enabled.</dd> +<dt>`debugVal(Expr, Depth)'</dt> +<dd>Like `debugVal(Expr)', but prints terms truncated to the given depth.</dd> <dt>`debugTime(Text,Expr)'</dt> <dd>Prints `Text' and the wall clock time for evaluation of `Expr'. The result is always the value of `Expr', so this macro can be wrapped diff --git a/lib/eunit/doc/src/notes.xml b/lib/eunit/doc/src/notes.xml index eef815952d..88602e8222 100644 --- a/lib/eunit/doc/src/notes.xml +++ b/lib/eunit/doc/src/notes.xml @@ -33,15 +33,15 @@ </header> <p>This document describes the changes made to the EUnit application.</p> -<section><title>Eunit 2.2.14</title> +<section><title>Eunit 2.3</title> - <section><title>Fixed Bugs and Malfunctions</title> + <section><title>Improvements and New Features</title> <list> <item> + <p>There is a new <c>debugVal/2</c> that gives control + over the truncation depth.</p> <p> - Small documentation fixes</p> - <p> - Own Id: OTP-13017</p> + Own Id: OTP-13612</p> </item> </list> </section> diff --git a/lib/eunit/include/eunit.hrl b/lib/eunit/include/eunit.hrl index 8f678b0290..7fd6c206a4 100644 --- a/lib/eunit/include/eunit.hrl +++ b/lib/eunit/include/eunit.hrl @@ -212,6 +212,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), @@ -222,13 +223,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 () -> diff --git a/lib/eunit/vsn.mk b/lib/eunit/vsn.mk index b8af87872d..b551ee6eb6 100644 --- a/lib/eunit/vsn.mk +++ b/lib/eunit/vsn.mk @@ -1 +1 @@ -EUNIT_VSN = 2.2.14 +EUNIT_VSN = 2.3 |