diff options
author | Björn Gustavsson <[email protected]> | 2012-10-19 12:07:01 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2012-10-23 11:17:47 +0200 |
commit | c4375a62cfaabfd8de757f59714623ba1a8cb915 (patch) | |
tree | 5e5a79566f4e87b430d3d3e5cceb0c908c71af0b /lib/compiler/test/test_lib.erl | |
parent | 5f3a7727464522da88d07a3012aa87b8703e3f3a (diff) | |
download | otp-c4375a62cfaabfd8de757f59714623ba1a8cb915.tar.gz otp-c4375a62cfaabfd8de757f59714623ba1a8cb915.tar.bz2 otp-c4375a62cfaabfd8de757f59714623ba1a8cb915.zip |
compiler: Run testcases in parallel
Run testcases in parallel will make the test suite run slightly
faster. Another reason for this change is that we want more testing
of parallel testcase support in common_test.
Diffstat (limited to 'lib/compiler/test/test_lib.erl')
-rw-r--r-- | lib/compiler/test/test_lib.erl | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/compiler/test/test_lib.erl b/lib/compiler/test/test_lib.erl index 2295592a38..996c369705 100644 --- a/lib/compiler/test/test_lib.erl +++ b/lib/compiler/test/test_lib.erl @@ -20,7 +20,8 @@ -include("test_server.hrl"). -compile({no_auto_import,[binary_part/2]}). --export([recompile/1,opt_opts/1,get_data_dir/1,smoke_disasm/1,p_run/2,binary_part/2]). +-export([recompile/1,parallel/0,uniq/0,opt_opts/1,get_data_dir/1, + smoke_disasm/1,p_run/2,binary_part/2]). recompile(Mod) when is_atom(Mod) -> case whereis(cover_server) of @@ -43,6 +44,18 @@ smoke_disasm(File) when is_list(File) -> Res = beam_disasm:file(File), {beam_file,_Mod} = {element(1, Res),element(2, Res)}. +parallel() -> + case ?t:is_cover() orelse erlang:system_info(schedulers) =:= 1 of + true -> []; + false -> [parallel] + end. + +uniq() -> + U0 = erlang:ref_to_list(make_ref()), + U1 = re:replace(U0, "^#Ref", ""), + U = re:replace(U1, "[^[A-Za-z0-9_]+", "_", [global]), + re:replace(U, "_*$", "", [{return,list}]). + %% Retrieve the "interesting" compiler options (options for optimization %% and compatibility) for the given module. |