Просмотр исходного кода

Swallow warnings when creating a PLT

Krzysztof Jurewicz 7 лет назад
Родитель
Сommit
a52826d6f6
2 измененных файлов с 14 добавлено и 1 удалено
  1. 1 1
      plugins/dialyzer.mk
  2. 13 0
      test/plugin_dialyzer.mk

+ 1 - 1
plugins/dialyzer.mk

@@ -46,7 +46,7 @@ $(DIALYZER_PLT): deps app
 	$(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 $(DIALYZER_PLT_OPTS) --apps \
-		erts kernel stdlib $(PLT_APPS) $(OTP_DEPS) $(LOCAL_DEPS) $(DEPS_LOG)
+		erts kernel stdlib $(PLT_APPS) $(OTP_DEPS) $(LOCAL_DEPS) $(DEPS_LOG) || test $$? -eq 2
 
 plt: $(DIALYZER_PLT)
 

+ 13 - 0
test/plugin_dialyzer.mk

@@ -290,3 +290,16 @@ 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-plt-swallow-warnings: 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 LFE version referring to a missing function to the list of dependencies"
+	$t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = lfe\ndep_lfe_commit = 2880c8a2a7f\n"}' $(APP)/Makefile
+
+	$i "Create the PLT file"
+	$t $(DIALYZER_MUTEX) $(MAKE) -C $(APP) plt $v