1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
llvm-mirror/test/Other/can-execute.txt
Fangrui Song 79f0a1e11f test/Other/can-execute.txt: delete %t after the test
This test constructs a non-readable file of mode 0111, which lingers in the test output directory and will cause EACCES to various tools (rg, rsync, ...)

llvm-svn: 342279
2018-09-14 20:41:42 +00:00

24 lines
839 B
Plaintext

REQUIRES: can-execute
REQUIRES: shell
This tests that we abstract two peculiarities of unix in can_execute:
* Directories are executable, but we don't want to try to execute them.
* For shell scripts, we also need to be able to read them.
The PATH is constructed such that 'not' will first find a directory named
TestProg, then a file with executable bit but not readable and finally a
shell script which always returns false, which is what it actually tries to
execute.
If we want, it is probably OK to change the semantics of can_execute and this
test, but for now this test serves as a reminder to audit all the callers if
we do that.
RUN: rm -rf %t && mkdir -p %t
RUN: cp -f %S/Inputs/TestProg/TestProg %t/TestProg
RUN: chmod 111 %t/TestProg
RUN: export PATH=%S/Inputs:%t:%S/Inputs/TestProg:$PATH
RUN: not TestProg
RUN: rm -rf %t