aboutsummaryrefslogtreecommitdiffstats
path: root/test/rlx_test_utils.erl
diff options
context:
space:
mode:
authorLuis Rascao <[email protected]>2016-09-27 19:48:13 +0100
committerLuis Rascao <[email protected]>2016-09-27 23:08:07 +0100
commit03b8b273e972ad1cb2b4a5e4a68a7c2ca4a29640 (patch)
tree360d70f54cd6095bcc94ab5ab1dedad22cd20724 /test/rlx_test_utils.erl
parentb4c4c47afbc677d24e45134530d25f0e687cdca6 (diff)
downloadrelx-03b8b273e972ad1cb2b4a5e4a68a7c2ca4a29640.tar.gz
relx-03b8b273e972ad1cb2b4a5e4a68a7c2ca4a29640.tar.bz2
relx-03b8b273e972ad1cb2b4a5e4a68a7c2ca4a29640.zip
Add test coverage for the extended bin script
Diffstat (limited to 'test/rlx_test_utils.erl')
-rw-r--r--test/rlx_test_utils.erl16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/rlx_test_utils.erl b/test/rlx_test_utils.erl
index 279a887..2e6045f 100644
--- a/test/rlx_test_utils.erl
+++ b/test/rlx_test_utils.erl
@@ -80,6 +80,13 @@ test_template_contents() ->
"{prop1, \"{{prop1}}\"}.\n"
"{prop2, {{prop2}}}.\n".
+escript_contents() ->
+ "#!/usr/bin/env escript\n"
+ "\n"
+ "main(_Args) ->\n"
+ "io:format(\"~s\n\",\n"
+ " [os:getenv(\"RELEASE_ROOT_DIR\")]).\n".
+
-ifdef(rand_module).
random_uniform(N) ->
rand:uniform(N).
@@ -88,3 +95,12 @@ random_uniform(N) ->
random:seed(os:timestamp()),
random:uniform(N).
-endif.
+
+list_to_term(String) ->
+ {ok, T, _} = erl_scan:string(String++"."),
+ case erl_parse:parse_term(T) of
+ {ok, Term} ->
+ Term;
+ {error, Error} ->
+ Error
+ end.