aboutsummaryrefslogtreecommitdiffstats
path: root/test/core_app.mk
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-09-11 11:04:36 +0200
committerLoïc Hoguin <[email protected]>2015-09-11 11:04:36 +0200
commitcc740af955e0c12160ee4df2d98a753b30023ec6 (patch)
treed2536382dc70e368eac82584fb7abd1817d3ad0a /test/core_app.mk
parentdb7035bcfb0d6662fe70b9976f6f80fe5fcb446c (diff)
downloaderlang.mk-cc740af955e0c12160ee4df2d98a753b30023ec6.tar.gz
erlang.mk-cc740af955e0c12160ee4df2d98a753b30023ec6.tar.bz2
erlang.mk-cc740af955e0c12160ee4df2d98a753b30023ec6.zip
Add a test for ERLC_EXCLUDE
Diffstat (limited to 'test/core_app.mk')
-rw-r--r--test/core_app.mk30
1 files changed, 29 insertions, 1 deletions
diff --git a/test/core_app.mk b/test/core_app.mk
index a091554..a782e65 100644
--- a/test/core_app.mk
+++ b/test/core_app.mk
@@ -1,6 +1,6 @@
# Core: Building applications.
-CORE_APP_CASES = asn1 erlc-opts erlc-opts-filter error generate-erl generate-erl-include generate-erl-prepend hrl hrl-recursive mib no-app no-makedep xrl xrl-include yrl yrl-include
+CORE_APP_CASES = asn1 erlc-exclude erlc-opts erlc-opts-filter error generate-erl generate-erl-include generate-erl-prepend hrl hrl-recursive mib no-app no-makedep xrl xrl-include yrl yrl-include
CORE_APP_TARGETS = $(addprefix core-app-,$(CORE_APP_CASES))
CORE_APP_CLEAN_TARGETS = $(addprefix clean-,$(CORE_APP_TARGETS))
@@ -130,6 +130,34 @@ core-app-asn1: build clean-core-app-asn1
[{module, M} = code:load_file(M) || M <- Mods], \
halt()"
+core-app-erlc-exclude: build clean-core-app-erlc-exclude
+
+ $i "Bootstrap a new OTP library named $(APP)"
+ $t mkdir $(APP)/
+ $t cp ../erlang.mk $(APP)/
+ $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v
+
+ $i "Generate .erl files"
+ $t echo "-module(boy)." > $(APP)/src/boy.erl
+ $t echo "-module(girl)." > $(APP)/src/girl.erl
+
+ $i "Exclude boy.erl from the compilation"
+ $t echo "ERLC_EXCLUDE = boy" >> $(APP)/Makefile
+
+ $i "Build the application"
+ $t $(MAKE) -C $(APP) $v
+
+ $i "Check that boy.erl was not compiled"
+ $t test ! -e $(APP)/ebin/boy.beam
+
+ $i "Check that the application was compiled correctly (without boy.erl)"
+ $t $(ERL) -pa $(APP)/ebin/ -eval " \
+ ok = application:start($(APP)), \
+ {ok, Mods = [girl]} \
+ = application:get_key($(APP), modules), \
+ [{module, M} = code:load_file(M) || M <- Mods], \
+ halt()"
+
core-app-erlc-opts: build clean-core-app-erlc-opts
$i "Bootstrap a new OTP library named $(APP)"