aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tools/test/fprof_SUITE.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2017-09-19 15:34:09 +0200
committerHans Bolinder <[email protected]>2017-09-20 08:16:31 +0200
commit918e7de543f729b6fad35c22eaeeb3fba3a4a7ba (patch)
treeef8acf9e663a8aa6ffc6784d78b687fe0422dc0b /lib/tools/test/fprof_SUITE.erl
parente01a81ba3119247b8837f6202591c2a3fec264e9 (diff)
downloadotp-918e7de543f729b6fad35c22eaeeb3fba3a4a7ba.tar.gz
otp-918e7de543f729b6fad35c22eaeeb3fba3a4a7ba.tar.bz2
otp-918e7de543f729b6fad35c22eaeeb3fba3a4a7ba.zip
fprof: Make sure the receiving file can handle Unicode
It is assumed that I/O devices can handle character codes greater than 255.
Diffstat (limited to 'lib/tools/test/fprof_SUITE.erl')
-rw-r--r--lib/tools/test/fprof_SUITE.erl17
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/tools/test/fprof_SUITE.erl b/lib/tools/test/fprof_SUITE.erl
index affb45b7a6..8fd164a4b3 100644
--- a/lib/tools/test/fprof_SUITE.erl
+++ b/lib/tools/test/fprof_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -27,7 +27,7 @@
%% Test suites
-export([stack_seq/1, tail_seq/1, create_file_slow/1, spawn_simple/1,
imm_tail_seq/1, imm_create_file_slow/1, imm_compile/1,
- cpu_create_file_slow/1]).
+ cpu_create_file_slow/1, unicode/1]).
%% Other exports
-export([create_file_slow/2]).
@@ -59,7 +59,7 @@ all() ->
false ->
[stack_seq, tail_seq, create_file_slow, spawn_simple,
imm_tail_seq, imm_create_file_slow, imm_compile,
- cpu_create_file_slow]
+ cpu_create_file_slow, unicode]
end.
@@ -533,6 +533,17 @@ cpu_create_file_slow(Config) when is_list(Config) ->
TestResult.
+unicode(Config) when is_list(Config) ->
+ DataDir = proplists:get_value(data_dir, Config),
+ SourceFile = filename:join(DataDir, "fprof_unicode.erl"),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ AnalysisFile = filename:join(PrivDir, "fprof_unicode.analysis"),
+ {ok, fprof_unicode} = compile:file(SourceFile, [{outdir, PrivDir}]),
+ true = code:add_path(PrivDir),
+ fprof:apply(fprof_unicode, t, []),
+ ok = fprof:profile(dump, AnalysisFile),
+ ok = fprof:analyse(dest, AnalysisFile).
+
%%%---------------------------------------------------------------------
%%% Functions to test
%%%---------------------------------------------------------------------