Skip to content

Commit 5c17af4

Browse files
authored
[clang-tools-extra][test] Ensure file is writeable after copying (#157728)
After #157572, the invocation to clang-tidy fails w/ `Could not open <...>/crlf.cpp.tmp.dir/Inputs/crlf/crlf.cpp for writing` if run in an environment where the source tree is mounted read-only. This is because `cat` was creating a new file in a writeable dir, but running `cp` preserves the readonly file permissions from the source tree.
1 parent 27c5430 commit 5c17af4

File tree

1 file changed

+1
-0
lines changed
  • clang-tools-extra/test/clang-apply-replacements

1 file changed

+1
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// RUN: mkdir -p %t.dir/Inputs/crlf
22
// RUN: cp %S/Inputs/crlf/crlf.cpp %t.dir/Inputs/crlf/crlf.cpp
3+
// RUN: chmod u+w %t.dir/Inputs/crlf/crlf.cpp
34
// RUN: sed "s#\$(path)#%/t.dir/Inputs/crlf#" %S/Inputs/crlf/file1.yaml > %t.dir/Inputs/crlf/file1.yaml
45
// RUN: clang-apply-replacements %t.dir/Inputs/crlf
56
// RUN: diff %t.dir/Inputs/crlf/crlf.cpp %S/Inputs/crlf/crlf.cpp.expected

0 commit comments

Comments
 (0)