[lit] Check for accidental external command calls
authorJoel E. Denny <jdenny.ornl@gmail.com>
Mon, 19 Aug 2019 22:59:37 +0000 (22:59 +0000)
committerJoel E. Denny <jdenny.ornl@gmail.com>
Mon, 19 Aug 2019 22:59:37 +0000 (22:59 +0000)
commit971a9f7eea31c6b27bf798cc8c39ede1dae8f0d2
tree2f372a4cdb82fe225f8bd650f156f6470b2fa8db
parent3f3a2573c307c4399aa3bc211cfb4d3e148798f5
[lit] Check for accidental external command calls

This patch extends lit's test suite to check that lit's internal shell
doesn't accidentally execute internal commands as external commands.
It does so by putting fake failing versions of those commands in
`PATH` while the entire lit test suite is running.  Without the fixes
in D65697 but with its tests, this approach catches accidental
external `env` calls.

Reviewed By: probinson

Differential Revision: https://reviews.llvm.org/D66293

llvm-svn: 369309
llvm/utils/lit/tests/Inputs/fake-externals/cd [new file with mode: 0755]
llvm/utils/lit/tests/Inputs/fake-externals/diff [new file with mode: 0755]
llvm/utils/lit/tests/Inputs/fake-externals/env [new file with mode: 0755]
llvm/utils/lit/tests/Inputs/fake-externals/export [new file with mode: 0755]
llvm/utils/lit/tests/Inputs/fake-externals/fake_external.py [new file with mode: 0644]
llvm/utils/lit/tests/Inputs/fake-externals/mkdir [new file with mode: 0755]
llvm/utils/lit/tests/Inputs/fake-externals/rm [new file with mode: 0755]
llvm/utils/lit/tests/lit.cfg