aboutsummaryrefslogtreecommitdiffstats
path: root/test/plugin_dialyzer.mk
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2016-09-09 18:17:07 +0200
committerLoïc Hoguin <[email protected]>2016-09-09 18:17:07 +0200
commit8a50aa67ef915e8c33429f2cc2617c7874cd3018 (patch)
treefbdd4394f6f8a5a8eac05d5c16568f07e107f035 /test/plugin_dialyzer.mk
parent8a20b423784a7ccf223dbabe4d78daa675823664 (diff)
downloaderlang.mk-8a50aa67ef915e8c33429f2cc2617c7874cd3018.tar.gz
erlang.mk-8a50aa67ef915e8c33429f2cc2617c7874cd3018.tar.bz2
erlang.mk-8a50aa67ef915e8c33429f2cc2617c7874cd3018.zip
Add a test for using Dialyzer against BEAM files
Diffstat (limited to 'test/plugin_dialyzer.mk')
-rw-r--r--test/plugin_dialyzer.mk30
1 files changed, 29 insertions, 1 deletions
diff --git a/test/plugin_dialyzer.mk b/test/plugin_dialyzer.mk
index 3143319..946caba 100644
--- a/test/plugin_dialyzer.mk
+++ b/test/plugin_dialyzer.mk
@@ -1,6 +1,6 @@
# Dialyzer plugin.
-DIALYZER_CASES = app apps-only apps-with-local-deps check custom-plt deps erlc-opts local-deps opts plt-apps
+DIALYZER_CASES = app apps-only apps-with-local-deps beam check custom-plt deps erlc-opts local-deps opts plt-apps
DIALYZER_TARGETS = $(addprefix dialyzer-,$(DIALYZER_CASES))
ifneq ($(shell which sem 2>/dev/null),)
@@ -96,6 +96,34 @@ dialyzer-apps-with-local-deps: build clean
$i "Confirm that my_core_app was NOT included in the PLT"
$t ! dialyzer --plt_info --plt $(APP)/.$(APP).plt | grep -q my_core_app
+dialyzer-beam: build clean
+
+ $i "Bootstrap a new OTP application named $(APP)"
+ $t mkdir $(APP)/
+ $t cp ../erlang.mk $(APP)/
+ $t $(MAKE) -C $(APP) -f erlang.mk bootstrap $v
+
+ $i "Add lager to the list of dependencies"
+ $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = lager\n"}' $(APP)/Makefile
+
+ $i "Add lager_transform to ERLC_OPTS"
+ $t echo "ERLC_OPTS += +'{parse_transform, lager_transform}'" >> $(APP)/Makefile
+
+ $i "Make Dialyzer use the beam files"
+ $t echo "DIALYZER_DIRS = -r ebin" >> $(APP)/Makefile
+
+ $i "Create a module that calls lager"
+ $t printf "%s\n" \
+ "-module(use_lager)." \
+ "-export([doit/0])." \
+ "doit() -> lager:error(\"Some message\")." > $(APP)/src/use_lager.erl
+
+ $i "Build the application"
+ $t $(MAKE) -C $(APP) $v
+
+ $i "Run Dialyzer"
+ $t $(DIALYZER_MUTEX) $(MAKE) -C $(APP) dialyze $v
+
dialyzer-check: build clean
$i "Bootstrap a new OTP application named $(APP)"