aboutsummaryrefslogtreecommitdiffstats
path: root/erts/test/ethread_SUITE.erl
diff options
context:
space:
mode:
Diffstat (limited to 'erts/test/ethread_SUITE.erl')
-rw-r--r--erts/test/ethread_SUITE.erl75
1 files changed, 41 insertions, 34 deletions
diff --git a/erts/test/ethread_SUITE.erl b/erts/test/ethread_SUITE.erl
index 4206bebfe7..5bb5aed3ed 100644
--- a/erts/test/ethread_SUITE.erl
+++ b/erts/test/ethread_SUITE.erl
@@ -68,9 +68,6 @@ tests() ->
atomic,
dw_atomic_massage].
-all(doc) -> [];
-all(suite) -> tests().
-
suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
@@ -125,35 +122,37 @@ try_lock_mutex(suite) ->
try_lock_mutex(Config) ->
run_case(Config, "try_lock_mutex", "").
-wd_dispatch(P) ->
- receive
- bye ->
- ?line true = port_command(P, "-1 "),
- ?line bye;
- L when is_list(L) ->
- ?line true = port_command(P, L),
- ?line wd_dispatch(P)
- end.
-
-watchdog(Port) ->
- ?line process_flag(priority, max),
- ?line receive after 500 -> ok end,
-
- ?line random:seed(),
- ?line true = port_command(Port, "0 "),
- ?line lists:foreach(fun (T) ->
- erlang:send_after(T,
- self(),
- integer_to_list(T)
- ++ " ")
- end,
- lists:usort(lists:map(fun (_) ->
- random:uniform(4500)+500
- end,
- lists:duplicate(50,0)))),
- ?line erlang:send_after(5100, self(), bye),
-
- wd_dispatch(Port).
+%% Remove dead code?
+
+% wd_dispatch(P) ->
+% receive
+% bye ->
+% ?line true = port_command(P, "-1 "),
+% ?line bye;
+% L when is_list(L) ->
+% ?line true = port_command(P, L),
+% ?line wd_dispatch(P)
+% end.
+%
+% watchdog(Port) ->
+% ?line process_flag(priority, max),
+% ?line receive after 500 -> ok end,
+%
+% ?line random:seed(),
+% ?line true = port_command(Port, "0 "),
+% ?line lists:foreach(fun (T) ->
+% erlang:send_after(T,
+% self(),
+% integer_to_list(T)
+% ++ " ")
+% end,
+% lists:usort(lists:map(fun (_) ->
+% random:uniform(4500)+500
+% end,
+% lists:duplicate(50,0)))),
+% ?line erlang:send_after(5100, self(), bye),
+%
+% wd_dispatch(Port).
cond_wait(doc) ->
["Tests ethr_cond_wait with ethr_cond_signal and ethr_cond_broadcast."];
@@ -174,7 +173,15 @@ detached_thread(doc) ->
detached_thread(suite) ->
[];
detached_thread(Config) ->
- run_case(Config, "detached_thread", "").
+ case {os:type(), os:version()} of
+ {{unix,darwin}, {9, _, _}} ->
+ %% For some reason pthread_create() crashes when more
+ %% threads cannot be created, instead of returning an
+ %% error code on our MacOS X Leopard machine...
+ {skipped, "MacOS X Leopard cannot cope with this test..."};
+ _ ->
+ run_case(Config, "detached_thread", "")
+ end.
max_threads(doc) ->
["Tests maximum number of threads."];
@@ -299,7 +306,7 @@ read_case_data(Port, TestCase) ->
{Port, {data, {eol, [?PID_MARKER | PidStr]}}} ->
?line ?t:format("Port program pid: ~s~n", [PidStr]),
?line CaseProc = self(),
- ?line list_to_integer(PidStr), % Sanity check
+ ?line _ = list_to_integer(PidStr), % Sanity check
spawn_opt(fun () ->
port_prog_killer(CaseProc, PidStr)
end,