EUNIT モジュールを使用し、「eunit/include/eunit.hrl」を含めます。引数 func/0 を指定して spawn/1 を呼び出し、テスト関数で新しいプロセスを生成し、新しいプロセスで io:format/1 を呼び出します。引数 func/0 は、次のような再帰関数です。
func() ->
A = 2,
io:format("#######~p~n", [A]),
timer:sleep(1000),
func().
それで
10> bt:test().
All 2 tests passed.
ok
11>
=ERROR REPORT==== 19-Jun-2013::19:50:54 ===
Error in process <0.122.0> with exit value: {terminated,[{io,format,[<0.121.0>,"
#######~p~n",[2]],[]},{bt,func,0,[{file,"bt.erl"},{line,6}]}]}
何が問題で、どうすればよいですか?