From 1a1020285bbc5b457983856872f147876819b233 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Fri, 11 Sep 2015 10:24:32 +0200 Subject: Add tests for ERLC_OPTS --- test/core_app.mk | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/test/core_app.mk b/test/core_app.mk index 825fe7a..bbdec6b 100644 --- a/test/core_app.mk +++ b/test/core_app.mk @@ -1,6 +1,6 @@ # Core: Building applications. -CORE_APP_CASES = asn1 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-opts 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,33 @@ core-app-asn1: build clean-core-app-asn1 [{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)" + $t mkdir $(APP)/ + $t cp ../erlang.mk $(APP)/ + $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v + + $i "Define an empty ERLC_OPTS (without debug_info)" + $t echo "ERLC_OPTS =" >> $(APP)/Makefile + + $i "Generate .erl files" + $t echo "-module(boy)." > $(APP)/src/boy.erl + $t echo "-module(girl)." > $(APP)/src/girl.erl + + $i "Build the application" + $t $(MAKE) -C $(APP) $v + + $i "Check that the application was compiled correctly (without debug_info)" + $t $(ERL) -pa $(APP)/ebin/ -eval " \ + ok = application:start($(APP)), \ + {ok, Mods = [boy, girl]} \ + = application:get_key($(APP), modules), \ + [{module, M} = code:load_file(M) || M <- Mods], \ + false = proplists:is_defined(debug_info, proplists:get_value(options, boy:module_info(compile))), \ + false = proplists:is_defined(debug_info, proplists:get_value(options, girl:module_info(compile))), \ + halt()" + core-app-error: build clean-core-app-error $i "Bootstrap a new OTP library named $(APP)" -- cgit v1.2.3