diff --git a/Makefile b/Makefile index 8886af9a3..3129334e8 100644 --- a/Makefile +++ b/Makefile @@ -73,7 +73,14 @@ DIRECT_TESTS += \ ifneq ($(BUCK),no) -BUILD_SYSTEMS_TESTS += buck_blacklist buck-clang-db buck_flavors buck_flavors_run buck_flavors_deterministic +BUILD_SYSTEMS_TESTS += \ + buck_blacklist \ + buck-clang-db \ + buck_flavors \ + buck_flavors_diff \ + buck_flavors_run \ + buck_flavors_deterministic \ + endif ifneq ($(CMAKE),no) BUILD_SYSTEMS_TESTS += clang_compilation_db cmake inferconfig inferconfig_not_strict diff --git a/infer/tests/build_systems/buck_flavors_diff/Makefile b/infer/tests/build_systems/buck_flavors_diff/Makefile index 545629a29..ac0a9c013 100644 --- a/infer/tests/build_systems/buck_flavors_diff/Makefile +++ b/infer/tests/build_systems/buck_flavors_diff/Makefile @@ -5,7 +5,8 @@ TESTS_DIR = ../.. INFER_OUT = infer-out -SOURCES = $(SRC_DIR)/some_bugs.c $(SRC_DIR)/some_different_bugs.c +CODETOANALYZE = $(CURDIR)/../codetoanalyze +SOURCES = $(CODETOANALYZE)/some_bugs.c $(CODETOANALYZE)/some_different_bugs.c DIFFERENTIAL_ARGS = --differential-filter-files changed_files.txt include $(TESTS_DIR)/differential.make @@ -14,7 +15,6 @@ $(CURRENT_REPORT) $(PREVIOUS_REPORT): $(CLANG_DEPS) BUCK_TARGET = //src:hello INFER_OPTIONS = $(DIFFERENTIAL_ARGS) --flavors --reactive --debug-exceptions --no-linters -SRC_DIR = $(CURDIR)/../codetoanalyze .PHONY: compare_reports compare_reports: current.exp.test previous.exp.test @@ -42,13 +42,13 @@ replace: replace_reports $(CURRENT_REPORT): $(QUIET)$(REMOVE_DIR) buck-out - $(QUIET)$(COPY) $(SRC_DIR)/some_bugs.c src/hello.c + $(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) -- \ $(BUCK) build --no-cache $(BUCK_TARGET)) $(PREVIOUS_REPORT): - $(QUIET)$(COPY) $(SRC_DIR)/some_different_bugs.c src/hello.c + $(QUIET)$(COPY) $(CODETOANALYZE)/some_different_bugs.c src/hello.c $(QUIET)$(call silent_on_success,Running Buck diff analysis: previous,\ $(INFER_BIN) $(INFER_OPTIONS) run --results-dir $(PREVIOUS_DIR) -- \ $(BUCK) build --no-cache $(BUCK_TARGET)) diff --git a/infer/tests/build_systems/buck_flavors_diff/costs_summary.json.exp b/infer/tests/build_systems/buck_flavors_diff/costs_summary.json.exp new file mode 100644 index 000000000..d04696a0c --- /dev/null +++ b/infer/tests/build_systems/buck_flavors_diff/costs_summary.json.exp @@ -0,0 +1 @@ +{"top":{"current":0,"previous":0},"zero":{"current":0,"previous":0},"degrees":[]} \ No newline at end of file diff --git a/infer/tests/build_systems/buck_flavors_diff/current.exp b/infer/tests/build_systems/buck_flavors_diff/current.exp index 405b6f501..ad4eeecd5 100644 --- a/infer/tests/build_systems/buck_flavors_diff/current.exp +++ b/infer/tests/build_systems/buck_flavors_diff/current.exp @@ -1,3 +1,3 @@ -src/hello.c, test1, 2, NULL_DEREFERENCE, [start of procedure test1()] -src/hello.c, test2, 2, NULL_DEREFERENCE, [start of procedure test2(),start of procedure nullify()] -src/hello2.c, test_hello2, 2, NULL_DEREFERENCE, [start of procedure test_hello2()] +src/hello.c, test1, 2, NULL_DEREFERENCE, B1, ERROR, [start of procedure test1()] +src/hello.c, test2, 2, NULL_DEREFERENCE, B1, ERROR, [start of procedure test2(),start of procedure nullify()] +src/hello2.c, test_hello2, 2, NULL_DEREFERENCE, B1, ERROR, [start of procedure test_hello2()] diff --git a/infer/tests/build_systems/buck_flavors_diff/fixed.exp b/infer/tests/build_systems/buck_flavors_diff/fixed.exp index 0e4678b08..4e2151c5a 100644 --- a/infer/tests/build_systems/buck_flavors_diff/fixed.exp +++ b/infer/tests/build_systems/buck_flavors_diff/fixed.exp @@ -1 +1 @@ -MEMORY_LEAK, src/hello.c, test3, 3, test3.8ad8757baa8564dc136c1e07507f4a98, test3 +MEMORY_LEAK, no_bucket, src/hello.c, test3, 3 diff --git a/infer/tests/build_systems/buck_flavors_diff/introduced.exp b/infer/tests/build_systems/buck_flavors_diff/introduced.exp index fd36cf2a8..93b21a12d 100644 --- a/infer/tests/build_systems/buck_flavors_diff/introduced.exp +++ b/infer/tests/build_systems/buck_flavors_diff/introduced.exp @@ -1 +1 @@ -NULL_DEREFERENCE, src/hello.c, test2, 2, test2.ad0234829205b9033196ba818f7a872b, test2 +NULL_DEREFERENCE, B1, src/hello.c, test2, 2 diff --git a/infer/tests/build_systems/buck_flavors_diff/preexisting.exp b/infer/tests/build_systems/buck_flavors_diff/preexisting.exp index d0d7dc05f..6b281ec0a 100644 --- a/infer/tests/build_systems/buck_flavors_diff/preexisting.exp +++ b/infer/tests/build_systems/buck_flavors_diff/preexisting.exp @@ -1 +1 @@ -NULL_DEREFERENCE, src/hello.c, test1, 2, test1.5a105e8b9d40e1329780d62ea2265d8a, test1 +NULL_DEREFERENCE, B1, src/hello.c, test1, 2 diff --git a/infer/tests/build_systems/buck_flavors_diff/previous.exp b/infer/tests/build_systems/buck_flavors_diff/previous.exp index 5ff15c95a..00c98513d 100644 --- a/infer/tests/build_systems/buck_flavors_diff/previous.exp +++ b/infer/tests/build_systems/buck_flavors_diff/previous.exp @@ -1,3 +1,3 @@ -src/hello.c, test1, 2, NULL_DEREFERENCE, [start of procedure test1()] -src/hello.c, test3, 3, MEMORY_LEAK, [start of procedure test3(),Condition is true] -src/hello2.c, test_hello2, 2, NULL_DEREFERENCE, [start of procedure test_hello2()] +src/hello.c, test1, 2, NULL_DEREFERENCE, B1, ERROR, [start of procedure test1()] +src/hello.c, test3, 3, MEMORY_LEAK, no_bucket, ERROR, [start of procedure test3(),Taking true branch] +src/hello2.c, test_hello2, 2, NULL_DEREFERENCE, B1, ERROR, [start of procedure test_hello2()]