aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sasl/test
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2013-11-29 09:58:26 +0100
committerDan Gudmundsson <[email protected]>2013-11-29 09:58:26 +0100
commit423d37395076528866c4b689c0f1e9b72dae58e1 (patch)
treeb7e8a58df2c8c380d10e275102c07fa737d24908 /lib/sasl/test
parenta4565bd7d6e8362b3ca1ff0caedf7407e81d67cb (diff)
parent0279799e4f3d2404f657863d04d8c1d6f6c08985 (diff)
downloadotp-423d37395076528866c4b689c0f1e9b72dae58e1.tar.gz
otp-423d37395076528866c4b689c0f1e9b72dae58e1.tar.bz2
otp-423d37395076528866c4b689c0f1e9b72dae58e1.zip
Merge branch 'maint'
Conflicts: erts/etc/win32/Install.c
Diffstat (limited to 'lib/sasl/test')
-rw-r--r--lib/sasl/test/release_handler_SUITE.erl33
-rw-r--r--lib/sasl/test/systools_SUITE.erl32
2 files changed, 63 insertions, 2 deletions
diff --git a/lib/sasl/test/release_handler_SUITE.erl b/lib/sasl/test/release_handler_SUITE.erl
index cb82fdd060..5293381af0 100644
--- a/lib/sasl/test/release_handler_SUITE.erl
+++ b/lib/sasl/test/release_handler_SUITE.erl
@@ -65,7 +65,7 @@ cases() ->
supervisor_which_children_timeout,
release_handler_which_releases, install_release_syntax_check,
upgrade_supervisor, upgrade_supervisor_fail, otp_9864,
- otp_10463_upgrade_script_regexp].
+ otp_10463_upgrade_script_regexp, no_dot_erlang].
groups() ->
[{release,[],
@@ -1780,6 +1780,37 @@ otp_10463_upgrade_script_regexp(_Config) ->
release_handler:upgrade_script(kernel,code:lib_dir(kernel)),
ok.
+no_dot_erlang(Conf) ->
+ PrivDir = priv_dir(Conf),
+ {ok, OrigWd} = file:get_cwd(),
+ try
+ ok = file:set_cwd(PrivDir),
+
+ Erl = filename:join([code:root_dir(),"bin","erl"]),
+ Args = " -noinput -run io put_chars \"TESTOK\" -run erlang halt",
+ ok = file:write_file(".erlang", <<"io:put_chars(\"DOT_ERLANG_READ\\n\").\n">>),
+
+ case os:cmd(Erl ++ Args) of
+ "DOT_ERLANG_READ" ++ _ -> ok;
+ Other1 ->
+ io:format("Failed: ~s~n",[Erl ++ Args]),
+ io:format("Expected: ~s ++ _~n",["DOT_ERLANG_READ "]),
+ io:format("Got: ~s~n",[Other1]),
+ exit(failed_to_start, test_error)
+ end,
+ NO_DOT_ERL = " -boot no_dot_erlang",
+ case os:cmd(Erl ++ NO_DOT_ERL ++ Args) of
+ "TESTOK" ++ _ -> ok;
+ Other2 ->
+ io:format("Failed: ~s~n",[Erl ++ Args]),
+ io:format("Expected: ~s~n",["TESTOK"]),
+ io:format("Got: ~s~n",[Other2]),
+ exit(failed_to_start, no_dot_erlang)
+ end
+ after
+ _ = file:delete(".erlang"),
+ ok = file:set_cwd(OrigWd)
+ end.
%%%=================================================================
%%% Misceleaneous functions
diff --git a/lib/sasl/test/systools_SUITE.erl b/lib/sasl/test/systools_SUITE.erl
index f2569bb616..e3f6933476 100644
--- a/lib/sasl/test/systools_SUITE.erl
+++ b/lib/sasl/test/systools_SUITE.erl
@@ -43,6 +43,7 @@
-export([script_options/1, normal_script/1, unicode_script/1,
unicode_script/2, no_mod_vsn_script/1,
wildcard_script/1, variable_script/1, no_sasl_script/1,
+ no_dot_erlang_script/1,
abnormal_script/1, src_tests_script/1, crazy_script/1,
included_script/1, included_override_script/1,
included_fail_script/1, included_bug_script/1, exref_script/1,
@@ -79,7 +80,8 @@ groups() ->
[{script, [],
[script_options, normal_script, unicode_script, no_mod_vsn_script,
wildcard_script, variable_script, abnormal_script,
- no_sasl_script, src_tests_script, crazy_script,
+ no_sasl_script, no_dot_erlang_script,
+ src_tests_script, crazy_script,
included_script, included_override_script,
included_fail_script, included_bug_script, exref_script,
otp_3065_circular_dependenies, included_and_used_sort_script]},
@@ -457,6 +459,34 @@ no_sasl_script(Config) when is_list(Config) ->
ok = file:set_cwd(OldDir),
ok.
+%% make_script: Create script with no_dot_erlang. Check script contents.
+no_dot_erlang_script(Config) when is_list(Config) ->
+ {ok, OldDir} = file:get_cwd(),
+
+ {LatestDir, LatestName} = create_script(latest1_no_sasl,Config),
+
+ DataDir = filename:absname(?copydir),
+ LibDir = [fname([DataDir, d_normal, lib])],
+ P = [fname([LibDir, '*', ebin]),
+ fname([DataDir, lib, kernel, ebin]),
+ fname([DataDir, lib, stdlib, ebin]),
+ fname([DataDir, lib, sasl, ebin])],
+
+ ok = file:set_cwd(LatestDir),
+
+ {ok, _ , []} =
+ systools:make_script(LatestName,[{path, P},silent, no_warn_sasl]),
+ {ok, [{_, _, LoadDotErlang}]} = read_script_file(LatestName),
+ [erlangrc] = [E || {apply, {c, E, []}} <- LoadDotErlang],
+
+ {ok, _ , []} =
+ systools:make_script(LatestName,[{path, P},silent, no_warn_sasl, no_dot_erlang]),
+ {ok, [{_, _, DoNotLoadDotErlang}]} = read_script_file(LatestName),
+ [] = [E || {apply, {c, E, []}} <- DoNotLoadDotErlang],
+
+ ok = file:set_cwd(OldDir),
+ ok.
+
%% make_script: Do not check date of object file or that source code
%% can be found.