23 lines · plain
1REQUIRES: can-execute2 3This tests that we abstract two peculiarities of unix in can_execute:4 5* Directories are executable, but we don't want to try to execute them.6* For shell scripts, we also need to be able to read them.7 8The PATH is constructed such that 'not' will first find a directory named9TestProg, then a file with executable bit but not readable and finally a10shell script which always returns false, which is what it actually tries to11execute.12 13If we want, it is probably OK to change the semantics of can_execute and this14test, but for now this test serves as a reminder to audit all the callers if15we do that.16 17RUN: rm -rf %t && mkdir -p %t18RUN: cp -f %S/Inputs/TestProg/TestProg %t/TestProg19RUN: chmod 111 %t/TestProg20RUN: export PATH=%S/Inputs:%t:%S/Inputs/TestProg:$PATH21RUN: not TestProg22RUN: rm -rf %t23