From 918e7de543f729b6fad35c22eaeeb3fba3a4a7ba Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Tue, 19 Sep 2017 15:34:09 +0200 Subject: fprof: Make sure the receiving file can handle Unicode It is assumed that I/O devices can handle character codes greater than 255. --- lib/tools/test/fprof_SUITE.erl | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'lib/tools/test/fprof_SUITE.erl') 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 %%%--------------------------------------------------------------------- -- cgit v1.2.3