File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -733,7 +733,11 @@ def _replaceReadFile(match):
733733 with open (filePath ) as fileHandle :
734734 return fileHandle .read ()
735735 except FileNotFoundError :
736- raise InternalShellError (cmd , "File does not exist: %s" % filePath )
736+ raise InternalShellError (
737+ cmd ,
738+ "File specified in readfile substitution does not exist: %s"
739+ % filePath ,
740+ )
737741
738742 arguments [i ] = re .sub (r"%{readfile:([^}]*)}" , _replaceReadFile , arg )
739743
Original file line number Diff line number Diff line change 11## Tests the readfile substitution.
22
3- # RUN: not %{lit} -a -v %{inputs}/shtest-readfile | FileCheck -match-full-lines -DTEMP_PATH=%S/ Inputs/ shtest-readfile/ Output %s
3+ # RUN: not %{lit} -a -v %{inputs}/shtest-readfile | FileCheck -match-full-lines -DTEMP_PATH=%S%{fs-sep} Inputs%{fs-sep} shtest-readfile%{fs-sep} Output %s
44
55# CHECK: -- Testing: 4 tests{{.*}}
66
77# CHECK-LABEL: FAIL: shtest-readfile :: absolute-paths.txt ({{[^)]*}})
88# CHECK: echo hello
9- # CHECK: # executed command: echo '%{readfile:[[TEMP_PATH]]/ absolute-paths.txt.tmp}'
9+ # CHECK: # executed command: echo '%{readfile:[[TEMP_PATH]]{{[\\\/]}} absolute-paths.txt.tmp}'
1010
1111# CHECK-LABEL: FAIL: shtest-readfile :: file-does-not-exist.txt ({{[^)]*}})
1212# CHECK: # executed command: @echo 'echo %{readfile:/file/does/not/exist}'
13- # CHECK: # | File does not exist: /file/does/not/exist
13+ # CHECK: # | File specified in readfile substitution does not exist: /file/does/not/exist
1414
1515# CHECK-LABEL: FAIL: shtest-readfile :: relative-paths.txt ({{[^)]*}})
1616# CHECK: echo hello
1717# CHECK: # executed command: echo '%{readfile:rel_path_test_folder/test_file}'
1818
1919# CHECK-LABEL: FAIL: shtest-readfile :: two-same-line.txt ({{[^)]*}})
2020# CHECK: echo hello bye
21- # CHECK: # executed command: echo '%{readfile:[[TEMP_PATH]]/ two-same-line.txt.tmp.1}' '%{readfile:[[TEMP_PATH]]/ two-same-line.txt.tmp.2}'
21+ # CHECK: # executed command: echo '%{readfile:[[TEMP_PATH]]{{[\\\/]}} two-same-line.txt.tmp.1}' '%{readfile:[[TEMP_PATH]]{{[\\\/]}} two-same-line.txt.tmp.2}'
You can’t perform that action at this time.
0 commit comments