[infer][tests] No longer rely on Infer being in the PATH for the genrule integration test

Summary: This should no work even when Infer is not setup in the PATH

Reviewed By: jvillard

Differential Revision: D4262356

fbshipit-source-id: e3fa779
master
Jeremy Dubreil 8 years ago committed by Facebook Github Bot
parent c1205c1453
commit 532621def1

@ -20,14 +20,18 @@ include $(TESTS_DIR)/java.make
include $(TESTS_DIR)/base.make include $(TESTS_DIR)/base.make
$(JAR_OUTPUT): $(JAVA_SOURCE_FILES) $(JAR_OUTPUT): $(JAVA_SOURCE_FILES)
NO_BUCKD=1 buck build --no-cache //infer/tests/codetoanalyze/java/infer:compile $(call silent_on_success,\
cd $(ROOT_DIR) && \
INFER_BIN=$(INFER_BIN) NO_BUCKD=1 buck build --no-cache //infer/tests/codetoanalyze/java/infer:compile)
.PHONY: genrule .PHONY: genrule
genrule: $(JAR_OUTPUT) genrule: $(JAR_OUTPUT)
NO_BUCKD=1 buck build --no-cache //infer/tests/codetoanalyze/java/infer:run_infer $(call silent_on_success,\
cd $(ROOT_DIR) && \
INFER_BIN=$(INFER_BIN) NO_BUCKD=1 buck build --no-cache //infer/tests/codetoanalyze/java/infer:run_infer)
infer-out/report.json: genrule $(INFER_BIN) $(JAVA_SOURCE_FILES) infer-out/report.json: genrule $(INFER_BIN) $(JAVA_SOURCE_FILES)
$(call silent_on_success,\ $(call silent_on_success,\
cd $(ROOT_DIR) && \ cd $(ROOT_DIR) && \
NO_BUCKD=1 $(INFER_BIN) -a $(ANALYZER) --results-dir $(CURDIR)/infer-out -- \ INFER_BIN=$(INFER_BIN) NO_BUCKD=1 $(INFER_BIN) -a $(ANALYZER) --results-dir $(CURDIR)/infer-out -- \
buck build --no-cache //infer/tests/codetoanalyze/java/infer:compile) buck build --no-cache //infer/tests/codetoanalyze/java/infer:compile)

@ -1,5 +1,7 @@
# TODO: this file exists only to support buck integration in infer/tests/build_systems/build_integration_tests.py # TODO: this file exists only to support buck integration in infer/tests/build_systems/build_integration_tests.py
import os
sources = glob(['**/*.java']) sources = glob(['**/*.java'])
java_library( java_library(
@ -23,7 +25,7 @@ genrule(
srcs = sources, srcs = sources,
out = 'infer-out', out = 'infer-out',
bash = ' '.join([ bash = ' '.join([
'infer', os.getenv('INFER_BIN', 'infer'),
'--sourcepath', '--sourcepath',
'$SRCDIR', '$SRCDIR',
'--classpath', '--classpath',

Loading…
Cancel
Save