diff options
author | Siri Hansen <[email protected]> | 2017-03-09 17:55:17 +0100 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2017-04-12 11:09:43 +0200 |
commit | 2a0986a613f87f942d260c9b1a4f8552ef66ab12 (patch) | |
tree | 73d1bb643a0662ba16f766c276d34a4a63714b57 /lib | |
parent | 55916696a0bb867cbe55fc042744d8e03258db05 (diff) | |
download | otp-2a0986a613f87f942d260c9b1a4f8552ef66ab12.tar.gz otp-2a0986a613f87f942d260c9b1a4f8552ef66ab12.tar.bz2 otp-2a0986a613f87f942d260c9b1a4f8552ef66ab12.zip |
[ct] Scale timetraps when running valgrind
Diffstat (limited to 'lib')
-rw-r--r-- | lib/common_test/src/test_server.erl | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/common_test/src/test_server.erl b/lib/common_test/src/test_server.erl index be49191f2e..0256206e59 100644 --- a/lib/common_test/src/test_server.erl +++ b/lib/common_test/src/test_server.erl @@ -359,10 +359,10 @@ stick_all_sticky(Node,Sticky) -> %% cover. run_test_case_apply({Mod,Func,Args,Name,RunInit,TimetrapData}) -> - case os:getenv("TS_RUN_VALGRIND") of + case is_valgrind() of false -> ok; - _ -> + true -> os:putenv("VALGRIND_LOGFILE_INFIX",atom_to_list(Mod)++"."++ atom_to_list(Func)++"-") end, @@ -1827,7 +1827,8 @@ timetrap_scale_factor() -> { 2, fun() -> has_lock_checking() end}, { 3, fun() -> has_superfluous_schedulers() end}, { 6, fun() -> is_debug() end}, - {10, fun() -> is_cover() end} + {10, fun() -> is_cover() end}, + {10, fun() -> is_valgrind() end} ]). timetrap_scale_factor(Scales) -> @@ -2729,6 +2730,16 @@ is_commercial() -> _ -> true end. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% is_valgrind() -> boolean() +%% +%% Returns true if valgrind is running, else false +is_valgrind() -> + case os:getenv("TS_RUN_VALGRIND") of + false -> false; + _ -> true + end. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% Apply given function and reply to caller or proxy. |