can-execute.txt 778 B

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