[tests] small refactor of frontend makefiles

Reviewed By: jvillard

Differential Revision: D4166862

fbshipit-source-id: 9e3c706
master
Andrzej Kotulski 8 years ago committed by Facebook Github Bot
parent 2320ed8af3
commit 6b083af4f3

@ -5,20 +5,20 @@
# LICENSE file in the root directory of this source tree. An additional grant # 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. # of patent rights can be found in the PATENTS file in the same directory.
ROOT_DIR = ../../../../.. ROOT_DIR = $(TESTS_DIR)/../..
include $(ROOT_DIR)/Makefile.config include $(ROOT_DIR)/Makefile.config
default: compile default: compile
test: capture test: capture
set -e; \ set -e; \
for file in $(FILES) ; do \ for file in $(SOURCES) ; do \
diff -u $$file.dot $$file.test.dot ; \ diff -u $$file.dot $$file.test.dot ; \
done done
$(MAKE) clean $(MAKE) clean
replace: capture replace: capture
for file in $(FILES) ; do \ for file in $(SOURCES) ; do \
mv $$file.test.dot $$file.dot ; \ mv $$file.test.dot $$file.dot ; \
done done
$(MAKE) clean $(MAKE) clean

@ -5,16 +5,18 @@
# LICENSE file in the root directory of this source tree. An additional grant # 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. # of patent rights can be found in the PATENTS file in the same directory.
include ../../Makefile.frontend TESTS_DIR=../../..
OPTIONS = -c CLANG_OPTIONS = -c
FILES = \ SOURCES = \
*/*.c \ $(wildcard */*.c) \
*/*.cpp \ $(wildcard */*.cpp) \
include $(TESTS_DIR)/clang-frontend.make
compile: compile:
clang $(OPTIONS) $(FILES) clang $(CLANG_OPTIONS) $(SOURCES)
capture: capture:
$(INFER_BIN) -a capture --frontend-tests --cxx -- clang $(OPTIONS) $(FILES) $(INFER_BIN) -a capture --frontend-tests --cxx -- clang $(CLANG_OPTIONS) $(SOURCES)

@ -5,16 +5,19 @@
# LICENSE file in the root directory of this source tree. An additional grant # 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. # of patent rights can be found in the PATENTS file in the same directory.
include ../../Makefile.frontend TESTS_DIR=../../..
# see explanations in cpp/errors/Makefile for the custom isystem # see explanations in cpp/errors/Makefile for the custom isystem
OPTIONS = -x c++ -std=c++11 -nostdinc++ -isystem$(ROOT_DIR) -isystem$(CLANG_INCLUDES)/c++/v1/ -c CLANG_OPTIONS = -x c++ -std=c++11 -nostdinc++ -isystem$(ROOT_DIR) -isystem$(CLANG_INCLUDES)/c++/v1/ -c
FILES = \ SOURCES = \
*/*.cpp shared/*/*.cpp \ $(wildcard */*.cpp) \
$(wildcard shared/*/*.cpp) \
include $(TESTS_DIR)/clang-frontend.make
compile: compile:
clang $(OPTIONS) $(FILES) clang $(CLANG_OPTIONS) $(SOURCES)
capture: capture:
$(INFER_BIN) -a capture --frontend-tests --cxx --headers -- clang $(OPTIONS) $(FILES) $(INFER_BIN) -a capture --frontend-tests --cxx --headers -- clang $(CLANG_OPTIONS) $(SOURCES)

@ -5,17 +5,17 @@
# LICENSE file in the root directory of this source tree. An additional grant # 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. # of patent rights can be found in the PATENTS file in the same directory.
include ../../Makefile.frontend TESTS_DIR=../../..
IPHONESIMULATOR_ISYSROOT_SUFFIX = /Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk IPHONESIMULATOR_ISYSROOT_SUFFIX = /Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk
XCODEROOT = $(shell xcode-select -p) XCODEROOT = $(shell xcode-select -p)
OPTIONS = -x objective-c \ CLANG_OPTIONS = -x objective-c \
-isysroot $(XCODEROOT)$(IPHONESIMULATOR_ISYSROOT_SUFFIX) \ -isysroot $(XCODEROOT)$(IPHONESIMULATOR_ISYSROOT_SUFFIX) \
-mios-simulator-version-min=8.2 --target=x86_64-apple-darwin14 -c \ -mios-simulator-version-min=8.2 --target=x86_64-apple-darwin14 -c \
FILES_NOARC = \ SOURCES_NOARC = \
block/retain_cycle.m \ block/retain_cycle.m \
block/static.m \ block/static.m \
boxing/Boxing.m \ boxing/Boxing.m \
@ -66,7 +66,7 @@ FILES_NOARC = \
vardecl/aclass_2.m \ vardecl/aclass_2.m \
vardecl/last_af.m \ vardecl/last_af.m \
FILES_ARC = \ SOURCES_ARC = \
predefined_expr/PredefinedExprExample.m \ predefined_expr/PredefinedExprExample.m \
types/attributes.m \ types/attributes.m \
types/void_call.m \ types/void_call.m \
@ -77,17 +77,16 @@ FILES_ARC = \
shared/memory_leaks_benchmark/arc_methods.m \ shared/memory_leaks_benchmark/arc_methods.m \
shared/npe/Nonnull_attribute_example.m \ shared/npe/Nonnull_attribute_example.m \
FILES = \ SOURCES = \
$(FILES_NOARC) \ $(SOURCES_NOARC) \
$(FILES_ARC) \ $(SOURCES_ARC) \
include $(TESTS_DIR)/clang-frontend.make
compile: compile:
clang $(OPTIONS) $(FILES_NOARC) clang $(CLANG_OPTIONS) $(SOURCES_NOARC)
clang $(OPTIONS) -fobjc-arc $(FILES_ARC) clang $(CLANG_OPTIONS) -fobjc-arc $(SOURCES_ARC)
capture: capture:
$(INFER_BIN) -a capture --cxx --frontend-tests --continue --reactive -- clang $(OPTIONS) $(FILES_NOARC) $(INFER_BIN) -a capture --cxx --frontend-tests --continue --reactive -- clang $(CLANG_OPTIONS) $(SOURCES_NOARC)
$(INFER_BIN) -a capture --cxx --frontend-tests -- clang $(OPTIONS) -fobjc-arc $(FILES_ARC) $(INFER_BIN) -a capture --cxx --frontend-tests -- clang $(CLANG_OPTIONS) -fobjc-arc $(SOURCES_ARC)

@ -5,25 +5,23 @@
# LICENSE file in the root directory of this source tree. An additional grant # 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. # of patent rights can be found in the PATENTS file in the same directory.
include ../../Makefile.frontend TESTS_DIR=../../..
IPHONESIMULATOR_ISYSROOT_SUFFIX = /Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk IPHONESIMULATOR_ISYSROOT_SUFFIX = /Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk
XCODEROOT = $(shell xcode-select -p) XCODEROOT = $(shell xcode-select -p)
OPTIONS = -x objective-c++ -std=c++11 \ CLANG_OPTIONS = -x objective-c++ -std=c++11 \
-isysroot $(XCODEROOT)$(IPHONESIMULATOR_ISYSROOT_SUFFIX) \ -isysroot $(XCODEROOT)$(IPHONESIMULATOR_ISYSROOT_SUFFIX) \
-mios-simulator-version-min=8.2 --target=x86_64-apple-darwin14 -c \ -mios-simulator-version-min=8.2 --target=x86_64-apple-darwin14 -c \
FILES = \ SOURCES = \
funcoverloading/af_test.mm \ $(wildcard */*.mm) \
global_const/global_const.mm \
include $(TESTS_DIR)/clang-frontend.make
compile: compile:
clang $(OPTIONS) $(FILES) clang $(CLANG_OPTIONS) $(SOURCES)
capture: capture:
$(INFER_BIN) -a capture --cxx --frontend-tests --continue --reactive -- clang $(OPTIONS) $(FILES) $(INFER_BIN) -a capture --cxx --frontend-tests --continue --reactive -- clang $(CLANG_OPTIONS) $(SOURCES)

Loading…
Cancel
Save