From d6f5a1d972b76335613ac4ec83d8de8ca1aa7260 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Sat, 23 Apr 2016 02:55:39 +0900 Subject: eunit: Add ?debugValAll macro Add a macro which works much like ?debugVal, but doesn't truncate terms to print. --- lib/eunit/doc/overview.edoc | 2 ++ lib/eunit/include/eunit.hrl | 8 ++++++++ 2 files changed, 10 insertions(+) (limited to 'lib/eunit') diff --git a/lib/eunit/doc/overview.edoc b/lib/eunit/doc/overview.edoc index 12ea02f442..ca7ffb83a4 100644 --- a/lib/eunit/doc/overview.edoc +++ b/lib/eunit/doc/overview.edoc @@ -693,6 +693,8 @@ it like `debugMsg'. The result is always `ok'. 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. +
`debugValAll(Expr)'
+
This is almost same as `debugVal(Expr)`, but doesn't truncate terms to print.
`debugTime(Text,Expr)'
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/include/eunit.hrl b/lib/eunit/include/eunit.hrl index 8f678b0290..b6dbe2d706 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), @@ -229,6 +230,13 @@ __V end)(E)) end). +-define(debugValAll(E), + begin + ((fun (__V) -> + ?debugFmt(<<"~ts = ~tp">>, [(??E), __V]), + __V + end)(E)) + end). -define(debugTime(S, E), begin ((fun () -> -- cgit v1.2.3