Debian Codegraph @

llvm/utils/lit/tests/shtest-readfile.py

raw
1 ## Tests the readfile substitution.
2
3 # TODO(boomanaiden154): This sometimes fails, possibly due to buffers not being flushed.
4 # ALLOW_RETRIES: 2
5
6 # RUN: env LIT_USE_INTERNAL_SHELL=1 not %{lit} -v %{inputs}/shtest-readfile | FileCheck -match-full-lines -DTEMP_PATH=%S%{fs-sep}Inputs%{fs-sep}shtest-readfile%{fs-sep}Output %s
7
8 # CHECK: -- Testing: 5 tests{{.*}}
9
10 # CHECK-LABEL: FAIL: shtest-readfile :: absolute-paths.txt ({{[^)]*}})
11 # CHECK: echo hello
12 # CHECK: # executed command: echo '%{readfile:[[TEMP_PATH]]{{[\\\/]}}absolute-paths.txt.tmp}'
13
14 # CHECK-LABEL: FAIL: shtest-readfile :: env.txt ({{[^)]*}})
15 # CHECK: env TEST=hello {{.*}} -c "import os; print(os.environ['TEST'])"
16 # CHECK: # | hello
17
18 # CHECK-LABEL: FAIL: shtest-readfile :: file-does-not-exist.txt ({{[^)]*}})
19 # CHECK: # executed command: @echo 'echo %{readfile:/file/does/not/exist}'
20 # CHECK: # | File specified in readfile substitution does not exist: {{.*}}/file/does/not/exist
21
22 # CHECK-LABEL: FAIL: shtest-readfile :: relative-paths.txt ({{[^)]*}})
23 # CHECK: echo hello
24 # CHECK: # executed command: echo '%{readfile:rel_path_test_folder/test_file}'
25
26 # CHECK-LABEL: FAIL: shtest-readfile :: two-same-line.txt ({{[^)]*}})
27 # CHECK: echo hello bye
28 # CHECK: # executed command: echo '%{readfile:[[TEMP_PATH]]{{[\\\/]}}two-same-line.txt.tmp.1}' '%{readfile:[[TEMP_PATH]]{{[\\\/]}}two-same-line.txt.tmp.2}'