Make buck tests more robust

Summary: using 'buck clean' rather than 'rm -rf buck-out' makes buck happier, apply to all buck integration tests

Reviewed By: ngorogiannis

Differential Revision: D25558469

fbshipit-source-id: 6c07341d6
master
Martin Trojer 4 years ago committed by Facebook GitHub Bot
parent 4487513a2f
commit 212068f89b

@ -17,6 +17,7 @@ include $(TESTS_DIR)/infer.make
infer-out/report.json: $(CLANG_DEPS) $(SOURCES)
$(QUIET)cd $(SOURCE_DIR) && \
$(BUCK) clean && \
$(call silent_on_success,Testing Buck Clang compilation database integration,\
$(INFER_BIN) $(INFER_OPTIONS) -o $(CURDIR)/$(@D) \
--buck-compilation-database no-deps \

@ -21,7 +21,7 @@ $(OBJECTS): $(JAVA_SOURCE_FILES)
$(BUCK) build --no-cache $(BUCK_TARGET))
infer-out/report.json: $(CLANG_DEPS) $(SOURCES) $(MAKEFILE_LIST)
$(QUIET)$(REMOVE_DIR) buck-out && \
$(QUIET)$(BUCK) clean
$(call silent_on_success,Testing Buck flavors integration,\
$(INFER_BIN) $(INFER_OPTIONS) capture --buck-clang --results-dir $(CURDIR)/infer-out \
@blacklist.txt --buck-blacklist '.*src/hello2\.c' \

@ -25,12 +25,13 @@ $(DIFF_OUTPUT):
$(QUIET)echo >> diff.mod.test
$(TEST_DETERMINATOR_RESULT): $(DIFF_OUTPUT)
$(QUIET)$(call silent_on_success,Testing test-determinator for clang with set of changes,\
$(INFER_BIN) $(INFER_OPTIONS) -- buck build --no-cache $(BUCK_TARGET))
$(QUIET)$(BUCK) clean
$(call silent_on_success,Testing test-determinator for clang with set of changes,\
$(INFER_BIN) $(INFER_OPTIONS) -- $(BUCK) build --no-cache $(BUCK_TARGET))
.PHONY: test
test: $(TEST_DETERMINATOR_RESULT)
$(QUIET)$(call check_no_diff,test_determinator.json.exp,$(TEST_DETERMINATOR_RESULT))
$(call check_no_diff,test_determinator.json.exp,$(TEST_DETERMINATOR_RESULT))
.PHONY: replace
replace: $(TEST_DETERMINATOR_RESULT)

@ -20,7 +20,7 @@ $(OBJECTS): $(SOURCES)
$(BUCK) build --no-cache $(BUCK_TARGET))
infer-out/report.json: $(CLANG_DEPS) $(SOURCES) $(MAKEFILE_LIST)
$(QUIET)$(REMOVE_DIR) buck-out && \
$(QUIET)$(BUCK) clean
$(call silent_on_success,Testing infer-run Buck combined genrule integration,\
$(INFER_BIN) $(INFER_OPTIONS) run --results-dir $(CURDIR)/infer-out -- \
$(BUCK) build --no-cache $(BUCK_TARGET))

@ -24,12 +24,13 @@ $(DIFF_OUTPUT):
$(QUIET)echo >> diff.mod.test
$(TEST_DETERMINATOR_RESULT): $(DIFF_OUTPUT)
$(QUIET)$(call silent_on_success,Testing export-changed-functions with set of changes,\
$(INFER_BIN) $(INFER_OPTIONS) -- buck build --no-cache $(BUCK_TARGET))
$(QUIET)$(BUCK) clean
$(call silent_on_success,Testing export-changed-functions with set of changes,\
$(INFER_BIN) $(INFER_OPTIONS) -- $(BUCK) build --no-cache $(BUCK_TARGET))
.PHONY: test
test: $(TEST_DETERMINATOR_RESULT)
$(QUIET)$(call check_no_diff,changed_functions.json.exp,$(TEST_DETERMINATOR_RESULT))
$(call check_no_diff,changed_functions.json.exp,$(TEST_DETERMINATOR_RESULT))
.PHONY: replace
replace: $(TEST_DETERMINATOR_RESULT)

@ -20,7 +20,7 @@ $(OBJECTS): $(JAVA_SOURCE_FILES)
$(BUCK) build --no-cache $(BUCK_TARGET))
infer-out/report.json: $(CLANG_DEPS) $(SOURCES) $(MAKEFILE_LIST)
$(QUIET)$(REMOVE_DIR) buck-out && \
$(QUIET)$(BUCK) clean
$(call silent_on_success,Testing Buck flavors integration,\
$(INFER_BIN) $(INFER_OPTIONS) capture --buck-clang --results-dir $(CURDIR)/infer-out -- \
$(BUCK) build --no-cache $(BUCK_TARGET) &&\

@ -39,7 +39,7 @@ print: current.exp.test previous.exp.test
replace: replace_reports
$(CURRENT_REPORT):
$(QUIET)$(REMOVE_DIR) buck-out
$(QUIET)$(BUCK) clean
$(QUIET)$(COPY) $(CODETOANALYZE)/some_bugs.c src/hello.c
$(QUIET)$(call silent_on_success,Running Buck diff analysis: current,\
$(INFER_BIN) $(INFER_OPTIONS) run --results-dir $(CURRENT_DIR) -- \

@ -20,7 +20,7 @@ $(OBJECTS): $(SOURCES)
$(BUCK) build --no-cache $(BUCK_TARGET))
infer-out/report.json: $(CLANG_DEPS) $(SOURCES) $(MAKEFILE_LIST)
$(QUIET)$(REMOVE_DIR) buck-out && \
$(QUIET)$(BUCK) clean
$(call silent_on_success,Testing infer-run Buck flavors integration,\
$(INFER_BIN) $(INFER_OPTIONS) run --results-dir $(CURDIR)/infer-out --reactive -- \
$(BUCK) build --no-cache $(BUCK_TARGET))

@ -16,6 +16,6 @@ INFER_OPTIONS = --buck-java-flavor --debug-exceptions
include $(TESTS_DIR)/infer.make
$(INFER_OUT)/report.json: $(MAKEFILE_LIST) $(SOURCES)
$(QUIET) $(REMOVE_DIR) buck-out && \
$(QUIET)$(BUCK) clean
$(call silent_on_success,Testing java flavor integration in $(TEST_REL_DIR),\
$(INFER_BIN) --results-dir $(@D) $(INFER_OPTIONS) -- buck build --no-cache $(BUCK_TARGET))
$(INFER_BIN) --results-dir $(@D) $(INFER_OPTIONS) -- $(BUCK) build --no-cache $(BUCK_TARGET))

@ -15,7 +15,7 @@ INFER_OPTIONS = --buck-java --debug-exceptions
include $(TESTS_DIR)/infer.make
$(INFER_OUT)/report.json: $(MAKEFILE_LIST) $(SOURCES)
$(QUIET) $(REMOVE_DIR) buck-out && \
$(QUIET)$(BUCK) clean
$(call silent_on_success,Testing genrule capture integration in $(TEST_REL_DIR),\
$(INFER_BIN) --results-dir $(@D) $(INFER_OPTIONS) -- \
buck build --no-cache $(BUCK_TARGET))
$(BUCK) build --no-cache $(BUCK_TARGET))

@ -17,6 +17,5 @@ include $(TESTS_DIR)/infer.make
include $(TESTS_DIR)/objc.make
infer-out/report.json: $(CLANG_DEPS) $(SOURCES) $(MAKEFILE_LIST)
$(QUIET)$(REMOVE_DIR) buck-out && \
$(call silent_on_success,Testing analysis with Objective-C getters and setters,\
$(INFER_BIN) $(INFER_OPTIONS) --results-dir $(CURDIR)/infer-out -- clang $(CLANG_OPTIONS) $(SOURCES))

@ -17,6 +17,5 @@ include $(TESTS_DIR)/infer.make
include $(TESTS_DIR)/objc.make
infer-out/report.json: $(CLANG_DEPS) $(SOURCES) $(MAKEFILE_LIST)
$(QUIET)$(REMOVE_DIR) buck-out && \
$(call silent_on_success,Testing analysis with Objective-C Missing_fld,\
$(INFER_BIN) $(INFER_OPTIONS) --results-dir $(CURDIR)/infer-out -- clang $(CLANG_OPTIONS) $(SOURCES))

@ -17,6 +17,5 @@ include $(TESTS_DIR)/infer.make
include $(TESTS_DIR)/objc.make
infer-out/report.json: $(CLANG_DEPS) $(SOURCES) $(MAKEFILE_LIST)
$(QUIET)$(REMOVE_DIR) buck-out && \
$(call silent_on_success,Testing analysis with Objective-C Retain cycles,\
$(INFER_BIN) $(INFER_OPTIONS) --results-dir $(CURDIR)/infer-out -- clang $(CLANG_OPTIONS) -fobjc-arc $(SOURCES))

@ -17,6 +17,5 @@ include $(TESTS_DIR)/infer.make
include $(TESTS_DIR)/objc.make
infer-out/report.json: $(CLANG_DEPS) $(SOURCES) $(MAKEFILE_LIST)
$(QUIET)$(REMOVE_DIR) buck-out && \
$(call silent_on_success,Testing analysis with Objective-C retain cycles on weak properties,\
$(INFER_BIN) $(INFER_OPTIONS) --results-dir $(CURDIR)/infer-out -- clang $(CLANG_OPTIONS) $(SOURCES))

Loading…
Cancel
Save