aboutsummaryrefslogtreecommitdiffstats
path: root/lib/eunit/src/eunit_proc.erl
diff options
context:
space:
mode:
authorVlad Dumitrescu <[email protected]>2015-03-12 23:04:30 +0100
committerVlad Dumitrescu <[email protected]>2015-03-12 23:04:30 +0100
commit65d41cb6c514308ab11645dc2d0842d4f6b629a4 (patch)
tree415ffb892239c26a317e2ac96743e6771d39ebe4 /lib/eunit/src/eunit_proc.erl
parentbcf520a6aeb5ff4423ade377e38269383b52e8f7 (diff)
downloadotp-65d41cb6c514308ab11645dc2d0842d4f6b629a4.tar.gz
otp-65d41cb6c514308ab11645dc2d0842d4f6b629a4.tar.bz2
otp-65d41cb6c514308ab11645dc2d0842d4f6b629a4.zip
OTP-11660: make eunit unicode safe
All output from eunit is unicode, including the surefire XML files.
Diffstat (limited to 'lib/eunit/src/eunit_proc.erl')
-rw-r--r--lib/eunit/src/eunit_proc.erl7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/eunit/src/eunit_proc.erl b/lib/eunit/src/eunit_proc.erl
index 03d1a18321..98ae31d54b 100644
--- a/lib/eunit/src/eunit_proc.erl
+++ b/lib/eunit/src/eunit_proc.erl
@@ -230,7 +230,7 @@ insulator_wait(Child, Parent, Buf, St) ->
message_super(Id, {progress, 'begin', {Type, Data}}, St),
insulator_wait(Child, Parent, [[] | Buf], St);
{child, Child, Id, {'end', Status, Time}} ->
- Data = [{time, Time}, {output, buffer_to_binary(hd(Buf))}],
+ Data = [{time, Time}, {output, lists:reverse(hd(Buf))}],
message_super(Id, {progress, 'end', {Status, Data}}, St),
insulator_wait(Child, Parent, tl(Buf), St);
{child, Child, Id, {skipped, Reason}} ->
@@ -272,9 +272,6 @@ kill_task(Child, St) ->
exit(Child, kill),
terminate_insulator(St).
-buffer_to_binary([B]) when is_binary(B) -> B; % avoid unnecessary copying
-buffer_to_binary(Buf) -> list_to_binary(lists:reverse(Buf)).
-
%% Unlinking before exit avoids polluting the parent process with exit
%% signals from the insulator. The child process is already dead here.
@@ -597,7 +594,7 @@ group_leader_loop(Runner, Wait, Buf) ->
%% no more messages and nothing to wait for; we ought to
%% have collected all immediately pending output now
process_flag(priority, normal),
- Runner ! {self(), buffer_to_binary(Buf)}
+ Runner ! {self(), lists:reverse(Buf)}
end.
group_leader_sync(G) ->