aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-11-28 14:43:18 +0100
committerLoïc Hoguin <[email protected]>2018-11-28 14:43:18 +0100
commitc0e062aafae99877ccb907d95a5c98ce4da62779 (patch)
treef4122a5cafdebb439fbbd341b23851cb72c3132c /test
parentbe9ab3da2417057ca311ce44304c04739ac6475e (diff)
downloaderlang.mk-c0e062aafae99877ccb907d95a5c98ce4da62779.tar.gz
erlang.mk-c0e062aafae99877ccb907d95a5c98ce4da62779.tar.bz2
erlang.mk-c0e062aafae99877ccb907d95a5c98ce4da62779.zip
Fix asn1 compilation with the +maps option
When this option is used no include file is generated. Therefore don't error out if no include file can be found.
Diffstat (limited to 'test')
-rw-r--r--test/core_app.mk38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/core_app.mk b/test/core_app.mk
index c7eb8fb..953603b 100644
--- a/test/core_app.mk
+++ b/test/core_app.mk
@@ -163,6 +163,44 @@ endif
true = lists:member({record_name_prefix, \"FOO-\"}, Opts), \
halt()"
+core-app-asn1-maps: build clean
+
+ $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 "Set ERLC_ASN1_OPTS = +maps in the Makefile"
+ $t perl -ni.bak -e 'print;if ($$.==1) {print "ERLC_ASN1_OPTS = +maps\n"}' $(APP)/Makefile
+
+ $i "Download .asn1 files from Erlang/OTP"
+ $t mkdir $(APP)/asn1/
+ $t curl -s -o $(APP)/asn1/CAP.asn1 $(OTP_MASTER)/lib/asn1/test/asn1_SUITE_data/CAP.asn1
+ $t curl -s -o $(APP)/asn1/Def.asn1 $(OTP_MASTER)/lib/asn1/test/asn1_SUITE_data/Def.asn1
+
+ $i "Build the application"
+ $t $(MAKE) -C $(APP) $v
+
+ $i "Check that all compiled files exist"
+ $t test -f $(APP)/$(APP).d
+ $t test -f $(APP)/ebin/$(APP).app
+ $t test -f $(APP)/ebin/CAP.beam
+ $t test -f $(APP)/ebin/Def.beam
+ $t test -f $(APP)/include/CAP.asn1db
+ $t ! test -e $(APP)/include/CAP.hrl
+ $t test -f $(APP)/include/Def.asn1db
+ $t ! test -e $(APP)/include/Def.hrl
+ $t test -f $(APP)/src/CAP.erl
+ $t test -f $(APP)/src/Def.erl
+
+ $i "Check that the application was compiled correctly"
+ $t $(ERL) -pa $(APP)/ebin/ -eval " \
+ ok = application:start($(APP)), \
+ {ok, Mods = ['CAP', 'Def']} \
+ = application:get_key($(APP), modules), \
+ [{module, M} = code:load_file(M) || M <- Mods], \
+ halt()"
+
core-app-auto-git-id: build clean
$i "Bootstrap a new OTP library named $(APP)"