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