[make] ignore copy-copy races in clang compilation db tests

Summary: concurrency-with-parallelism

Reviewed By: mbouaziz

Differential Revision: D7908386

fbshipit-source-id: a1d7ae5
master
Jules Villard 7 years ago committed by Facebook Github Bot
parent 58f37cb9d8
commit 7cf0a5e2cc

@ -106,6 +106,10 @@ CLANG_DEPS_NO_MODELS = \
CLANG_DEPS = $(CLANG_DEPS_NO_MODELS) $(MODELS_RESULTS_FILE) \
$(shell find $(MODELS_DIR)/cpp/include -type f)
define copy_or_same_file
$(COPY) "$(1)" "$(2)" || diff -q "$(1)" "$(2)"
endef
INTERACTIVE = $(shell [ -t 0 ] && echo 1)
# remove "jobserver-fds" because it contains "s"...
SILENT = $(findstring s,$(subst jobserver-fds,,$(MAKEFLAGS)))

@ -19,7 +19,8 @@ include $(TESTS_DIR)/infer.make
../codetoanalyze/path\ with\ spaces/hel\ lo.c: ../codetoanalyze/path_with_spaces/hel_lo.c
# make does not want to interpret "$(@D)" in the right way here...
$(QUIET)$(MKDIR_P) ../codetoanalyze/path\ with\ spaces/
$(QUIET)cp "$<" "$@"
# allow copy races with other tests if they are doing the same action
$(QUIET)$(call copy_or_same_file,$<,$@)
$(QUIET)touch "$@"
compile_commands.json: compile_commands.json.in

@ -21,7 +21,8 @@ include $(TESTS_DIR)/infer.make
../codetoanalyze/path\ with\ spaces/hel\ lo.c ../codetoanalyze/path\ with\ spaces/hel\ lo2.c:
# make does not want to interpret "$(@D)" in the right way here...
$(QUIET)$(MKDIR_P) ../codetoanalyze/path\ with\ spaces/
$(QUIET)cp "$<" "$@"
# allow copy races with other tests if they are doing the same action
$(QUIET)$(call copy_or_same_file,$<,$@)
$(QUIET)touch "$@"
../codetoanalyze/path\ with\ spaces/hel\ lo.c: ../codetoanalyze/path_with_spaces/hel_lo.c
../codetoanalyze/path\ with\ spaces/hel\ lo2.c: ../codetoanalyze/path_with_spaces/hel_lo2.c

Loading…
Cancel
Save