aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2013-07-10 15:05:43 +0200
committerRickard Green <[email protected]>2013-07-10 15:05:43 +0200
commit75f57c5f9a3bd03cb16e1663d40ea98bbb3ed487 (patch)
tree9cb54d13edf3e1ee7794579c7be02893af52b3c6 /erts/emulator/test
parent903f7be44820731dd0f9989024c72ead07e90e81 (diff)
parentb5df977d74dfce0b1bb41ebcedb7f16d02477c5a (diff)
downloadotp-75f57c5f9a3bd03cb16e1663d40ea98bbb3ed487.tar.gz
otp-75f57c5f9a3bd03cb16e1663d40ea98bbb3ed487.tar.bz2
otp-75f57c5f9a3bd03cb16e1663d40ea98bbb3ed487.zip
Merge branch 'rickard/info/OTP-11196' into maint
* rickard/info/OTP-11196: Add test cases for native atomics and jump table Refuse to build SMP runtime by default without native atomics Make information about use of jump table available via system_info BIF Make ethread library information available via system_info BIF Make emulator arguments available via the system_info BIF
Diffstat (limited to 'erts/emulator/test')
-rw-r--r--erts/emulator/test/smoke_test_SUITE.erl39
1 files changed, 37 insertions, 2 deletions
diff --git a/erts/emulator/test/smoke_test_SUITE.erl b/erts/emulator/test/smoke_test_SUITE.erl
index 6f5c2080c0..10b7e16a74 100644
--- a/erts/emulator/test/smoke_test_SUITE.erl
+++ b/erts/emulator/test/smoke_test_SUITE.erl
@@ -26,14 +26,14 @@
init_per_group/2,end_per_group/2,
init_per_testcase/2, end_per_testcase/2]).
--export([boot_combo/1]).
+-export([boot_combo/1, native_atomics/1, jump_table/1]).
-define(DEFAULT_TIMEOUT, ?t:minutes(2)).
suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
- [boot_combo].
+ [boot_combo, native_atomics, jump_table].
groups() ->
[].
@@ -105,6 +105,41 @@ boot_combo(Config) when is_list(Config) ->
end)
end.
+native_atomics(Config) when is_list(Config) ->
+ NA32Key = "32-bit native atomics",
+ NA64Key = "64-bit native atomics",
+ DWNAKey = "Double word native atomics",
+ EthreadInfo = erlang:system_info(ethread_info),
+ ?t:format("~p~n", [EthreadInfo]),
+ {value,{NA32Key, NA32, _}} = lists:keysearch(NA32Key, 1, EthreadInfo),
+ {value,{NA64Key, NA64, _}} = lists:keysearch(NA64Key, 1, EthreadInfo),
+ {value,{DWNAKey, DWNA, _}} = lists:keysearch(DWNAKey, 1, EthreadInfo),
+ case {erlang:system_info(build_type), erlang:system_info(smp_support), NA32, NA64, DWNA} of
+ {opt, true, "no", "no", _} ->
+ ?t:fail(optimized_smp_runtime_without_native_atomics);
+ {_, false, "no", "no", _} ->
+ {comment, "No native atomics"};
+ _ ->
+ {comment,
+ NA32 ++ " 32-bit, "
+ ++ NA64 ++ " 64-bit, and "
+ ++ DWNA ++ " double word native atomics"}
+ end.
+
+jump_table(Config) when is_list(Config) ->
+ case erlang:system_info(beam_jump_table) of
+ true ->
+ ok;
+ false ->
+ case erlang:system_info(build_type) of
+ opt ->
+ ?t:fail(optimized_without_beam_jump_table);
+ BT ->
+ {comment, "No beam jump table, but build type is " ++ atom_to_list(BT)}
+ end
+ end.
+
+
%%%
%%% Aux functions --------------------------------------------------------------
%%%