From 6cf7417e56c4985d2b729db95a3c707f3c83a118 Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Fri, 6 Apr 2018 04:28:39 -0700 Subject: [PATCH] [test] do not run the dead code analysis as part of the tests Summary: The dead code checker slows down the test suite notably, and can be annoying when you're in the middle of a change. Depends on D7443825 Reviewed By: mbouaziz, ngorogiannis Differential Revision: D7443881 fbshipit-source-id: 746cf6e --- Makefile | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index d88e105e0..89c805217 100644 --- a/Makefile +++ b/Makefile @@ -181,12 +181,28 @@ test_build: src_build_common $(QUIET)$(call silent_on_success,Testing Infer builds without warnings,\ $(MAKE_SOURCE) test) -# depend on test_build so that we do not run them in parallel -.PHONY: deadcode -deadcode: src_build_common test_build +# deadcode analysis: only do the deadcode detection on Facebook builds and if GNU sed is available +.PHONY: real_deadcode +real_deadcode: src_build_common $(QUIET)$(call silent_on_success,Testing there is no dead OCaml code,\ $(MAKE) -C $(SRC_DIR)/deadcode) +.PHONY: deadcode +deadcode: +ifeq ($(IS_FACEBOOK_TREE),no) + $(QUIET)echo "Deadcode detection only works in Facebook builds, skipping" +endif +ifeq ($(GNU_SED),no) + $(QUIET)echo "Deadcode detection only works with GNU sed installed, skipping" +endif + +ifeq ($(IS_FACEBOOK_TREE),yes) +ifneq ($(GNU_SED),no) +deadcode: real_deadcode +endif +endif + + .PHONY: toplevel toplevel: src_build_common $(QUIET)$(call silent_on_success,Building Infer REPL,\ @@ -398,11 +414,6 @@ test: crash_if_not_all_analyzers_enabled config_tests ifeq (,$(findstring s,$(MAKEFLAGS))) $(QUIET)echo "$(TERM_INFO)ALL TESTS PASSED$(TERM_RESET)" endif -ifeq ($(IS_FACEBOOK_TREE),yes) -ifneq ($(GNU_SED),no) -test: deadcode -endif -endif .PHONY: quick-test quick-test: test_build ocaml_unit_test