diff --git a/infer/tests/build_systems/assembly/Makefile b/infer/tests/build_systems/assembly/Makefile index 4dc157da8..3cff41b19 100644 --- a/infer/tests/build_systems/assembly/Makefile +++ b/infer/tests/build_systems/assembly/Makefile @@ -6,12 +6,14 @@ # of patent rights can be found in the PATENTS file in the same directory. TESTS_DIR = ../.. -include $(TESTS_DIR)/clang.make ANALYZER = infer CLANG_OPTIONS = -c INFER_OPTIONS = --report-custom-error --developer-mode --project-root ../codetoanalyze +INFERPRINT_OPTIONS = --issues-tests SOURCES = \ ../codetoanalyze/example.S \ ../codetoanalyze/hello.c \ + +include $(TESTS_DIR)/clang.make diff --git a/infer/tests/build_systems/project_root_rel/Makefile b/infer/tests/build_systems/project_root_rel/Makefile index 8732e4692..5bb9df39c 100644 --- a/infer/tests/build_systems/project_root_rel/Makefile +++ b/infer/tests/build_systems/project_root_rel/Makefile @@ -6,11 +6,13 @@ # of patent rights can be found in the PATENTS file in the same directory. TESTS_DIR = ../.. -include $(TESTS_DIR)/clang.make ANALYZER = infer CLANG_OPTIONS = -c INFER_OPTIONS = --report-custom-error --developer-mode --project-root ../../../tests +INFERPRINT_OPTIONS = --issues-tests SOURCES = \ ../codetoanalyze/hello.c \ + +include $(TESTS_DIR)/clang.make diff --git a/infer/tests/clang.make b/infer/tests/clang.make index ae1159159..226e8b60f 100644 --- a/infer/tests/clang.make +++ b/infer/tests/clang.make @@ -5,7 +5,8 @@ # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. -INFERPRINT_OPTIONS = --issues-tests +ROOT_DIR = $(TESTS_DIR)/../.. + OBJECTS = $(foreach source,$(SOURCES),$(basename $(source)).o) include $(TESTS_DIR)/base.make @@ -15,5 +16,17 @@ infer-out/report.json: $(CLANG_DEPS) $(SOURCES) $(INFER_BIN) --check-duplicate-symbols $(INFER_OPTIONS) -a $(ANALYZER) -- clang $(CLANG_OPTIONS) $(SOURCES) 2>duplicates.txt) grep "DUPLICATE_SYMBOLS" duplicates.txt; test $$? -ne 0 -$(OBJECTS): $(SOURCES) - clang $(CLANG_OPTIONS) $(SOURCES) +%.o: %.c + clang $(CLANG_OPTIONS) -o $@ $< + +%.o: %.cpp + clang++ $(CLANG_OPTIONS) -o $@ $< + +%.o: %.m + clang $(CLANG_OPTIONS) -o $@ $< + +%.o: %.mm + clang++ $(CLANG_OPTIONS) -o $@ $< + +clean: + $(REMOVE) duplicates.txt diff --git a/infer/tests/codetoanalyze/c/errors/Makefile b/infer/tests/codetoanalyze/c/errors/Makefile index 506c8257b..bda838cb6 100644 --- a/infer/tests/codetoanalyze/c/errors/Makefile +++ b/infer/tests/codetoanalyze/c/errors/Makefile @@ -6,11 +6,13 @@ # of patent rights can be found in the PATENTS file in the same directory. TESTS_DIR = ../../.. -include $(TESTS_DIR)/clang.make ANALYZER = infer CLANG_OPTIONS = -c INFER_OPTIONS = --report-custom-error --developer-mode --no-filtering --debug-exceptions +INFERPRINT_OPTIONS = --issues-tests SOURCES = \ $(wildcard */*.c) \ + +include $(TESTS_DIR)/clang.make diff --git a/infer/tests/codetoanalyze/cpp/checkers/Makefile b/infer/tests/codetoanalyze/cpp/checkers/Makefile index 3782206f0..a32e71daa 100644 --- a/infer/tests/codetoanalyze/cpp/checkers/Makefile +++ b/infer/tests/codetoanalyze/cpp/checkers/Makefile @@ -6,7 +6,6 @@ # of patent rights can be found in the PATENTS file in the same directory. TESTS_DIR = ../../.. -include $(TESTS_DIR)/clang.make ANALYZER = checkers # see explanations in cpp/errors/Makefile for the custom isystem @@ -22,3 +21,5 @@ SOURCES = \ siof/pod_same_translation_unit.cpp \ siof/siof_across_translation_units-1.cpp \ siof/siof_across_translation_units-2.cpp \ + +include $(TESTS_DIR)/clang.make diff --git a/infer/tests/codetoanalyze/cpp/checkers/siof/pod_same_translation_unit.cpp b/infer/tests/codetoanalyze/cpp/checkers/siof/pod_same_translation_unit.cpp index 84150275a..a84b71336 100644 --- a/infer/tests/codetoanalyze/cpp/checkers/siof/pod_same_translation_unit.cpp +++ b/infer/tests/codetoanalyze/cpp/checkers/siof/pod_same_translation_unit.cpp @@ -7,8 +7,6 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -#include - int same_tu_foo(); int same_tu_goo(); diff --git a/infer/tests/codetoanalyze/cpp/errors/Makefile b/infer/tests/codetoanalyze/cpp/errors/Makefile index 3759d5d6a..fd1dfbc9b 100644 --- a/infer/tests/codetoanalyze/cpp/errors/Makefile +++ b/infer/tests/codetoanalyze/cpp/errors/Makefile @@ -6,7 +6,6 @@ # of patent rights can be found in the PATENTS file in the same directory. TESTS_DIR = ../../.. -include $(TESTS_DIR)/clang.make ANALYZER = infer @@ -14,6 +13,7 @@ ANALYZER = infer # regardless of the libraries installed on the machine. CLANG_OPTIONS = -x c++ -std=c++11 -nostdinc++ -isystem$(ROOT_DIR) -isystem$(CLANG_INCLUDES)/c++/v1/ -c INFER_OPTIONS = --cxx --ml-buckets cpp --no-filtering --debug-exceptions +INFERPRINT_OPTIONS = --issues-tests SOURCES = \ $(wildcard c_tests/*.cpp) \ @@ -58,3 +58,5 @@ SOURCES = \ $(wildcard smart_ptr/*.cpp) \ $(wildcard subtyping/*.cpp) \ $(wildcard vector/*.cpp) \ + +include $(TESTS_DIR)/clang.make diff --git a/infer/tests/codetoanalyze/cpp/quandary/Makefile b/infer/tests/codetoanalyze/cpp/quandary/Makefile index 80cbb9c03..c5969f168 100644 --- a/infer/tests/codetoanalyze/cpp/quandary/Makefile +++ b/infer/tests/codetoanalyze/cpp/quandary/Makefile @@ -6,15 +6,15 @@ # of patent rights can be found in the PATENTS file in the same directory. TESTS_DIR = ../../.. -include $(TESTS_DIR)/clang.make ANALYZER = quandary # see explanations in cpp/errors/Makefile for the custom isystem CLANG_OPTIONS = -x c++ -std=c++11 -nostdinc++ -isystem$(ROOT_DIR) -isystem$(CLANG_INCLUDES)/c++/v1/ -c INFER_OPTIONS = --cxx --ml-buckets cpp --no-filtering --debug-exceptions - INFERPRINT_OPTIONS = --issues-txt SOURCES = \ basics.cpp \ execs.cpp \ + +include $(TESTS_DIR)/clang.make diff --git a/infer/tests/codetoanalyze/objc/errors/Makefile b/infer/tests/codetoanalyze/objc/errors/Makefile index 103bb8183..4313546be 100644 --- a/infer/tests/codetoanalyze/objc/errors/Makefile +++ b/infer/tests/codetoanalyze/objc/errors/Makefile @@ -6,7 +6,6 @@ # of patent rights can be found in the PATENTS file in the same directory. TESTS_DIR = ../../.. -include $(TESTS_DIR)/clang.make IPHONESIMULATOR_ISYSROOT_SUFFIX = /Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk @@ -19,6 +18,7 @@ CLANG_OPTIONS = -x objective-c \ CLEAN_EXTRA = infer-out-arc infer-out-all INFER_OPTIONS = --cxx --check-duplicate-symbols --no-filtering --debug-exceptions +INFERPRINT_OPTIONS = --issues-tests SOURCES_DEFAULT = \ field_superclass/B.m \ @@ -96,6 +96,8 @@ SOURCES_ARC = \ subtyping/KindOfClassExample.m \ variadic_methods/premature_nil_termination.m \ +include $(TESTS_DIR)/clang.make + OBJECTS_ARC = $(foreach source,$(SOURCES_ARC),$(basename $(source)).o) OBJECTS_BUCKET_ALL = $(foreach source,$(SOURCES_BUCKET_ALL),$(basename $(source)).o) OBJECTS_DEFAULT = $(foreach source,$(SOURCES_DEFAULT),$(basename $(source)).o) diff --git a/infer/tests/codetoanalyze/objc/linters/Makefile b/infer/tests/codetoanalyze/objc/linters/Makefile index 785616cc8..3c255ffe2 100644 --- a/infer/tests/codetoanalyze/objc/linters/Makefile +++ b/infer/tests/codetoanalyze/objc/linters/Makefile @@ -6,12 +6,14 @@ # of patent rights can be found in the PATENTS file in the same directory. TESTS_DIR = ../../.. -include $(TESTS_DIR)/clang.make ANALYZER = linters CLANG_OPTIONS = -x objective-c -fobjc-arc -c INFER_OPTIONS = --no-filtering --debug-exceptions +INFERPRINT_OPTIONS = --issues-tests SOURCES = \ $(wildcard *.m) \ $(wildcard */*.m) \ + +include $(TESTS_DIR)/clang.make diff --git a/infer/tests/codetoanalyze/objcpp/linters/Makefile b/infer/tests/codetoanalyze/objcpp/linters/Makefile index bb9121e77..485e2f834 100644 --- a/infer/tests/codetoanalyze/objcpp/linters/Makefile +++ b/infer/tests/codetoanalyze/objcpp/linters/Makefile @@ -6,11 +6,13 @@ # of patent rights can be found in the PATENTS file in the same directory. TESTS_DIR = ../../.. -include $(TESTS_DIR)/clang.make ANALYZER = linters CLANG_OPTIONS = -x objective-c++ -std=c++11 -fobjc-arc -c INFER_OPTIONS = --no-filtering --debug-exceptions +INFERPRINT_OPTIONS = --issues-tests SOURCES = \ $(wildcard */*.mm) \ + +include $(TESTS_DIR)/clang.make