aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/test/sanity_SUITE_data
diff options
context:
space:
mode:
authorKostis Sagonas <[email protected]>2014-03-04 14:05:49 +0100
committerKostis Sagonas <[email protected]>2015-12-16 22:08:32 +0100
commit6a645e07a02f9adda9b9534214e699ad8f30a15f (patch)
tree204668b974388eeb551ec14a4e52c7ee535acb92 /lib/hipe/test/sanity_SUITE_data
parent9fd2f21c38944c8a605020d6662bb5935c5bbee2 (diff)
downloadotp-6a645e07a02f9adda9b9534214e699ad8f30a15f.tar.gz
otp-6a645e07a02f9adda9b9534214e699ad8f30a15f.tar.bz2
otp-6a645e07a02f9adda9b9534214e699ad8f30a15f.zip
More basic tests
and some tests that the HiPE compiler is not causing trouble
Diffstat (limited to 'lib/hipe/test/sanity_SUITE_data')
-rw-r--r--lib/hipe/test/sanity_SUITE_data/sanity_comp_timeout.erl26
-rw-r--r--lib/hipe/test/sanity_SUITE_data/sanity_no_zombies.erl19
2 files changed, 45 insertions, 0 deletions
diff --git a/lib/hipe/test/sanity_SUITE_data/sanity_comp_timeout.erl b/lib/hipe/test/sanity_SUITE_data/sanity_comp_timeout.erl
new file mode 100644
index 0000000000..bee38fd87a
--- /dev/null
+++ b/lib/hipe/test/sanity_SUITE_data/sanity_comp_timeout.erl
@@ -0,0 +1,26 @@
+%%% -*- erlang-indent-level: 2 -*-
+%%%----------------------------------------------------------------------
+%%% Author: Kostis Sagonas
+%%%
+%%% Tests that when the native code compilation times out or gets killed
+%%% for some other reason, the parent process does not also get killed.
+%%%
+%%% Problem discovered by Bjorn G. on 1/12/2003 and fixed by Kostis.
+%%%----------------------------------------------------------------------
+
+-module(sanity_comp_timeout).
+
+-export([test/0]).
+
+test() ->
+ ok = write_dummy_mod(),
+ error_logger:tty(false), % disable printouts of error reports
+ Self = self(), % get the parent process
+ c:c(dummy_mod, [native, {hipe, [{timeout, 1}]}]), % This will kill the process
+ Self = self(), % make sure the parent process stays the same
+ ok.
+
+write_dummy_mod() ->
+ Prog = <<"-module(dummy_mod).\n-export([test/0]).\ntest() -> ok.\n">>,
+ ok = file:write_file("dummy_mod.erl", Prog).
+
diff --git a/lib/hipe/test/sanity_SUITE_data/sanity_no_zombies.erl b/lib/hipe/test/sanity_SUITE_data/sanity_no_zombies.erl
new file mode 100644
index 0000000000..f9f9951de2
--- /dev/null
+++ b/lib/hipe/test/sanity_SUITE_data/sanity_no_zombies.erl
@@ -0,0 +1,19 @@
+%%% -*- erlang-indent-level: 2 -*-
+%%%----------------------------------------------------------------------
+%%% Author: Per Gustafsson
+%%%
+%%% Checks that HiPE's concurrent compilation does not leave any zombie
+%%% processes around after compilation has finished.
+%%%
+%%% This was a bug reported on erlang-bugs (Oct 25, 2007).
+%%%----------------------------------------------------------------------
+
+-module(sanity_no_zombies).
+
+-export([test/0]).
+
+test() ->
+ L = length(processes()),
+ hipe:c(?MODULE, [concurrent_comp]), % force concurrent compilation
+ L = length(processes()),
+ ok.