[libc-commits] [libc] [libc][cmake] Unify test suite creation and hierarchy in add_libc_testsuite. (PR #234465)

via libc-commits libc-commits at lists.llvm.org
Wed Oct 21 19:52:50 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: lntue

<details>
<summary>Changes</summary>

- Expand `add_libc_testsuite` to unconditionally create `<suite_name>` and `<suite_name>-build` and wire them into `<parent_suite>` and `<parent_suite>-build` (defaulting to `libc-tests` unless `ROOT` or `PARENT <parent_suite>` is specified).
- Remove lazy test suite creation.
- Folding `add_libc_exhaustive_testsuite`, `add_libc_long_running_testsuite`, and `add_libc_integration_test_suite` into `add_libc_testsuite`.
- Consolidate `NO_RUN_POSTBUILD` and exhaustive suites into a single `BUILD_ONLY` option across `add_libc_testsuite` and `add_libc_test`, naming executables `*.__build_only__` so Lit ignores them during `check-libc` while keeping `<fq_target_name>` runner targets for manual invocation.
- Migrate all test suite definitions across `libc/test/` and `libc/benchmarks/gpu/` to `add_libc_testsuite` and standardize suite names on `libc-*-tests` and `libc-*-integration-tests`.

Assisted-by: Gemini

---

Patch is 209.91 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/234465.diff


118 Files Affected:

- (modified) libc/benchmarks/gpu/CMakeLists.txt (+1-6) 
- (modified) libc/benchmarks/gpu/src/ctype/CMakeLists.txt (+1-1) 
- (modified) libc/benchmarks/gpu/src/math/CMakeLists.txt (+1-1) 
- (modified) libc/cmake/modules/LLVMLibCTestRules.cmake (+69-96) 
- (modified) libc/cmake/modules/LibcParseArguments.cmake (+2-5) 
- (modified) libc/src/math/docs/add_math_function.md (+1-1) 
- (modified) libc/test/CMakeLists.txt (+1-8) 
- (modified) libc/test/include/CMakeLists.txt (+47-47) 
- (modified) libc/test/include/net/linux/CMakeLists.txt (+1-1) 
- (modified) libc/test/integration/CMakeLists.txt (+1-7) 
- (modified) libc/test/integration/src/__support/GPU/CMakeLists.txt (+5-6) 
- (modified) libc/test/integration/src/__support/threads/CMakeLists.txt (+1-1) 
- (modified) libc/test/integration/src/pthread/CMakeLists.txt (+1-1) 
- (modified) libc/test/integration/src/spawn/CMakeLists.txt (+2-3) 
- (modified) libc/test/integration/src/stdio/CMakeLists.txt (+4-4) 
- (modified) libc/test/integration/src/stdio/gpu/CMakeLists.txt (+2-3) 
- (modified) libc/test/integration/src/stdlib/CMakeLists.txt (+10-10) 
- (modified) libc/test/integration/src/stdlib/gpu/CMakeLists.txt (+5-6) 
- (modified) libc/test/integration/src/sys/ptrace/linux/CMakeLists.txt (+2-3) 
- (modified) libc/test/integration/src/sys/sem/CMakeLists.txt (+2-3) 
- (modified) libc/test/integration/src/threads/CMakeLists.txt (+1-1) 
- (modified) libc/test/integration/src/ucontext/CMakeLists.txt (+1-1) 
- (modified) libc/test/integration/src/unistd/CMakeLists.txt (+12-13) 
- (modified) libc/test/integration/startup/CMakeLists.txt (-59) 
- (modified) libc/test/integration/startup/gpu/CMakeLists.txt (+1-2) 
- (modified) libc/test/integration/startup/linux/CMakeLists.txt (+1-2) 
- (modified) libc/test/integration/startup/uefi/CMakeLists.txt (+1-2) 
- (modified) libc/test/src/__support/CMakeLists.txt (+3-3) 
- (modified) libc/test/src/__support/CPP/CMakeLists.txt (+1-1) 
- (modified) libc/test/src/__support/FPUtil/CMakeLists.txt (+1-1) 
- (modified) libc/test/src/__support/OSUtil/CMakeLists.txt (+1-1) 
- (modified) libc/test/src/__support/RPC/CMakeLists.txt (+1-1) 
- (modified) libc/test/src/__support/fixed_point/CMakeLists.txt (+1-1) 
- (modified) libc/test/src/__support/threads/CMakeLists.txt (+1-1) 
- (modified) libc/test/src/__support/time/CMakeLists.txt (+1-1) 
- (modified) libc/test/src/__support/wchar/CMakeLists.txt (+5-5) 
- (modified) libc/test/src/__support/wctype/CMakeLists.txt (+1-1) 
- (modified) libc/test/src/arpa/inet/CMakeLists.txt (+10-10) 
- (modified) libc/test/src/assert/CMakeLists.txt (+2-2) 
- (modified) libc/test/src/compiler/CMakeLists.txt (+2-2) 
- (modified) libc/test/src/complex/CMakeLists.txt (+25-25) 
- (modified) libc/test/src/ctype/CMakeLists.txt (+1-1) 
- (modified) libc/test/src/dirent/CMakeLists.txt (+5-5) 
- (modified) libc/test/src/err/CMakeLists.txt (+9-9) 
- (modified) libc/test/src/errno/CMakeLists.txt (+2-2) 
- (modified) libc/test/src/fcntl/CMakeLists.txt (+7-7) 
- (modified) libc/test/src/fcntl/linux/CMakeLists.txt (+1-1) 
- (modified) libc/test/src/fenv/CMakeLists.txt (+10-10) 
- (modified) libc/test/src/fnmatch/CMakeLists.txt (+1-1) 
- (modified) libc/test/src/glob/CMakeLists.txt (+1-1) 
- (modified) libc/test/src/grp/CMakeLists.txt (+10-10) 
- (modified) libc/test/src/inttypes/CMakeLists.txt (+7-7) 
- (modified) libc/test/src/libgen/CMakeLists.txt (+1-1) 
- (modified) libc/test/src/libintl/CMakeLists.txt (+1-1) 
- (modified) libc/test/src/link/CMakeLists.txt (+2-2) 
- (modified) libc/test/src/locale/CMakeLists.txt (+1-1) 
- (modified) libc/test/src/math/CMakeLists.txt (+282-285) 
- (modified) libc/test/src/math/exhaustive/CMakeLists.txt (+51-101) 
- (modified) libc/test/src/math/smoke/CMakeLists.txt (+5-5) 
- (modified) libc/test/src/mathvec/CMakeLists.txt (+32-32) 
- (modified) libc/test/src/mathvec/exhaustive/CMakeLists.txt (+32-63) 
- (modified) libc/test/src/net/linux/CMakeLists.txt (+4-4) 
- (modified) libc/test/src/netdb/CMakeLists.txt (+1-1) 
- (modified) libc/test/src/netinet/CMakeLists.txt (+3-3) 
- (modified) libc/test/src/netinet/ether/CMakeLists.txt (+3-3) 
- (modified) libc/test/src/nl_types/CMakeLists.txt (+1-1) 
- (modified) libc/test/src/poll/CMakeLists.txt (+3-3) 
- (modified) libc/test/src/pthread/CMakeLists.txt (+5-5) 
- (modified) libc/test/src/pwd/CMakeLists.txt (+8-8) 
- (modified) libc/test/src/regex/CMakeLists.txt (+3-3) 
- (modified) libc/test/src/sched/CMakeLists.txt (+14-14) 
- (modified) libc/test/src/sched/linux/CMakeLists.txt (+1-1) 
- (modified) libc/test/src/search/CMakeLists.txt (+6-6) 
- (modified) libc/test/src/semaphore/CMakeLists.txt (+6-6) 
- (modified) libc/test/src/semaphore/linux/CMakeLists.txt (+1-1) 
- (modified) libc/test/src/setjmp/CMakeLists.txt (+3-3) 
- (modified) libc/test/src/signal/CMakeLists.txt (+11-11) 
- (modified) libc/test/src/spawn/CMakeLists.txt (+2-2) 
- (modified) libc/test/src/stdbit/CMakeLists.txt (+1-1) 
- (modified) libc/test/src/stdfix/CMakeLists.txt (+1-1) 
- (modified) libc/test/src/stdio/CMakeLists.txt (+43-43) 
- (modified) libc/test/src/stdio/scanf_core/CMakeLists.txt (+3-3) 
- (modified) libc/test/src/stdlib/CMakeLists.txt (+1-1) 
- (modified) libc/test/src/string/CMakeLists.txt (+1-1) 
- (modified) libc/test/src/strings/CMakeLists.txt (+1-1) 
- (modified) libc/test/src/sys/auxv/linux/CMakeLists.txt (+2-2) 
- (modified) libc/test/src/sys/epoll/linux/CMakeLists.txt (+7-7) 
- (modified) libc/test/src/sys/eventfd/linux/CMakeLists.txt (+2-2) 
- (modified) libc/test/src/sys/file/linux/CMakeLists.txt (+2-2) 
- (modified) libc/test/src/sys/inotify/linux/CMakeLists.txt (+5-5) 
- (modified) libc/test/src/sys/ioctl/linux/CMakeLists.txt (+2-2) 
- (modified) libc/test/src/sys/ipc/linux/CMakeLists.txt (+2-2) 
- (modified) libc/test/src/sys/mman/linux/CMakeLists.txt (+13-13) 
- (modified) libc/test/src/sys/personality/linux/CMakeLists.txt (+2-2) 
- (modified) libc/test/src/sys/prctl/linux/CMakeLists.txt (+2-2) 
- (modified) libc/test/src/sys/random/linux/CMakeLists.txt (+3-3) 
- (modified) libc/test/src/sys/resource/CMakeLists.txt (+4-4) 
- (modified) libc/test/src/sys/select/CMakeLists.txt (+5-5) 
- (modified) libc/test/src/sys/sem/linux/CMakeLists.txt (+2-2) 
- (modified) libc/test/src/sys/sendfile/CMakeLists.txt (+2-2) 
- (modified) libc/test/src/sys/socket/linux/CMakeLists.txt (+15-15) 
- (modified) libc/test/src/sys/stat/CMakeLists.txt (+16-16) 
- (modified) libc/test/src/sys/statfs/linux/CMakeLists.txt (+3-3) 
- (modified) libc/test/src/sys/statvfs/linux/CMakeLists.txt (+3-3) 
- (modified) libc/test/src/sys/sysinfo/CMakeLists.txt (+2-2) 
- (modified) libc/test/src/sys/sysmacros/linux/CMakeLists.txt (+2-2) 
- (modified) libc/test/src/sys/time/CMakeLists.txt (+5-5) 
- (modified) libc/test/src/sys/uio/CMakeLists.txt (+3-3) 
- (modified) libc/test/src/sys/utsname/CMakeLists.txt (+2-2) 
- (modified) libc/test/src/sys/wait/CMakeLists.txt (+4-4) 
- (modified) libc/test/src/sys/xattr/CMakeLists.txt (+4-4) 
- (modified) libc/test/src/termios/CMakeLists.txt (+4-4) 
- (modified) libc/test/src/time/CMakeLists.txt (+23-23) 
- (modified) libc/test/src/ucontext/CMakeLists.txt (+2-2) 
- (modified) libc/test/src/unistd/CMakeLists.txt (+70-70) 
- (modified) libc/test/src/wchar/CMakeLists.txt (+59-59) 
- (modified) libc/test/src/wctype/CMakeLists.txt (+17-17) 
- (modified) libc/test/utils/UnitTest/CMakeLists.txt (+2-2) 


``````````diff
diff --git a/libc/benchmarks/gpu/CMakeLists.txt b/libc/benchmarks/gpu/CMakeLists.txt
index c7befd869fe27e..85e768ddf93adc 100644
--- a/libc/benchmarks/gpu/CMakeLists.txt
+++ b/libc/benchmarks/gpu/CMakeLists.txt
@@ -1,6 +1,6 @@
 add_subdirectory(timing)
 
-add_custom_target(gpu-benchmark)
+add_libc_testsuite(gpu-benchmark ROOT)
 
 function(add_benchmark benchmark_name)
   cmake_parse_arguments(
@@ -16,7 +16,6 @@ function(add_benchmark benchmark_name)
   endif()
   add_libc_test(
     ${benchmark_name}
-    IS_GPU_BENCHMARK
     FULL_BUILD_ONLY
     LINK_LIBRARIES
       LibcGpuBenchmark
@@ -28,10 +27,6 @@ function(add_benchmark benchmark_name)
     COMPILE_OPTIONS
       -flto
   )
-  get_fq_target_name(${benchmark_name} fq_target_name)
-  if(TARGET ${fq_target_name})
-    add_dependencies(gpu-benchmark ${fq_target_name})
-  endif()
 endfunction()
 
 function(add_benchmark_framework_library name)
diff --git a/libc/benchmarks/gpu/src/ctype/CMakeLists.txt b/libc/benchmarks/gpu/src/ctype/CMakeLists.txt
index f277624dbb9016..f8654e709c2a11 100644
--- a/libc/benchmarks/gpu/src/ctype/CMakeLists.txt
+++ b/libc/benchmarks/gpu/src/ctype/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_custom_target(libc-gpu-ctype-benchmarks)
+add_libc_testsuite(libc-gpu-ctype-benchmarks PARENT gpu-benchmark)
 
 add_benchmark(
   isalnum_benchmark
diff --git a/libc/benchmarks/gpu/src/math/CMakeLists.txt b/libc/benchmarks/gpu/src/math/CMakeLists.txt
index c94e44606a85ef..a5b40d2783ef76 100644
--- a/libc/benchmarks/gpu/src/math/CMakeLists.txt
+++ b/libc/benchmarks/gpu/src/math/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_custom_target(libc-gpu-math-benchmarks)
+add_libc_testsuite(libc-gpu-math-benchmarks PARENT gpu-benchmark)
 
 set(math_benchmark_flags "")
 if(LIBC_TARGET_ARCHITECTURE_IS_NVPTX)
diff --git a/libc/cmake/modules/LLVMLibCTestRules.cmake b/libc/cmake/modules/LLVMLibCTestRules.cmake
index bc3adc79644ec9..1c7a4252a69d6b 100644
--- a/libc/cmake/modules/LLVMLibCTestRules.cmake
+++ b/libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -317,28 +317,42 @@ if(LLVM_INCLUDE_TESTS AND LLVM_LIBC_FULL_BUILD AND NOT LIBC_TARGET_OS_IS_GPU AND
 endif()
 
 # Rule to add a test suite in the hierarchy.
-# Automatically creates <suite_name> (run target) and <suite_name>-build (build target).
-# Connects them to libc-tests and libc-tests-build.
+# Usage:
+#   add_libc_testsuite(
+#     <suite_name>
+#     [PARENT <parent_suite> | ROOT]
+#     [BUILD_ONLY]
+#   )
+# Automatically creates <suite_name> (run target) and <suite_name>-build (build target),
+# and connects them to <parent_suite> (defaulting to libc-tests unless ROOT is specified).
 function(add_libc_testsuite suite_name)
-  if(NOT TARGET ${suite_name})
-    add_custom_target(${suite_name})
-  endif()
+  llvm_libc_parse_arguments(SUITE ${ARGN})
 
-  if(NOT TARGET ${suite_name}-build)
-    add_custom_target(${suite_name}-build)
-    add_dependencies(libc-tests ${suite_name})
-    add_dependencies(libc-tests-build ${suite_name}-build)
+  if(SUITE_ROOT AND SUITE_PARENT)
+    message(FATAL_ERROR
+      "Cannot specify both ROOT and PARENT for test suite ${suite_name}.")
   endif()
-endfunction()
 
-function(add_libc_exhaustive_testsuite suite_name)
-  add_libc_testsuite(${suite_name})
-  add_dependencies(exhaustive-check-libc ${suite_name})
-endfunction()
+  add_custom_target(${suite_name})
+  add_custom_target(${suite_name}-build)
+
+  if(SUITE_BUILD_ONLY)
+    set_target_properties(${suite_name} PROPERTIES BUILD_ONLY TRUE)
+  endif()
 
-function(add_libc_long_running_testsuite suite_name)
-  add_libc_testsuite(${suite_name})
-  add_dependencies(libc-long-running-tests ${suite_name})
+  if(NOT SUITE_ROOT)
+    if(SUITE_PARENT)
+      set(parent_suite ${SUITE_PARENT})
+    else()
+      set(parent_suite libc-tests)
+    endif()
+    if(SUITE_BUILD_ONLY)
+      add_dependencies(${parent_suite} ${suite_name}-build)
+    else()
+      add_dependencies(${parent_suite} ${suite_name})
+    endif()
+    add_dependencies(${parent_suite}-build ${suite_name}-build)
+  endif()
 endfunction()
 
 # Helper function for create_libc_test: returns the list of libc entrypoints
@@ -630,16 +644,14 @@ function(_add_libc_test_runner fq_target_name fq_build_target_name test_args loa
 endfunction()
 
 # Helper function for create_libc_test: registers the test and its build target
-# with the appropriate test suite (or libc-tests / libc-tests-build).
-function(_register_libc_test_with_suite fq_target_name fq_build_target_name suite)
-  if(suite)
-    add_libc_testsuite(${suite})
-    add_dependencies(${suite} ${fq_target_name})
-    add_dependencies(${suite}-build ${fq_build_target_name})
+# with the appropriate test suite.
+function(_register_libc_test_with_suite fq_target_name fq_build_target_name suite build_only)
+  if(build_only)
+    add_dependencies(${suite} ${fq_build_target_name})
   else()
-    add_dependencies(libc-tests ${fq_target_name})
-    add_dependencies(libc-tests-build ${fq_build_target_name})
+    add_dependencies(${suite} ${fq_target_name})
   endif()
+  add_dependencies(${suite}-build ${fq_build_target_name})
 endfunction()
 
 # Core rule to create a libc test executable and runner (overlay or hermetic).
@@ -650,6 +662,11 @@ function(create_libc_test fq_target_name)
 
   llvm_libc_parse_arguments(TEST ${ARGN})
 
+  if(NOT TEST_SUITE)
+    message(FATAL_ERROR "SUITE not specified for ${fq_target_name}.")
+  endif()
+  get_target_property(suite_build_only ${TEST_SUITE} BUILD_ONLY)
+
   # 1. Validate build mode, target platform, and external library requirements
   if(TEST_NEED_MPC)
     set(TEST_NEED_MPFR TRUE)
@@ -768,8 +785,8 @@ function(create_libc_test fq_target_name)
   endif()
 
   # 3. Create the test executable
-  if(TEST_NO_RUN_POSTBUILD)
-    set(fq_build_target_name ${fq_target_name})
+  if(TEST_BUILD_ONLY OR suite_build_only)
+    set(fq_build_target_name ${fq_target_name}.__build_only__)
   else()
     set(fq_build_target_name ${fq_target_name}.__build__)
   endif()
@@ -827,25 +844,22 @@ function(create_libc_test fq_target_name)
     ${fq_deps_list}
   )
 
-  # 5. Add test runner target if post-build run is enabled
-  if(NOT TEST_NO_RUN_POSTBUILD)
-    _add_libc_test_runner(
-      ${fq_target_name}
-      ${fq_build_target_name}
-      "${TEST_ARGS}"
-      "${TEST_LOADER_ARGS}"
-      "${TEST_ENV}"
-    )
-  endif()
+  # 5. Add test runner target
+  _add_libc_test_runner(
+    ${fq_target_name}
+    ${fq_build_target_name}
+    "${TEST_ARGS}"
+    "${TEST_LOADER_ARGS}"
+    "${TEST_ENV}"
+  )
 
   # 6. Register with test suite
-  if(TEST_IS_GPU_BENCHMARK)
-    if(TEST_SUITE)
-      add_dependencies(${TEST_SUITE} ${fq_target_name})
-    endif()
-  else()
-    _register_libc_test_with_suite(${fq_target_name} ${fq_build_target_name} "${TEST_SUITE}")
-  endif()
+  _register_libc_test_with_suite(
+    ${fq_target_name}
+    ${fq_build_target_name}
+    "${TEST_SUITE}"
+    "${TEST_BUILD_ONLY}"
+  )
 endfunction()
 
 
@@ -1091,60 +1105,19 @@ function(add_integration_test test_name)
     libc.test.IntegrationTest.test
     ${INTEGRATION_TEST_DEPENDS})
 
-  # We have to use a separate var to store the command as a list because
-  # the COMMAND option of `add_custom_target` cannot handle empty vars in the
-  # command. For example, if INTEGRATION_TEST_ENV is empty, the actual
-  # command also will not run. So, we use this list and tell `add_custom_target`
-  # to expand the list (by including the option COMMAND_EXPAND_LISTS). This
-  # makes `add_custom_target` construct the correct command and execute it.
-  set(test_cmd
-    ${INTEGRATION_TEST_ENV}
-    $<$<BOOL:${LIBC_TARGET_ARCHITECTURE_IS_NVPTX}>:LIBOMPTARGET_STACK_SIZE=3072>
-    ${CMAKE_CROSSCOMPILING_EMULATOR}
-    ${INTEGRATION_TEST_LOADER_ARGS}
-    $<TARGET_FILE:${fq_build_target_name}> ${INTEGRATION_TEST_ARGS})
-  # Generate a sidecar .params file alongside the executable for any test that
-  # requires specific command-line arguments or environment variables.  The
-  # LibcTest lit format reads this file at test time.  Format: one arg per line,
-  # a "---" separator, then one KEY=VALUE env entry per line.
-  set(_params_content "")
-  foreach(_arg IN LISTS INTEGRATION_TEST_LOADER_ARGS)
-    string(APPEND _params_content "${_arg}\n")
-  endforeach()
-  string(APPEND _params_content "---\n")
-  foreach(_arg IN LISTS INTEGRATION_TEST_ARGS)
-    string(APPEND _params_content "${_arg}\n")
-  endforeach()
-  string(APPEND _params_content "---\n")
-  foreach(_env_entry IN LISTS INTEGRATION_TEST_ENV)
-    string(APPEND _params_content "${_env_entry}\n")
-  endforeach()
-
-  if(INTEGRATION_TEST_LOADER_ARGS OR INTEGRATION_TEST_ARGS OR INTEGRATION_TEST_ENV)
-    file(GENERATE
-      OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${fq_build_target_name}.params"
-      CONTENT "${_params_content}"
-    )
-  endif()
-
-  add_custom_target(
+  _add_libc_test_runner(
     ${fq_target_name}
-    COMMAND ${test_cmd}
-    COMMAND_EXPAND_LISTS
-    COMMENT "Running integration test ${fq_target_name}"
+    ${fq_build_target_name}
+    "${INTEGRATION_TEST_ARGS}"
+    "${INTEGRATION_TEST_LOADER_ARGS}"
+    "${INTEGRATION_TEST_ENV}"
+  )
+  _register_libc_test_with_suite(
+    ${fq_target_name}
+    ${fq_build_target_name}
+    "${INTEGRATION_TEST_SUITE}"
+    FALSE
   )
-  if(INTEGRATION_TEST_SUITE)
-    add_dependencies(${INTEGRATION_TEST_SUITE} ${fq_target_name})
-    # If a target named ${INTEGRATION_TEST_SUITE}-build exists, we add the
-    # test executable to it as a dependency. This allows building the
-    # test binaries for Lit without triggering their execution.
-    if(TARGET ${INTEGRATION_TEST_SUITE}-build)
-      add_dependencies(${INTEGRATION_TEST_SUITE}-build ${fq_build_target_name})
-    endif()
-  endif()
-  if(TARGET libc-integration-tests-build)
-    add_dependencies(libc-integration-tests-build ${fq_build_target_name})
-  endif()
 endfunction()
 
 # A unified function to add a libc test.
diff --git a/libc/cmake/modules/LibcParseArguments.cmake b/libc/cmake/modules/LibcParseArguments.cmake
index 990a67284bdaa1..b21eee60a9ce15 100644
--- a/libc/cmake/modules/LibcParseArguments.cmake
+++ b/libc/cmake/modules/LibcParseArguments.cmake
@@ -25,7 +25,7 @@
 #
 #      add_libc_test(
 #        sin_test
-#        SUITE libc_math_tests
+#        SUITE libc-math-tests
 #        SRCS sin_test.cpp
 #        DEPENDS libc.src.math.sin
 #        OVERLAY_DEPENDS libc.test.UnitTest.OverlaySupport
@@ -48,7 +48,7 @@
 #      add_libc_test(
 #        loader_test
 #        FULL_BUILD_ONLY
-#        SUITE libc_loader_tests
+#        SUITE libc-loader-tests
 #        SRCS loader_test.cpp
 #        DEPENDS ...
 #      )
@@ -87,16 +87,13 @@ set(LLVM_LIBC_OPTIONAL_ARGS
   REDIRECTED
   SKIPPED
   NO_GPU_BUNDLE
-  NO_RUN_POSTBUILD
   C_TEST
   NEED_MPFR
   NEED_MPFR_F80
   NEED_MPFR_F128
   NEED_MPC
-  IS_GPU_BENCHMARK
   FP_TEST
   BUILD_ONLY
-  EXHAUSTIVE
   ROOT
   PACKAGE_VARIANTS
   DISPATCH_VARIANTS
diff --git a/libc/src/math/docs/add_math_function.md b/libc/src/math/docs/add_math_function.md
index 0fff2ffd04653c..bd017f1b01b7dd 100644
--- a/libc/src/math/docs/add_math_function.md
+++ b/libc/src/math/docs/add_math_function.md
@@ -217,7 +217,7 @@ implementation (which is very often glibc).
 
 - Run math smoke and unit tests:
 ```
-  $ ninja libc-math-unittests
+  $ ninja libc-math-tests
 ```
 
 - Build and Run a specific unit test:
diff --git a/libc/test/CMakeLists.txt b/libc/test/CMakeLists.txt
index 19fb6ea4a369ff..ae9cd0e4b028f8 100644
--- a/libc/test/CMakeLists.txt
+++ b/libc/test/CMakeLists.txt
@@ -1,11 +1,4 @@
-add_custom_target(libc-tests)
-
-add_custom_target(exhaustive-check-libc)
-add_custom_target(libc-long-running-tests)
-
-# Build-only targets for lit (don't run tests, just build executables)
-add_custom_target(libc-tests-build)
-add_custom_target(libc-integration-tests-build)
+add_libc_testsuite(libc-tests ROOT)
 
 # Configure the site config file for lit
 configure_lit_site_cfg(
diff --git a/libc/test/include/CMakeLists.txt b/libc/test/include/CMakeLists.txt
index a63e1638418467..fb52c23f64bffb 100644
--- a/libc/test/include/CMakeLists.txt
+++ b/libc/test/include/CMakeLists.txt
@@ -1,9 +1,9 @@
-add_libc_testsuite(libc_include_tests)
+add_libc_testsuite(libc-include-tests)
 
 add_libc_test(
   alloca_test
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     alloca_test.cpp
   DEPENDS
@@ -13,7 +13,7 @@ add_libc_test(
 add_libc_test(
   assert_test
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     assert_test.cpp
   DEPENDS
@@ -23,7 +23,7 @@ add_libc_test(
 add_libc_test(
   complex_test
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     complex_test.cpp
   DEPENDS
@@ -33,7 +33,7 @@ add_libc_test(
 add_libc_test(
   unistd_macros_test
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     unistd_macros_test.cpp
   DEPENDS
@@ -42,7 +42,7 @@ add_libc_test(
 add_libc_test(
   sys_queue_test
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     sys/queue_test.cpp
   DEPENDS
@@ -57,7 +57,7 @@ add_libc_test(
 add_libc_test(
   stdbit_test
   SUITE
-    libc_include_tests
+    libc-include-tests
   HDRS
     stdbit_stub.h
   SRCS
@@ -75,7 +75,7 @@ add_libc_test(
   stdbit_c_test
   C_TEST
   SUITE
-    libc_include_tests
+    libc-include-tests
   HDRS
     stdbit_stub.h
   SRCS
@@ -97,7 +97,7 @@ add_libc_test(
 add_libc_test(
   stdckdint_test
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     stdckdint_test.cpp
   DEPENDS
@@ -107,7 +107,7 @@ add_libc_test(
 add_libc_test(
   sched_test
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     sched_test.cpp
   DEPENDS
@@ -118,7 +118,7 @@ add_libc_test(
 add_libc_test(
   issubnormal_test
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     issubnormal_test.cpp
   DEPENDS
@@ -128,7 +128,7 @@ add_libc_test(
 add_libc_test(
   issubnormalf_test
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     issubnormalf_test.cpp
   DEPENDS
@@ -138,7 +138,7 @@ add_libc_test(
 add_libc_test(
   issubnormall_test
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     issubnormall_test.cpp
   DEPENDS
@@ -148,7 +148,7 @@ add_libc_test(
 add_libc_test(
   isnormal_test
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     isnormal_test.cpp
   DEPENDS
@@ -158,7 +158,7 @@ add_libc_test(
 add_libc_test(
   isnormalf_test
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     isnormalf_test.cpp
   DEPENDS
@@ -168,7 +168,7 @@ add_libc_test(
 add_libc_test(
   isnormall_test
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     isnormall_test.cpp
   DEPENDS
@@ -178,7 +178,7 @@ add_libc_test(
 add_libc_test(
   fpclassify_test
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     fpclassify_test.cpp
   DEPENDS
@@ -188,7 +188,7 @@ add_libc_test(
 add_libc_test(
   fpclassifyf_test
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     fpclassifyf_test.cpp
   DEPENDS
@@ -198,7 +198,7 @@ add_libc_test(
 add_libc_test(
   fpclassifyl_test
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     fpclassifyl_test.cpp
   DEPENDS
@@ -208,7 +208,7 @@ add_libc_test(
 add_libc_test(
   iszero_test
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     iszero_test.cpp
   DEPENDS
@@ -218,7 +218,7 @@ add_libc_test(
 add_libc_test(
   iszerof_test
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     iszerof_test.cpp
   DEPENDS
@@ -228,7 +228,7 @@ add_libc_test(
 add_libc_test(
   iszerol_test
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     iszerol_test.cpp
   DEPENDS
@@ -238,7 +238,7 @@ add_libc_test(
 add_libc_test(
   netinet_in_test
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     netinet_in_test.cpp
   DEPENDS
@@ -250,7 +250,7 @@ add_subdirectory(net)
 add_libc_test(
   signbit_test
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     signbit_test.cpp
   DEPENDS
@@ -260,7 +260,7 @@ add_libc_test(
 add_libc_test(
   signbitf_test
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     signbitf_test.cpp
   DEPENDS
@@ -270,7 +270,7 @@ add_libc_test(
 add_libc_test(
   signbitl_test
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     signbitl_test.cpp
   DEPENDS
@@ -280,7 +280,7 @@ add_libc_test(
 add_libc_test(
   isnan_test
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     isnan_test.cpp
   DEPENDS
@@ -290,7 +290,7 @@ add_libc_test(
 add_libc_test(
   isnanf_test
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     isnanf_test.cpp
   DEPENDS
@@ -300,7 +300,7 @@ add_libc_test(
 add_libc_test(
   isnanl_test
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     isnanl_test.cpp
   DEPENDS
@@ -310,7 +310,7 @@ add_libc_test(
 add_libc_test(
   isinf_test
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     isinf_test.cpp
   DEPENDS
@@ -320,7 +320,7 @@ add_libc_test(
 add_libc_test(
   isinff_test
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     isinff_test.cpp
   DEPENDS
@@ -330,7 +330,7 @@ add_libc_test(
 add_libc_test(
   isinfl_test
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     isinfl_test.cpp
   DEPENDS
@@ -340,7 +340,7 @@ add_libc_test(
 add_libc_test(
   isfinite_test
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     isfinite_test.cpp
   DEPENDS
@@ -350,7 +350,7 @@ add_libc_test(
 add_libc_test(
   isfinitef_test
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     isfinitef_test.cpp
   DEPENDS
@@ -360,7 +360,7 @@ add_libc_test(
 add_libc_test(
   isfinitel_test
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     isfinitel_test.cpp
   DEPENDS
@@ -371,7 +371,7 @@ add_libc_test(
   signbit_c_test
   C_TEST
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     signbit_test.c
   COMPILE_OPTIONS
@@ -385,7 +385,7 @@ add_libc_test(
   isnan_c_test
   C_TEST
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     isnan_test.c
   COMPILE_OPTIONS
@@ -399,7 +399,7 @@ add_libc_test(
   isnormal_c_test
   C_TEST
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     isnormal_test.c
   COMPILE_OPTIONS
@@ -414,7 +414,7 @@ add_libc_test(
 #   issignaling_c_test
 #   C_TEST
 #   SUITE
-#     libc_include_tests
+#     libc-include-tests
 #   SRCS
 #     issignaling_test.c
 #   COMPILE_OPTIONS
@@ -431,7 +431,7 @@ add_libc_test(
 #   iscanonical_c_test
 #   C_TEST
 #   SUITE
-#     libc_include_tests
+#     libc-include-tests
 #   SRCS
 #     iscanonical_test.c
 #   COMPILE_OPTIONS
@@ -450,7 +450,7 @@ add_libc_test(
   isinf_c_test
   C_TEST
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     isinf_test.c
   COMPILE_OPTIONS
@@ -464,7 +464,7 @@ add_libc_test(
   isfinite_c_test
   C_TEST
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     isfinite_test.c
   COMPILE_OPTIONS
@@ -478,7 +478,7 @@ add_libc_test(
   issubnormal_c_test
   C_TEST
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     issubnormal_test.c
   COMPILE_OPTIONS
@@ -492,7 +492,7 @@ add_libc_test(
   fpclassify_c_test
   C_TEST
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     fpclassify_test.c
   COMPILE_OPTIONS
@@ -506,7 +506,7 @@ add_libc_test(
   iszero_c_test
   C_TEST
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     iszero_test.c
   COMPILE_OPTIONS
@@ -520,7 +520,7 @@ add_libc_test(
   math_constants_c_test
   C_TEST
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     math_constants_test.c
   COMPILE_OPTIONS
@@ -543,7 +543,7 @@ function(add_header_test target_name source_file deps std_mode)
       C_TEST
       FULL_BUILD_ONLY
       SUITE
-        libc_include_tests
+        libc-include-tests
       SRCS
         ${source_file}
       COMPILE_OPTIONS
diff --git a/libc/test/include/net/linux/CMakeLists.txt b/libc/test/include/net/linux/CMakeLists.txt
index 0536f796182ef7..3f4ab86e449e29 100644
--- a/libc/test/include/net/linux/CMakeLists.txt
+++ b/libc/test/include/net/linux/CMakeLists.txt
@@ -1,7 +1,7 @@
 add_libc_test(
   net_if_and_linux_if_test
   SUITE
-    libc_include_tests
+    libc-include-tests
   SRCS
     linux_if_helper.cpp
     net_if_and_linux_if_test.cpp
diff --git a/libc/test/integrat...
[truncated]

``````````

</details>


https://github.com/llvm/llvm-project/pull/234465


More information about the libc-commits mailing list