Skip to content

Commit afd738c

Browse files
authored
[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 #137855.
1 parent 7d05f67 commit afd738c

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

clang/unittests/Basic/CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
add_clang_unittest(BasicTests
1+
# Basic tests have few LLVM and Clang dependencies, so linking it as a
2+
# distinct target enables faster iteration times at low cost.
3+
add_distinct_clang_unittest(BasicTests
24
CharInfoTest.cpp
35
DarwinSDKInfoTest.cpp
46
DiagnosticTest.cpp

clang/unittests/Format/CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
add_clang_unittest(FormatTests
1+
# Format tests have few LLVM and Clang dependencies, so linking it as a
2+
# distinct target enables faster iteration times at low cost.
3+
add_distinct_clang_unittest(FormatTests
24
BracesInserterTest.cpp
35
BracesRemoverTest.cpp
46
CleanupTest.cpp

clang/unittests/libclang/CrashTests/CMakeLists.txt

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

clang/unittests/libclang/CrashTests/LibclangCrashTest.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ TEST_F(LibclangParseTest, InstallAbortingLLVMFatalErrorHandler) {
2323
"");
2424
}
2525

26-
// FIXME: Re-enable after Mac-AArch64 signpost crash issues are debugged.
27-
TEST_F(LibclangParseTest, DISABLED_UninstallAbortingLLVMFatalErrorHandler) {
26+
TEST_F(LibclangParseTest, UninstallAbortingLLVMFatalErrorHandler) {
2827
clang_toggleCrashRecovery(0);
2928
clang_install_aborting_llvm_fatal_error_handler();
3029
clang_uninstall_llvm_fatal_error_handler();

0 commit comments

Comments
 (0)