fix make -j8 clean test

Summary:
`make clean all test` worked, but not `make clean test` because `test` only
builds stuff in infer/src/ (no models, no infer/bin/infer). For now, fix the
workflow by building both `infer` and `test_build` in different directories (so
they can be parallelized).

Reviewed By: jberdine

Differential Revision: D3322797

fbshipit-source-id: 71d146d
master
Jules Villard 9 years ago committed by Facebook Github Bot 5
parent 08546ce7bb
commit 92aef2a411

@ -66,17 +66,17 @@ endif
test_build: clang_plugin
$(MAKE) -C $(SRC_DIR) test_build
ocaml_unit_test: test_build
ocaml_unit_test: infer
$(INFERUNIT_BIN)
buck_test: test_build
buck_test: infer
NO_BUCKD=1 buck clean
NO_BUCKD=1 buck test $(TARGETS_TO_TEST)
ifeq (@BUILD_JAVA_ANALYZERS@,yes)
NO_BUCKD=1 ./infer/tests/build_systems/build_integration_tests.py
endif
buck_test_xml: test_build
buck_test_xml: infer
NO_BUCKD=1 buck clean
NO_BUCKD=1 buck test --xml test.xml $(TARGETS_TO_TEST)
ifeq (@BUILD_JAVA_ANALYZERS@,yes)
@ -86,7 +86,7 @@ endif
inferTraceBugs:
$(MAKE) -C $(INFER_DIR) $(INFERTRACEBUGS_BIN_RELPATH)
inferTraceBugs_test: test_build
inferTraceBugs_test: infer
$(INFER_BIN) -o __test-infer-out__ -- \
javac $(EXAMPLES_DIR)/Hello.java \
> /dev/null
@ -109,7 +109,8 @@ check_missing_mli:
test: test_build ocaml_unit_test buck_test inferTraceBugs_test
$(MAKE) -C $(SRC_DIR) mod_dep.dot
test_xml: buck_test_xml
test_xml: test_build ocaml_unit_test buck_test_xml inferTraceBugs_test
$(MAKE) -C $(SRC_DIR) mod_dep.dot
uninstall:
$(REMOVE_DIR) $(DESTDIR)$(libdir)/infer/
@ -239,7 +240,6 @@ conf-clean: clean
$(REMOVE_DIR) infer/models/objc/out/
$(REMOVE) infer/src/Makefile
.PHONY: all buck_test buck_test_xml clean
.PHONY: clang_plugin clang_setup infer inferTraceBugs inferTraceBugs_test
.PHONY: ocaml_unit_test check_missing_mli test test_xml test_build
.PHONY: install uninstall
.PHONY: all buck_test buck_test_xml clean clang_plugin clang_setup infer inferTraceBugs
.PHONY: inferTraceBugs_test ocaml_unit_test check_missing_mli test test_xml test_build install
.PHONY: uninstall

@ -19,6 +19,7 @@ ATDGEN = @ATDGEN@
BUILD_DIR = $(INFER_DIR)/_build
INFER_BUILD_DIR = $(BUILD_DIR)/infer
TEST_BUILD_DIR = $(BUILD_DIR)/test
LLVM_BUILD_DIR = $(BUILD_DIR)/llvm
ANNOT_DIR = $(SRC_DIR)/_build
ETC_DIR = $(INFER_DIR)/etc
@ -28,7 +29,6 @@ ETC_DIR = $(INFER_DIR)/etc
OCAML_FATAL_WARNINGS = +5+6+8+10+11+12+18+19+20+26+29+27+32+33+34+35+37+38+39
OCAMLBUILD_OPTIONS = \
-classic-display \
-r \
-cflags -g -lflags -g \
-cflags -short-paths \
@ -220,16 +220,9 @@ module: init $(INFERPRINT_ATDGEN_STUBS) $(CLANG_ATDGEN_STUBS) $(INFER_CLANG_FCP_
test_build: init $(INFERPRINT_ATDGEN_STUBS) $(CLANG_ATDGEN_STUBS) $(INFER_CLANG_FCP_MIRRORED_FILES) \
$(LLVM_SOURCES)/lLexer.ml $(LLVM_SOURCES)/lParser.ml
$(OCAMLBUILD_ALL) -build-dir $(INFER_BUILD_DIR) \
$(OCAMLBUILD_ALL) -build-dir $(TEST_BUILD_DIR) \
-cflags -warn-error,$(OCAML_FATAL_WARNINGS) \
$(INFER_ALL_TARGETS)
$(COPY) $(INFER_BUILD_DIR)/$(INFERANALYZE_MAIN).native $(INFERANALYZE_BIN)
$(COPY) $(INFER_BUILD_DIR)/$(INFERPRINT_MAIN).native $(INFERPRINT_BIN)
$(COPY) $(INFER_BUILD_DIR)/$(CHECKCOPYRIGHT_MAIN).native $(CHECKCOPYRIGHT_BIN)
$(COPY) $(INFER_BUILD_DIR)/$(INFERUNIT_MAIN).native $(INFERUNIT_BIN)
$(COPY) $(INFER_BUILD_DIR)/$(INFERLLVM_MAIN).native $(INFERLLVM_BIN)
$(COPY) $(INFER_BUILD_DIR)/$(INFERJAVA_MAIN).native $(INFERJAVA_BIN)
$(COPY) $(INFER_BUILD_DIR)/$(INFERCLANG_MAIN).native $(INFERCLANG_BIN)
$(INFER_ALL_TARGETS:.native=.byte)
$(DEPENDENCIES_DIR)/ocamldot/ocamldot:
$(MAKE) -C $(DEPENDENCIES_DIR)/ocamldot
@ -311,7 +304,7 @@ $(BUILD_DIR):
$(MKDIR_P) $(BUILD_DIR)
test_clean:
$(REMOVE_DIR) $(INFER_BUILD_DIR)
$(REMOVE_DIR) $(TEST_BUILD_DIR)
clean:
$(REMOVE_DIR) $(BUILD_DIR)

Loading…
Cancel
Save