aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2014-01-22 10:10:44 +0100
committerDan Gudmundsson <[email protected]>2014-01-22 10:10:44 +0100
commitd203887853971d58a4054400a88f91bbf73b19c8 (patch)
tree7b442151bd7b6f37119096913d90f72437db0510 /lib
parent1f7e86af8b3f489253c06b2043440c11168a4654 (diff)
parentc0d320e028ce4a4b6af99ad5e20dee8ea95d6fce (diff)
downloadotp-d203887853971d58a4054400a88f91bbf73b19c8.tar.gz
otp-d203887853971d58a4054400a88f91bbf73b19c8.tar.bz2
otp-d203887853971d58a4054400a88f91bbf73b19c8.zip
Merge branch 'dgud/test_unicode/OTP-10877'
* dgud/test_unicode/OTP-10877: sasl test: Quote executable paths (can contain spaces) rt_tools: Handle unicode chars in printouts kernel: code_SUITE fix unicode option Fix (unicode) debug info in test cases stdlib: Fix format if module resides in a unicode directory Fix testing with unicode paths test_server: Fix ts write unicode in config files
Diffstat (limited to 'lib')
-rw-r--r--lib/compiler/test/compilation_SUITE.erl6
-rw-r--r--lib/kernel/test/code_SUITE.erl7
-rw-r--r--lib/runtime_tools/src/system_information.erl6
-rw-r--r--lib/sasl/test/release_handler_SUITE.erl2
-rw-r--r--lib/snmp/test/snmp_agent_test.erl10
-rw-r--r--lib/ssl/test/ssl_dist_SUITE.erl2
-rw-r--r--lib/stdlib/src/c.erl4
-rw-r--r--lib/stdlib/test/shell_SUITE.erl18
-rw-r--r--lib/syntax_tools/test/syntax_tools_SUITE.erl2
-rw-r--r--lib/test_server/src/test_server_ctrl.erl6
-rw-r--r--lib/test_server/src/ts_lib.erl2
-rw-r--r--lib/test_server/src/ts_make.erl6
-rw-r--r--lib/test_server/src/ts_run.erl6
13 files changed, 40 insertions, 37 deletions
diff --git a/lib/compiler/test/compilation_SUITE.erl b/lib/compiler/test/compilation_SUITE.erl
index 93b2fb4ea5..f7b1dbdddf 100644
--- a/lib/compiler/test/compilation_SUITE.erl
+++ b/lib/compiler/test/compilation_SUITE.erl
@@ -196,7 +196,7 @@ redundant_case_1(_) -> d.
failure(Module, Conf) ->
?line Src = filename:join(?config(data_dir, Conf), atom_to_list(Module)),
?line Out = ?config(priv_dir,Conf),
- ?line io:format("Compiling: ~s\n", [Src]),
+ ?line io:format("Compiling: ~ts\n", [Src]),
?line CompRc = compile:file(Src, [{outdir,Out},return,time]),
?line io:format("Result: ~p\n",[CompRc]),
?line case CompRc of
@@ -476,8 +476,8 @@ self_compile_node(CompilerDir, OutDir, Version, Opts) ->
ok.
compile_compiler(Files, OutDir, Version, InlineOpts) ->
- io:format("~s", [code:which(compile)]),
- io:format("Compiling ~s into ~s", [Version,OutDir]),
+ io:format("~ts", [code:which(compile)]),
+ io:format("Compiling ~s into ~ts", [Version,OutDir]),
Opts = [report,
bin_opt_info,
{outdir,OutDir},
diff --git a/lib/kernel/test/code_SUITE.erl b/lib/kernel/test/code_SUITE.erl
index 17983e972d..42b81d16b3 100644
--- a/lib/kernel/test/code_SUITE.erl
+++ b/lib/kernel/test/code_SUITE.erl
@@ -653,7 +653,7 @@ clash(Config) when is_list(Config) ->
DDir = ?config(data_dir,Config)++"clash/",
P = code:get_path(),
[TestServerPath|_] = [Path || Path <- code:get_path(),
- re:run(Path,"test_server/?$",[]) /= nomatch],
+ re:run(Path,"test_server/?$",[unicode]) /= nomatch],
%% test non-clashing entries
@@ -1527,7 +1527,10 @@ create_big_script(Config,Local) ->
Leftover <- UnloadFix,
lists:keymember(Leftover,1,InitialApplications) ],
%% Now we should have only "real" applications...
- [application:load(list_to_atom(Y)) || {match,[Y]} <- [ re:run(X,code:lib_dir()++"/"++"([^/-]*).*/ebin",[{capture,[1],list}]) || X <- code:get_path()],filter_app(Y,Local)],
+ [application:load(list_to_atom(Y))
+ || {match,[Y]} <- [re:run(X,code:lib_dir()++"/"++"([^/-]*).*/ebin",
+ [{capture,[1],list},unicode]) ||
+ X <- code:get_path()],filter_app(Y,Local)],
Apps = [ {N,V} || {N,_,V} <- application:loaded_applications()],
{ok,Fd} = file:open(Name ++ ".rel", [write]),
io:format(Fd,
diff --git a/lib/runtime_tools/src/system_information.erl b/lib/runtime_tools/src/system_information.erl
index 1d4b878d79..603b698d5e 100644
--- a/lib/runtime_tools/src/system_information.erl
+++ b/lib/runtime_tools/src/system_information.erl
@@ -280,7 +280,7 @@ print_environments([],_) ->
print_environment({_Key, false},_) -> ok;
print_environment({Key, Value},_) ->
- io:format(" - ~s = ~s~n", [Key, Value]).
+ io:format(" - ~s = ~ts~n", [Key, Value]).
print_modules_from_code(M, [Info|Ms], Opts) ->
print_module_from_code(M, Info),
@@ -292,14 +292,14 @@ print_modules_from_code(_, [], _) ->
ok.
print_module_from_code(M, {Path, [{M,ModInfo}]}) ->
- io:format(" from path \"~s\" (no application):~n", [Path]),
+ io:format(" from path \"~ts\" (no application):~n", [Path]),
io:format(" - compiler: ~s~n", [get_value([compiler], ModInfo)]),
io:format(" - md5: ~s~n", [get_value([md5], ModInfo)]),
io:format(" - native: ~w~n", [get_value([native], ModInfo)]),
io:format(" - loaded: ~w~n", [get_value([loaded], ModInfo)]),
ok;
print_module_from_code(M, {App,Vsn,Path,[{M,ModInfo}]}) ->
- io:format(" from path \"~s\" (~w-~s):~n", [Path,App,Vsn]),
+ io:format(" from path \"~ts\" (~w-~s):~n", [Path,App,Vsn]),
io:format(" - compiler: ~s~n", [get_value([compiler], ModInfo)]),
io:format(" - md5: ~s~n", [get_value([md5], ModInfo)]),
io:format(" - native: ~w~n", [get_value([native], ModInfo)]),
diff --git a/lib/sasl/test/release_handler_SUITE.erl b/lib/sasl/test/release_handler_SUITE.erl
index a3db2b23db..7e9d7c984a 100644
--- a/lib/sasl/test/release_handler_SUITE.erl
+++ b/lib/sasl/test/release_handler_SUITE.erl
@@ -1786,7 +1786,7 @@ no_dot_erlang(Conf) ->
try
ok = file:set_cwd(PrivDir),
- Erl = filename:join([code:root_dir(),"bin","erl"]),
+ Erl = "\"" ++ filename:join([code:root_dir(),"bin","erl"]) ++ "\"",
Args = " -noinput -run io put_chars \"TESTOK\" -run erlang halt",
ok = file:write_file(".erlang", <<"io:put_chars(\"DOT_ERLANG_READ\\n\").\n">>),
diff --git a/lib/snmp/test/snmp_agent_test.erl b/lib/snmp/test/snmp_agent_test.erl
index 50336fcf6e..89a6ce1253 100644
--- a/lib/snmp/test/snmp_agent_test.erl
+++ b/lib/snmp/test/snmp_agent_test.erl
@@ -1524,11 +1524,11 @@ app_info(Config) when is_list(Config) ->
false ->
"undefined"
end,
- io:format("Root dir: ~s~n"
- "SNMP: Application dir: ~s~n"
- " Application ver: ~s~n"
- "SSL: Application dir: ~s~n"
- "CRYPTO: Application dir: ~s~n",
+ io:format("Root dir: ~ts~n"
+ "SNMP: Application dir: ~ts~n"
+ " Application ver: ~ts~n"
+ "SSL: Application dir: ~ts~n"
+ "CRYPTO: Application dir: ~ts~n",
[code:root_dir(), SnmpDir, AppVsn, SslDir, CryptoDir]),
ok.
diff --git a/lib/ssl/test/ssl_dist_SUITE.erl b/lib/ssl/test/ssl_dist_SUITE.erl
index d3b523ca8c..1a1b2af8d4 100644
--- a/lib/ssl/test/ssl_dist_SUITE.erl
+++ b/lib/ssl/test/ssl_dist_SUITE.erl
@@ -324,7 +324,7 @@ start_ssl_node_raw(Name, Args) ->
[binary, {packet, 4}, {active, false}]),
{ok, ListenPort} = inet:port(LSock),
CmdLine = mk_node_cmdline(ListenPort, Name, Args),
- ?t:format("Attempting to start ssl node ~s: ~s~n", [Name, CmdLine]),
+ ?t:format("Attempting to start ssl node ~ts: ~ts~n", [Name, CmdLine]),
case open_port({spawn, CmdLine}, []) of
Port when is_port(Port) ->
unlink(Port),
diff --git a/lib/stdlib/src/c.erl b/lib/stdlib/src/c.erl
index f23b5d4fe9..c2256c0cf9 100644
--- a/lib/stdlib/src/c.erl
+++ b/lib/stdlib/src/c.erl
@@ -455,7 +455,7 @@ m() ->
foreach(fun ({Mod,File}) -> mformat(Mod, File) end, sort(code:all_loaded())).
mformat(A1, A2) ->
- format("~-20s ~s\n", [A1,A2]).
+ format("~-20s ~ts\n", [A1,A2]).
%% erlangrc(Home)
%% Try to run a ".erlang" file, first in the current directory
@@ -721,7 +721,7 @@ ls(Dir) ->
{error, enotdir} ->
ls_print([Dir]);
{error, Error} ->
- format("~s\n", [file:format_error(Error)])
+ format("~ts\n", [file:format_error(Error)])
end.
ls_print([]) -> ok;
diff --git a/lib/stdlib/test/shell_SUITE.erl b/lib/stdlib/test/shell_SUITE.erl
index 233ba0764f..692dfe0faa 100644
--- a/lib/stdlib/test/shell_SUITE.erl
+++ b/lib/stdlib/test/shell_SUITE.erl
@@ -146,7 +146,7 @@ start_restricted_from_shell(Config) when is_list(Config) ->
"test_restricted) end.">>),
?line {ok, test_restricted} =
application:get_env(stdlib, restricted_shell),
- ?line "Module" ++ _ = t(<<"begin m() end.">>),
+ ?line "Module" ++ _ = t({<<"begin m() end.">>, utf8}),
?line "exception exit: restricted shell does not allow c(foo)" =
comm_err(<<"begin c(foo) end.">>),
?line "exception exit: restricted shell does not allow init:stop()" =
@@ -225,7 +225,7 @@ start_restricted_on_command_line(Config) when is_list(Config) ->
?line {ok,Node2} = start_node(shell_suite_helper_2,
"-pa "++?config(priv_dir,Config)++
" -stdlib restricted_shell test_restricted2"),
- ?line "Module" ++ _ = t({Node2,<<"begin m() end.">>}),
+ ?line "Module" ++ _ = t({Node2,<<"begin m() end.">>, utf8}),
?line "exception exit: restricted shell does not allow c(foo)" =
comm_err({Node2,<<"begin c(foo) end.">>}),
?line "exception exit: restricted shell does not allow init:stop()" =
@@ -2927,14 +2927,14 @@ t1(Parent, {Bin,Enc}, F) ->
server_loop(S)
catch exit:R -> Parent ! {self(), R};
throw:{?MODULE,LoopReply,latin1} ->
- L0 = binary_to_list(list_to_binary(LoopReply)),
- [$\n | L1] = lists:dropwhile(fun(X) -> X =/= $\n end, L0),
- Parent ! {self(), dotify(L1)};
+ L0 = binary_to_list(list_to_binary(LoopReply)),
+ [$\n | L1] = lists:dropwhile(fun(X) -> X =/= $\n end, L0),
+ Parent ! {self(), dotify(L1)};
throw:{?MODULE,LoopReply,_Uni} ->
- Tmp = unicode:characters_to_binary(LoopReply),
- L0 = unicode:characters_to_list(Tmp),
- [$\n | L1] = lists:dropwhile(fun(X) -> X =/= $\n end, L0),
- Parent ! {self(), dotify(L1)}
+ Tmp = unicode:characters_to_binary(LoopReply),
+ L0 = unicode:characters_to_list(Tmp),
+ [$\n | L1] = lists:dropwhile(fun(X) -> X =/= $\n end, L0),
+ Parent ! {self(), dotify(L1)}
after group_leader(S#state.leader, self())
end.
diff --git a/lib/syntax_tools/test/syntax_tools_SUITE.erl b/lib/syntax_tools/test/syntax_tools_SUITE.erl
index 9eef56bddb..b673b70a95 100644
--- a/lib/syntax_tools/test/syntax_tools_SUITE.erl
+++ b/lib/syntax_tools/test/syntax_tools_SUITE.erl
@@ -73,7 +73,7 @@ print_error_markers(F, File) ->
case erl_syntax:type(F) of
error_marker ->
{L,M,Info} = erl_syntax:error_marker_info(F),
- io:format("~s:~p: ~s", [File,L,M:format_error(Info)]);
+ io:format("~ts:~p: ~s", [File,L,M:format_error(Info)]);
_ ->
ok
end.
diff --git a/lib/test_server/src/test_server_ctrl.erl b/lib/test_server/src/test_server_ctrl.erl
index 352e58f91c..e24d6ceacb 100644
--- a/lib/test_server/src/test_server_ctrl.erl
+++ b/lib/test_server/src/test_server_ctrl.erl
@@ -4840,7 +4840,7 @@ start_node(Name, Type, Options) ->
case controller_call({start_node,Name,Type,Options}, T) of
{{ok,Nodename}, Host, Cmd, Info, Warning} ->
format(minor,
- "Successfully started node ~w on ~tp with command: ~tp",
+ "Successfully started node ~w on ~tp with command: ~ts",
[Nodename, Host, Cmd]),
format(major, "=node_start ~w", [Nodename]),
case Info of
@@ -4856,7 +4856,7 @@ start_node(Name, Type, Options) ->
{ok, Nodename};
{fail,{Ret, Host, Cmd}} ->
format(minor,
- "Failed to start node ~tp on ~tp with command: ~tp~n"
+ "Failed to start node ~tp on ~tp with command: ~ts~n"
"Reason: ~p",
[Name, Host, Cmd, Ret]),
{fail,Ret};
@@ -4865,7 +4865,7 @@ start_node(Name, Type, Options) ->
Ret;
{Ret, Host, Cmd} ->
format(minor,
- "Failed to start node ~tp on ~tp with command: ~tp~n"
+ "Failed to start node ~tp on ~tp with command: ~ts~n"
"Reason: ~p",
[Name, Host, Cmd, Ret]),
Ret
diff --git a/lib/test_server/src/ts_lib.erl b/lib/test_server/src/ts_lib.erl
index 9f56f59fed..5368960446 100644
--- a/lib/test_server/src/ts_lib.erl
+++ b/lib/test_server/src/ts_lib.erl
@@ -164,7 +164,7 @@ subst_file(In, Out, Vars) ->
case file:read_file(In) of
{ok, Bin} ->
Subst = subst(b2s(Bin), Vars, []),
- case file:write_file(Out, Subst) of
+ case file:write_file(Out, unicode:characters_to_binary(Subst)) of
ok ->
ok;
{error, Reason} ->
diff --git a/lib/test_server/src/ts_make.erl b/lib/test_server/src/ts_make.erl
index f3266f5836..8727f7ebfe 100644
--- a/lib/test_server/src/ts_make.erl
+++ b/lib/test_server/src/ts_make.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -67,7 +67,7 @@ get_port_data(Port, Last0, Complete0) ->
end.
update_last([C|Rest], Line, true) ->
- io:put_chars(Line),
+ io:put_chars(list_to_binary(Line)), %% Utf-8 list to utf-8 binary
io:nl(),
update_last([C|Rest], [], false);
update_last([$\r|Rest], Result, Complete) ->
@@ -79,7 +79,7 @@ update_last([C|Rest], Result, Complete) ->
update_last([], Result, Complete) ->
{Result, Complete};
update_last(eof, Result, _) ->
- Result.
+ unicode:characters_to_list(list_to_binary(Result)).
run_make_script({win32, _}, Make, Dir, Makefile) ->
{"run_make.bat",
diff --git a/lib/test_server/src/ts_run.erl b/lib/test_server/src/ts_run.erl
index 60c9a7a4b7..d96abfc55a 100644
--- a/lib/test_server/src/ts_run.erl
+++ b/lib/test_server/src/ts_run.erl
@@ -224,7 +224,7 @@ make_command(Vars, Spec, State) ->
CrashFile = filename:join(Cwd,State#state.file ++ "_erl_crash.dump"),
case filelib:is_file(CrashFile) of
true ->
- io:format("ts_run: Deleting dump: ~s\n",[CrashFile]),
+ io:format("ts_run: Deleting dump: ~ts\n",[CrashFile]),
file:delete(CrashFile);
false ->
ok
@@ -258,8 +258,8 @@ make_command(Vars, Spec, State) ->
run_batch(Vars, _Spec, State) ->
process_flag(trap_exit, true),
Command = State#state.command ++ " -noinput -s erlang halt",
- ts_lib:progress(Vars, 1, "Command: ~s~n", [Command]),
- io:format(user, "Command: ~s~n",[Command]),
+ ts_lib:progress(Vars, 1, "Command: ~ts~n", [Command]),
+ io:format(user, "Command: ~ts~n",[Command]),
Port = open_port({spawn, Command}, [stream, in, eof]),
Timeout = 30000 * case os:getenv("TS_RUN_VALGRIND") of
false -> 1;