[clang] Shard out some small gtest binaries (#138021)

@nico mentioned that FormatTests and BasicTests are small binaries with
few dependencies, so keeping them separate is nice. I broke them out as
distinct test binaries, and they are still pretty small:

$ find tools/clang/unittests/ -type f -name '*Tests' | xargs du -cksh |
sort -nr
708M    total
276M    tools/clang/unittests/AllClangUnitTests
244M    tools/clang/unittests/Interpreter/ClangReplInterpreterTests
167M
tools/clang/unittests/Interpreter/ExceptionTests/ClangReplInterpreterExceptionTests
 13M    tools/clang/unittests/Format/FormatTests
6.9M    tools/clang/unittests/Basic/BasicTests
1.1M    tools/clang/unittests/libclang/CrashTests/libclangCrashTests

I also broke out libclangCrashTests and re-enabled the failing test to
resolve llvm#137855.
This commit is contained in:
Reid Kleckner
2025-04-30 16:40:21 -07:00
committed by GitHub
parent 7d05f67a73
commit afd738cd90
4 changed files with 10 additions and 5 deletions

View File

@@ -1,4 +1,6 @@
add_clang_unittest(BasicTests
# Basic tests have few LLVM and Clang dependencies, so linking it as a
# distinct target enables faster iteration times at low cost.
add_distinct_clang_unittest(BasicTests
CharInfoTest.cpp
DarwinSDKInfoTest.cpp
DiagnosticTest.cpp

View File

@@ -1,4 +1,6 @@
add_clang_unittest(FormatTests
# Format tests have few LLVM and Clang dependencies, so linking it as a
# distinct target enables faster iteration times at low cost.
add_distinct_clang_unittest(FormatTests
BracesInserterTest.cpp
BracesRemoverTest.cpp
CleanupTest.cpp

View File

@@ -1,4 +1,6 @@
add_clang_unittest(libclangCrashTests
# FIXME(#137855): Ideally we'd fold this into AllClangUnitTests, but it fails
# for unknown reasons. Until that is fixed, link it as a distinct gtest binary.
add_distinct_clang_unittest(libclangCrashTests
LibclangCrashTest.cpp
LINK_LIBS
libclang

View File

@@ -23,8 +23,7 @@ TEST_F(LibclangParseTest, InstallAbortingLLVMFatalErrorHandler) {
"");
}
// FIXME: Re-enable after Mac-AArch64 signpost crash issues are debugged.
TEST_F(LibclangParseTest, DISABLED_UninstallAbortingLLVMFatalErrorHandler) {
TEST_F(LibclangParseTest, UninstallAbortingLLVMFatalErrorHandler) {
clang_toggleCrashRecovery(0);
clang_install_aborting_llvm_fatal_error_handler();
clang_uninstall_llvm_fatal_error_handler();