From ee499cfe4db9832778eaefc2130b76c1f4e64619 Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Thu, 4 Nov 2021 10:10:18 -0700 Subject: [PATCH] [make] separate `dune build @runtest` from `dune build @fmt` Summary: It was annoying that `make runtest` would also run `dune build fmt`: - the second step runs over all files, which is slow - it made it hard to debug the `dune build runtest` step in isolation because the dune logs would get overwritten by the second run - it made the Makefile more complex Reviewed By: martintrojer Differential Revision: D32170178 fbshipit-source-id: fef7cecbf --- infer/src/Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/infer/src/Makefile b/infer/src/Makefile index dfcf602cce3..eb3ccb827b5 100644 --- a/infer/src/Makefile +++ b/infer/src/Makefile @@ -77,17 +77,17 @@ endif .PHONY: src_build_common src_build_common: $(SRC_BUILD_COMMON) -# NOTE: the complexity below is because @runtest and @fmt interact poorly: we want dune to format -# test files *after* having promoted them when the test outputs change .PHONY: runtest runtest: $(SRC_BUILD_COMMON) $(MAKEFILE_LIST) - $(QUIET)exit_code=0; \ - $(DUNE_BUILD) @runtest --auto-promote || exit_code=$$?; \ - $(DUNE_BUILD) @fmt --auto-promote || exit_code=$$?; \ - exit $$exit_code + $(DUNE_BUILD) @runtest --auto-promote + +# we want dune to format test files *after* having promoted them +.PHONY: runtest_formatted +runtest_formatted: $(SRC_BUILD_COMMON) $(MAKEFILE_LIST) runtest + $(DUNE_BUILD) @fmt --auto-promote .PHONY: test -test: $(SRC_BUILD_COMMON) $(MAKEFILE_LIST) runtest +test: $(SRC_BUILD_COMMON) $(MAKEFILE_LIST) runtest_formatted $(DUNE_BUILD) \ $(patsubst %.exe, %.bc.exe, $(INFER_CONFIG_TARGETS)) \ scripts/$(CHECKCOPYRIGHT_MAIN).bc.exe $(INFERUNIT_MAIN).bc.exe $(INFERTOP_MAIN).bc.exe