aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2017-10-02 17:09:50 +0200
committerDan Gudmundsson <[email protected]>2017-11-29 13:17:11 +0100
commit1ecdeb93de260fcd31a9e7032e404b92d206e50f (patch)
tree821c0c944d23504118d4b220d07099b2637d79dc /lib/stdlib/test
parent56eecdc8d0a0ebe7eb6b6d180e1854a72ddf82ac (diff)
downloadotp-1ecdeb93de260fcd31a9e7032e404b92d206e50f.tar.gz
otp-1ecdeb93de260fcd31a9e7032e404b92d206e50f.tar.bz2
otp-1ecdeb93de260fcd31a9e7032e404b92d206e50f.zip
stdlib: Minor unicode_util opts
Exit early for Latin-1
Diffstat (limited to 'lib/stdlib/test')
-rw-r--r--lib/stdlib/test/string_SUITE.erl16
-rw-r--r--lib/stdlib/test/unicode_util_SUITE.erl2
2 files changed, 9 insertions, 9 deletions
diff --git a/lib/stdlib/test/string_SUITE.erl b/lib/stdlib/test/string_SUITE.erl
index 90f980c0e5..3e50a0e3c1 100644
--- a/lib/stdlib/test/string_SUITE.erl
+++ b/lib/stdlib/test/string_SUITE.erl
@@ -92,7 +92,7 @@ end_per_testcase(_Case, _Config) ->
ok.
debug() ->
- Config = [{data_dir, ?MODULE_STRING++"_data"}],
+ Config = [{data_dir, "./" ++ ?MODULE_STRING++"_data"}],
[io:format("~p:~p~n",[Test,?MODULE:Test(Config)]) ||
{_,Tests} <- groups(), Test <- Tests].
@@ -717,19 +717,19 @@ meas(Config) ->
{_,{_,Scale}} when Scale > 1 ->
{skip,{will_not_run_in_debug,Scale}};
_ -> % No scaling
- DataDir = proplists:get_value(data_dir, Config),
- TestDir = filename:dirname(string:trim(DataDir, trailing, "/")),
- do_measure(TestDir)
+ DataDir0 = proplists:get_value(data_dir, Config),
+ DataDir = filename:join(lists:droplast(filename:split(DataDir0))),
+ do_measure(DataDir)
end.
-do_measure(TestDir) ->
- File = filename:join(TestDir, ?MODULE_STRING ++ ".erl"),
+do_measure(DataDir) ->
+ File = filename:join([DataDir,"unicode_util_SUITE_data","NormalizationTest.txt"]),
io:format("File ~s ",[File]),
{ok, Bin} = file:read_file(File),
io:format("~p~n",[byte_size(Bin)]),
Do = fun(Name, Func, Mode) ->
{N, Mean, Stddev, _} = time_func(Func, Mode, Bin),
- io:format("~10w ~6w ~6.2fms ±~4.2fms #~.2w gc included~n",
+ io:format("~10w ~6w ~6.2fms ±~5.2fms #~.2w gc included~n",
[Name, Mode, Mean/1000, Stddev/1000, N])
end,
io:format("----------------------~n"),
@@ -947,7 +947,7 @@ time_func(Fun, Mode, Bin) ->
end),
receive {Pid,Msg} -> Msg end.
-time_func(N,Sum,SumSq, Fun, Str, _) when N < 50 ->
+time_func(N,Sum,SumSq, Fun, Str, _) when N < 20 ->
{Time, Res} = timer:tc(fun() -> Fun(Str) end),
time_func(N+1,Sum+Time,SumSq+Time*Time, Fun, Str, Res);
time_func(N,Sum,SumSq, _, _, Res) ->
diff --git a/lib/stdlib/test/unicode_util_SUITE.erl b/lib/stdlib/test/unicode_util_SUITE.erl
index 03c24c7027..f23e6b8b9a 100644
--- a/lib/stdlib/test/unicode_util_SUITE.erl
+++ b/lib/stdlib/test/unicode_util_SUITE.erl
@@ -312,7 +312,7 @@ get(_) ->
count(Config) ->
ct:timetrap({minutes,5}),
case ct:get_timetrap_info() of
- {_,{_,Scale}} ->
+ {_,{_,Scale}} when Scale > 1 ->
{skip,{measurments_skipped_debug,Scale}};
_ -> % No scaling
do_measure(Config)