Sorry I was out on vacation when this thread happened. Internally at google we use a custom program to run lit tests (more details in this llvm-dev thread). I’ve got Bazel working with lit and we’re using it in IREE (replacing a hacky shell script we were using before), but llvm-lit is a whole other beast on top of lit that’s deeply entangled with the CMake build system. Additionally, lit insists on writing files with test timings and such, which is totally incompatible to Bazel’s sandboxing. In IREE, we’re able to get around that by setting the test_exec_root, but that isn’t really an option for upstream lit tests. I tried out just getting the tests of lit itself to work under Bazel and ran into that issue. Fundamentally, Bazel is already a test runner and lit is a test runner and it’s pretty hard to run one inside the other. It ended up being too much of a rabbit hole to go down.
If someone wanted to look into adding these, the lit test rules we’ve got in IREE are designed to be general, and I’d be happy to help. I think it might involve starting a conversation about making the temp file outputs from lit optional. And you will run into the scaling issues Stella mentions, though I’m not sure whether they’re actually a show stopper or just a waste of resources. I’m pretty sure that if it were my job, I could get lit to work alright under Bazel, maybe by shifting all the config parsing to build time and turning the test into just a shell test, but alas I have other priorities :-/