aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/dialyzer.mk6
-rw-r--r--test/plugin_dialyzer.mk30
2 files changed, 33 insertions, 3 deletions
diff --git a/plugins/dialyzer.mk b/plugins/dialyzer.mk
index 4454618..e7f502e 100644
--- a/plugins/dialyzer.mk
+++ b/plugins/dialyzer.mk
@@ -42,8 +42,10 @@ define filter_opts.erl
endef
$(DIALYZER_PLT): deps app
- $(verbose) dialyzer --build_plt --apps erts kernel stdlib $(PLT_APPS) $(OTP_DEPS) $(LOCAL_DEPS) \
- `test -f $(ERLANG_MK_TMP)/deps.log && cat $(ERLANG_MK_TMP)/deps.log`
+ $(eval DEPS_LOG := $(shell test -f $(ERLANG_MK_TMP)/deps.log && \
+ while read p; do test -d $$p/ebin && echo $$p/ebin; done <$(ERLANG_MK_TMP)/deps.log))
+ $(verbose) dialyzer --build_plt --apps erts kernel stdlib \
+ $(PLT_APPS) $(OTP_DEPS) $(LOCAL_DEPS) $(DEPS_LOG)
plt: $(DIALYZER_PLT)
diff --git a/test/plugin_dialyzer.mk b/test/plugin_dialyzer.mk
index af7a5f4..9a13bcd 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 beam 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 plt-ebin-only
DIALYZER_TARGETS = $(addprefix dialyzer-,$(DIALYZER_CASES))
ifneq ($(shell which sem 2>/dev/null),)
@@ -263,3 +263,31 @@ dialyzer-plt-apps: build clean
$i "Confirm that runtime_tools was included in the PLT"
$t dialyzer --plt_info --plt $(APP)/.$(APP).plt | grep -q runtime_tools
+
+dialyzer-plt-ebin-only: 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 Cowlib to the list of dependencies"
+ $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowlib\ndep_cowlib_commit = master\n"}' $(APP)/Makefile
+
+ $i "Build the application"
+ $t $(MAKE) -C $(APP) $v
+
+ $i "Run Cowlib tests to fetch autopatched dependencies"
+ $t $(MAKE) -C $(APP)/deps/cowlib tests $v
+
+ $i "Run Dialyzer"
+ $t $(DIALYZER_MUTEX) $(MAKE) -C $(APP) dialyze $v
+
+ $i "Check that the PLT file was created"
+ $t test -f $(APP)/.$(APP).plt
+
+ $i "Confirm that Cowlib was included in the PLT"
+ $t dialyzer --plt_info --plt $(APP)/.$(APP).plt | grep -q cowlib
+
+ $i "Confirm that rebar files were not included in the PLT"
+ $t ! dialyzer --plt_info --plt $(APP)/.$(APP).plt | grep -q rebar