brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · ca57db8 Raw
29 lines · python
1## Tests the readfile substitution.2 3# TODO(boomanaiden154): This sometimes fails, possibly due to buffers not being flushed.4# ALLOW_RETRIES: 25 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 %s7 8# CHECK: -- Testing: 5 tests{{.*}}9 10# CHECK-LABEL: FAIL: shtest-readfile :: absolute-paths.txt ({{[^)]*}})11# CHECK: echo hello12# 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: # | hello17 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/exist21 22# CHECK-LABEL: FAIL: shtest-readfile :: relative-paths.txt ({{[^)]*}})23# CHECK: echo hello24# 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 bye28# CHECK: # executed command: echo '%{readfile:[[TEMP_PATH]]{{[\\\/]}}two-same-line.txt.tmp.1}' '%{readfile:[[TEMP_PATH]]{{[\\\/]}}two-same-line.txt.tmp.2}'29