summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2015-09-25 18:14:57 -0400
committerFred Hebert <mononcqc@ferd.ca>2015-09-25 18:14:57 -0400
commitd0bcd95813cfa6f76fdc26f0703600f122174443 (patch)
tree31357d465f7446190a5a91d1467139c08cb96909 /test
parent9cd557b6ed0235daeca077072af05b293c30d818 (diff)
parent9d82215296205d2d30c152c7d7c6fcb8e4a92443 (diff)
Merge pull request #826 from talentdeficit/expose_more_sources
add an export to allow specifing arbitrary extra erl files to be compiled
Diffstat (limited to 'test')
-rw-r--r--test/rebar_compile_SUITE.erl33
1 files changed, 31 insertions, 2 deletions
diff --git a/test/rebar_compile_SUITE.erl b/test/rebar_compile_SUITE.erl
index f726943..7750924 100644
--- a/test/rebar_compile_SUITE.erl
+++ b/test/rebar_compile_SUITE.erl
@@ -25,7 +25,8 @@
only_default_transitive_deps/1,
clean_all/1,
override_deps/1,
- profile_override_deps/1]).
+ profile_override_deps/1,
+ build_more_sources/1]).
-include_lib("common_test/include/ct.hrl").
-include_lib("eunit/include/eunit.hrl").
@@ -54,7 +55,7 @@ all() ->
dont_recompile_yrl_or_xrl, delete_beam_if_source_deleted,
deps_in_path, checkout_priority, highest_version_of_pkg_dep,
parse_transform_test, erl_first_files_test, mib_test, only_default_transitive_deps,
- clean_all, override_deps, profile_override_deps].
+ clean_all, override_deps, profile_override_deps, build_more_sources].
build_basic_app(Config) ->
AppDir = ?config(apps, Config),
@@ -631,3 +632,31 @@ profile_override_deps(Config) ->
Config, RebarConfig, ["as", "a", "compile"],
{ok, [{dep, "some_dep"},{dep_not_exist, "other_dep"}]}
).
+
+build_more_sources(Config) ->
+ AppDir = ?config(apps, Config),
+
+ ASrc = <<"-module(a_src).\n-export([ok/0]).\nok() -> ok.\n">>,
+ BSrc = <<"-module(b_src).\n-export([ok/0]).\nok() -> ok.\n">>,
+ CSrc = <<"-module(c_src).\n-export([ok/0]).\nok() -> ok.\n">>,
+
+ ok = filelib:ensure_dir(filename:join([AppDir, "more", "dummy"])),
+ ok = filelib:ensure_dir(filename:join([AppDir, "ebin", "dummy"])),
+ ok = file:write_file(filename:join([AppDir, "more", "a_src.erl"]), ASrc),
+ ok = file:write_file(filename:join([AppDir, "more", "b_src.erl"]), BSrc),
+ ok = file:write_file(filename:join([AppDir, "more", "c_src.erl"]), CSrc),
+
+ Opts = dict:new(),
+
+ rebar_erlc_compiler:compile(Opts,
+ filename:join([AppDir, "more"]),
+ filename:join([AppDir, "ebin"]),
+ [filename:join([AppDir, "more", "a_src.erl"]),
+ filename:join([AppDir, "more", "b_src.erl"]),
+ filename:join([AppDir, "more", "c_src.erl"])]),
+
+ EbinDir = filename:join([AppDir, "ebin"]),
+ true = filelib:is_file(filename:join([EbinDir, "a_src.beam"])),
+ true = filelib:is_file(filename:join([EbinDir, "b_src.beam"])),
+ true = filelib:is_file(filename:join([EbinDir, "c_src.beam"])).
+