From 92aa0ecd9394dd07e6ce7355e2544dde7831fcda Mon Sep 17 00:00:00 2001 From: Sungkeun Cho Date: Mon, 25 Sep 2023 09:59:41 -0700 Subject: [PATCH] [test] Do not overwrite test file in clang_compilation_db_* tests Summary: This diff avoids overwriting test files in the clang_compilation_db_escaped/realpath tests. Both Makefiles of the tests are running below: ``` $(COPY) "../codetoanalyze/path_with_spaces/hel_lo.c" "../codetoanalyze/path with spaces/hel lo.c" \ || diff "../codetoanalyze/path_with_spaces/hel_lo.c" "../codetoanalyze/path with spaces/hel lo.c" ``` If they run in a bad timing, at the same time: * one is trying to copy the target file (write) * one is trying to diff the target file (read) it can introduce the `diff` running failure. This diff tries to avoid the overwriting at the copy to avoid the timing issue. Reviewed By: geralt-encore Differential Revision: D49597444 fbshipit-source-id: d6ef35b9246230dbaa0b32b8a30ee504bf1c4c4e --- Makefile.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.config b/Makefile.config index 535b0f342f9..24a192ad7da 100644 --- a/Makefile.config +++ b/Makefile.config @@ -117,7 +117,7 @@ XCODE_ISYSROOT := $(XCODE_BASE)/$(XCODE_ISYSROOT_SUFFIX) endif define copy_or_same_file - $(COPY) "$(1)" "$(2)" || diff -q "$(1)" "$(2)" + $(COPY) -n "$(1)" "$(2)" || diff "$(1)" "$(2)" endef INTERACTIVE := $(shell [ -t 0 ] && ! [ x"$$TERM" = xdumb ] && echo 1)