Skip to content

[libc][cmake] disable include tests in overlay mode #114566

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion libc/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ if(LIBC_TARGET_OS_IS_GPU)
endif()
endif()

add_subdirectory(include)
add_subdirectory(src)
add_subdirectory(utils)

if(NOT LLVM_LIBC_FULL_BUILD)
return()
endif()

add_subdirectory(include)

if(NOT ${LIBC_TARGET_OS} STREQUAL "linux" AND
NOT ${LIBC_TARGET_OS} STREQUAL "gpu")
# Integration tests are currently only available for linux and the GPU.
Expand Down
84 changes: 40 additions & 44 deletions libc/test/include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,50 +36,46 @@ add_libc_test(
-Wno-gnu-statement-expression-from-macro-expansion
)

# stdbit_test only tests our generated stdbit.h, which is not generated in
# overlay mode.
if(LLVM_LIBC_FULL_BUILD AND libc.include.stdbit IN_LIST TARGET_PUBLIC_HEADERS)
add_libc_test(
stdbit_test
SUITE
libc_include_tests
HDRS
stdbit_stub.h
SRCS
stdbit_test.cpp
DEPENDS
libc.include.llvm-libc-macros.stdbit_macros
libc.include.llvm_libc_common_h
libc.include.stdbit
# Intentionally do not depend on libc.src.stdbit.*. The include test is
# simply testing the macros provided by stdbit.h, not the implementation
# of the underlying functions which the type generic macros may dispatch
# to.
)
add_libc_test(
stdbit_c_test
C_TEST
UNIT_TEST_ONLY
SUITE
libc_include_tests
HDRS
stdbit_stub.h
SRCS
stdbit_test.c
COMPILE_OPTIONS
-Wall
-Werror
DEPENDS
libc.include.llvm-libc-macros.stdbit_macros
libc.include.llvm_libc_common_h
libc.include.stdbit
libc.src.assert.__assert_fail
# Intentionally do not depend on libc.src.stdbit.*. The include test is
# simply testing the macros provided by stdbit.h, not the implementation
# of the underlying functions which the type generic macros may dispatch
# to.
)
endif()
add_libc_test(
stdbit_test
SUITE
libc_include_tests
HDRS
stdbit_stub.h
SRCS
stdbit_test.cpp
DEPENDS
libc.include.llvm-libc-macros.stdbit_macros
libc.include.llvm_libc_common_h
libc.include.stdbit
# Intentionally do not depend on libc.src.stdbit.*. The include test is
# simply testing the macros provided by stdbit.h, not the implementation
# of the underlying functions which the type generic macros may dispatch
# to.
)
add_libc_test(
stdbit_c_test
C_TEST
UNIT_TEST_ONLY
SUITE
libc_include_tests
HDRS
stdbit_stub.h
SRCS
stdbit_test.c
COMPILE_OPTIONS
-Wall
-Werror
DEPENDS
libc.include.llvm-libc-macros.stdbit_macros
libc.include.llvm_libc_common_h
libc.include.stdbit
libc.src.assert.__assert_fail
# Intentionally do not depend on libc.src.stdbit.*. The include test is
# simply testing the macros provided by stdbit.h, not the implementation
# of the underlying functions which the type generic macros may dispatch
# to.
)

add_libc_test(
stdckdint_test
Expand Down
Loading