add e2e test of inferTraceBugs

Summary:public
Add very basic end-to-end tests that inferTraceBugs doesn't crash.

Reviewed By: jeremydubreil

Differential Revision: D2995427

fb-gh-sync-id: d9e969e
shipit-source-id: d9e969e
master
Jules Villard 9 years ago committed by Facebook Github Bot 4
parent 6f012ad70e
commit 38ae6bea50

@ -9,6 +9,7 @@ PLATFORM = $(shell uname)
ABSOLUTE_ROOT_DIR = $(shell cd $(ROOT_DIR) && pwd) ABSOLUTE_ROOT_DIR = $(shell cd $(ROOT_DIR) && pwd)
EXAMPLES_DIR = $(ABSOLUTE_ROOT_DIR)/examples
FCP_DIR = $(ABSOLUTE_ROOT_DIR)/facebook-clang-plugins FCP_DIR = $(ABSOLUTE_ROOT_DIR)/facebook-clang-plugins
INFER_DIR = $(ABSOLUTE_ROOT_DIR)/infer INFER_DIR = $(ABSOLUTE_ROOT_DIR)/infer
DEPENDENCIES_DIR = $(ABSOLUTE_ROOT_DIR)/dependencies DEPENDENCIES_DIR = $(ABSOLUTE_ROOT_DIR)/dependencies
@ -24,9 +25,10 @@ MODELS_DIR = $(INFER_DIR)/models
SRC_DIR = $(INFER_DIR)/src SRC_DIR = $(INFER_DIR)/src
JAVA_LIB_DIR = $(LIB_DIR)/java JAVA_LIB_DIR = $(LIB_DIR)/java
PYTHON_LIB_DIR = $(LIB_DIR)/python/inferlib
SPECS_LIB_DIR = $(LIB_DIR)/specs SPECS_LIB_DIR = $(LIB_DIR)/specs
PYTHON_DIR = $(LIB_DIR)/python
PYTHON_LIB_DIR = $(PYTHON_DIR)/inferlib
CAPTURE_LIB_DIR = $(PYTHON_LIB_DIR)/capture CAPTURE_LIB_DIR = $(PYTHON_LIB_DIR)/capture
INFERANALYZE_BIN = $(BIN_DIR)/InferAnalyze INFERANALYZE_BIN = $(BIN_DIR)/InferAnalyze

@ -96,7 +96,29 @@ ifeq (@BUILD_JAVA_ANALYZERS@,yes)
NO_BUCKD=1 ./scripts/build_integration_tests.py NO_BUCKD=1 ./scripts/build_integration_tests.py
endif endif
test: buck_test inferTraceBugs_test: $(INFER_ANALYZERS)
ifeq (@BUILD_JAVA_ANALYZERS@,yes)
$(PYTHON_DIR)/infer -o __test-infer-out__ -- \
javac $(EXAMPLES_DIR)/Hello.java \
> /dev/null
@rm -f Hello.class
else
$(PYTHON_DIR)/infer -o __test-infer-out__ \
-- clang -c $(EXAMPLES_DIR)/hello.c \
> /dev/null
@rm -f hello.o
endif
$(PYTHON_DIR)/inferTraceBugs -o __test-infer-out__ \
--select 0 --max-level max > /dev/null
$(PYTHON_DIR)/inferTraceBugs -o __test-infer-out__ \
--select 0 --max-level 0 > /dev/null
$(PYTHON_DIR)/inferTraceBugs -o __test-infer-out__ \
--select 0 --max-level max --no-source > /dev/null
$(PYTHON_DIR)/inferTraceBugs -o __test-infer-out__ \
--only-show > /dev/null
@rm -fr __test-infer-out__
test: buck_test inferTraceBugs_test
test_xml: buck_test_xml test_xml: buck_test_xml
@ -108,4 +130,6 @@ ifeq (@BUILD_C_ANALYZERS@,yes)
endif endif
$(MAKE) -C $(INFER_DIR) clean $(MAKE) -C $(INFER_DIR) clean
.PHONY: all build_integration_tests clean clang clang_plugin clang_setup java test test_xml test_build .PHONY: all buck_test buck_test_xml build_integration_tests clean clang
.PHONY: clang_plugin clang_setup inferTraceBugs_test java
.PHONY: test test_xml test_build

Loading…
Cancel
Save