This helps lit unit test performance by a lot, especially on windows. The performance gain comes from launching one gtest executable for many subtests instead of one (this is the current situation).
The shards are executed by the test runner and the results are stored in the
json format supported by the GoogleTest. Later in the test reporting stage,
all test results in the json file are retrieved to continue the test results
summary etc.
On my Win10 desktop, before this patch: check-clang-unit: 177s, check-llvm-unit: 38s; after this patch: check-clang-unit: 37s, check-llvm-unit: 11s.
On my Linux machine, before this patch: check-clang-unit: 46s, check-llvm-unit: 8s; after this patch: check-clang-unit: 7s, check-llvm-unit: 4s.
This is the replacement for --filter and --filter-not for unit tests. Since GTEST_FILTER takes a different format of regex than --filter/--filter-not , passing --filter and --filter-not arguments for unit tests to GTEST_FILTER could be confusing to the lit user. IMHO, it would be more clear to just use GTEST_FILTER. The drawback is sacrificing a bit of consistency. Please let me know if you think otherwise.
About --xfail /--xfail-not, tests for D106022 did not cover unit tests, I could add more tests and the handling for sharding in a follow-up patch considering this patch is already big.