Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions core/erlc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,9 @@ ebin/:
$(verbose) mkdir -p ebin/

define compile_erl
$(erlc_verbose) erlc -v $(if $(IS_DEP),$(filter-out -Werror,$(ERLC_OPTS)),$(ERLC_OPTS)) -o ebin/ \
-pa ebin/ -I include/ $(filter-out $(ERLC_EXCLUDE_PATHS),$(COMPILE_FIRST_PATHS) $(1))
cd /var/tmp; \
$(erlc_verbose) erlc -v $(if $(IS_DEP),$(filter-out -Werror,$(ERLC_OPTS)),$(ERLC_OPTS)) -o $(realpath ebin/) \
-pa $(realpath ebin/) $(if $(realpath include/),-I $(realpath include/)) $(realpath $(filter-out $(ERLC_EXCLUDE_PATHS),$(COMPILE_FIRST_PATHS) $(1)))
endef

ebin/$(PROJECT).app:: $(ERL_FILES) $(CORE_FILES) $(wildcard src/$(PROJECT).app.src)
Expand Down
68 changes: 67 additions & 1 deletion test/plugin_dialyzer.mk
Original file line number Diff line number Diff line change
@@ -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 plt-ebin-only
DIALYZER_CASES = app apps-only apps-with-local-deps beam check custom-plt deps erlc-opts local-deps opts plt-apps plt-ebin-only beam-fullpath src-fullpath
DIALYZER_TARGETS = $(addprefix dialyzer-,$(DIALYZER_CASES))

ifneq ($(shell which sem 2>/dev/null),)
Expand Down Expand Up @@ -291,3 +291,69 @@ dialyzer-plt-ebin-only: build clean

$i "Confirm that rebar files were not included in the PLT"
$t ! dialyzer --plt_info --plt $(APP)/.$(APP).plt | grep -q rebar

dialyzer-beam-fullpath: 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 "Create a module with a function that has no local return"
$t printf "%s\n" \
"-module(warn_me)." \
"doit() -> 1 = 2, ok." > $(APP)/src/warn_me.erl

$i "Disable warnings; our test .xrl files aren't perfect"
$t echo "DIALYZER_DIRS = -r ebin" >> $(APP)/Makefile

$i "Disable warnings; our test .xrl files aren't perfect"
$t echo "DIALYZER_OPTS += --fullpath -o dialyzer.out" >> $(APP)/Makefile

$i "Disable warnings; our test .xrl files aren't perfect"
$t echo "ERLC_OPTS=+debug_info" >> $(APP)/Makefile

$i "Build the application"
$t $(MAKE) -C $(APP) $v

$i "Confirm that Dialyzer errors out"
$t ! $(DIALYZER_MUTEX) $(MAKE) -C $(APP) dialyze $v

$i "Confirm that Dialyzer report contains fullpath"
$t grep $(APP)/src/warn_me.erl $(APP)/dialyzer.out

$i "Distclean the application"
$t $(MAKE) -C $(APP) distclean $v

$i "Check that the PLT file was removed"
$t test ! -e $(APP)/.$(APP).plt

dialyzer-src-fullpath: 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 "Create a module with a function that has no local return"
$t printf "%s\n" \
"-module(warn_me)." \
"doit() -> 1 = 2, ok." > $(APP)/src/warn_me.erl

$i "Disable warnings; our test .xrl files aren't perfect"
$t echo "DIALYZER_OPTS += --fullpath -o dialyzer.out" >> $(APP)/Makefile

$i "Disable warnings; our test .xrl files aren't perfect"
$t echo "ERLC_OPTS=+debug_info" >> $(APP)/Makefile

$i "Confirm that Dialyzer errors out"
$t ! $(DIALYZER_MUTEX) $(MAKE) -C $(APP) dialyze $v

$i "Confirm that Dialyzer report contains fullpath"
$t grep $(APP)/src/warn_me.erl $(APP)/dialyzer.out

$i "Distclean the application"
$t $(MAKE) -C $(APP) distclean $v

$i "Check that the PLT file was removed"
$t test ! -e $(APP)/.$(APP).plt