[libc-commits] [libc] [libc][test] Condition out tests that can't work on bare metal (PR #215830)

Pavel Labath via libc-commits libc-commits at lists.llvm.org
Thu Aug 13 13:02:34 PDT 2026


================
@@ -30,15 +36,14 @@ function(_get_common_test_compile_options output_var c_test flags)
   libc_add_definition(compile_options
     "LIBC_TEST_SUBPROCESS_TESTS=${LIBC_TEST_SUBPROCESS_TESTS}")
 
-  if(LIBC_TEST_SUBPROCESS_TESTS)
-    # EXPECT_DEATH and ASSERT_DEATH might be quite slow.  LIBC_TEST_SKIP_DEATH_TESTS
-    # will make those tests no-op to reduce the overall test time.
-    if(LIBC_TEST_SKIP_DEATH_TESTS)
-      if(LIBC_CMAKE_VERBOSE_LOGGING)
-        message(STATUS "LIBC_TEST_SKIP_DEATH_TESTS is set.  EXPECT_DEATH/ASSERT_DEATH are no-op.")
-      endif()
-      list(APPEND compile_options "-DLIBC_TEST_SKIP_DEATH_TESTS")
+  # Set LIBC_TEST_SKIP_DEATH_TESTS to skip running tests that use EXPECT_DEATH
+  # and ASSERT_DEATH. On platforms where they work, they can be slow; on
+  # bare-metal platforms it might not be possible to implement them at all.
+  if(LIBC_TEST_SKIP_DEATH_TESTS)
----------------
labath wrote:

I think it'd be better to keep this inside the LIBC_TEST_SUBPROCESS_TESTS branch since death tests (at least how they are implemented right now) are a special kind of a subprocess test.

What is the story with overall subprocess (e.g. EXPECT_EXIT) tests for bare metal targets. If you don't support those either, maybe we should be the behavior for subprocess tests in general?

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


More information about the libc-commits mailing list