[lit] Use sharding for GoogleTest format
authorYuanfang Chen <yuanfang.chen@sony.com>
Sat, 2 Apr 2022 19:28:23 +0000 (12:28 -0700)
committerYuanfang Chen <yuanfang.chen@sony.com>
Mon, 4 Apr 2022 02:47:02 +0000 (19:47 -0700)
commita87ba5c86d5d72defdbcdb278baad6515ec99463
tree3fcae933b39aa87ce27b3a04c96c1921f8a9287b
parentf830392be7480f5e75760b2cbb17a45b4c8cb939
[lit] Use sharding for GoogleTest format

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.

Reviewed By: yln, rnk

Differential Revision: https://reviews.llvm.org/D122251
13 files changed:
llvm/unittests/Support/CrashRecoveryTest.cpp
llvm/unittests/Support/ProgramTest.cpp
llvm/utils/lit/lit/Test.py
llvm/utils/lit/lit/TestingConfig.py
llvm/utils/lit/lit/formats/googletest.py
llvm/utils/lit/lit/main.py
llvm/utils/lit/tests/Inputs/googletest-crash/DummySubDir/OneTest.py [new file with mode: 0644]
llvm/utils/lit/tests/Inputs/googletest-crash/lit.cfg [moved from llvm/utils/lit/tests/Inputs/googletest-upstream-format/lit.cfg with 66% similarity]
llvm/utils/lit/tests/Inputs/googletest-format/DummySubDir/OneTest.py
llvm/utils/lit/tests/Inputs/googletest-upstream-format/DummySubDir/OneTest.py [deleted file]
llvm/utils/lit/tests/googletest-crash.py [new file with mode: 0644]
llvm/utils/lit/tests/googletest-format.py
llvm/utils/lit/tests/googletest-upstream-format.py [deleted file]