CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
115 lines
2.9 KiB
CMake
115 lines
2.9 KiB
CMake
function(add_fp_unittest name)
|
|
cmake_parse_arguments(
|
|
"MATH_UNITTEST"
|
|
"NEED_MPFR;NEED_MPC;UNIT_TEST_ONLY;HERMETIC_TEST_ONLY" # Optional arguments
|
|
"" # Single value arguments
|
|
"LINK_LIBRARIES;DEPENDS" # Multi-value arguments
|
|
${ARGN}
|
|
)
|
|
|
|
if(MATH_UNITTEST_NEED_MPC)
|
|
set(MATH_UNITTEST_NEED_MPFR TRUE)
|
|
if(NOT LIBC_TESTS_CAN_USE_MPC)
|
|
message(VERBOSE "Complex test ${name} will be skipped as MPC library is not available.")
|
|
return()
|
|
endif()
|
|
list(APPEND MATH_UNITTEST_LINK_LIBRARIES libcMPCWrapper)
|
|
endif()
|
|
|
|
if(MATH_UNITTEST_NEED_MPFR)
|
|
if(NOT LIBC_TESTS_CAN_USE_MPFR)
|
|
message(VERBOSE "Math test ${name} will be skipped as MPFR library is not available.")
|
|
return()
|
|
endif()
|
|
endif()
|
|
|
|
if(MATH_UNITTEST_HERMETIC_TEST_ONLY)
|
|
set(test_type HERMETIC_TEST_ONLY)
|
|
elseif(MATH_UNITTEST_UNIT_TEST_ONLY)
|
|
set(test_type UNIT_TEST_ONLY)
|
|
endif()
|
|
if(MATH_UNITTEST_NEED_MPFR)
|
|
if(MATH_UNITTEST_HERMETIC_TEST_ONLY)
|
|
message(FATAL_ERROR "Hermetic math test cannot require MPFR.")
|
|
endif()
|
|
set(test_type UNIT_TEST_ONLY)
|
|
list(APPEND MATH_UNITTEST_LINK_LIBRARIES libcMPFRWrapper -lmpfr -lgmp)
|
|
if(NOT(LIBC_TARGET_OS_IS_DARWIN) AND NOT(LIBC_TARGET_OS_IS_FREEBSD))
|
|
# macOS/FreeBSD does not have libatomic.
|
|
list(APPEND MATH_UNITTEST_LINK_LIBRARIES -latomic)
|
|
endif()
|
|
endif()
|
|
list(APPEND MATH_UNITTEST_LINK_LIBRARIES LibcFPTestHelpers)
|
|
|
|
set(deps libc.hdr.math_macros)
|
|
if(MATH_UNITTEST_DEPENDS)
|
|
list(APPEND deps ${MATH_UNITTEST_DEPENDS})
|
|
endif()
|
|
|
|
add_libc_test(
|
|
${name}
|
|
${test_type}
|
|
LINK_LIBRARIES "${MATH_UNITTEST_LINK_LIBRARIES}"
|
|
"${MATH_UNITTEST_UNPARSED_ARGUMENTS}"
|
|
DEPENDS
|
|
libc.hdr.stdint_proxy
|
|
"${deps}"
|
|
)
|
|
endfunction(add_fp_unittest)
|
|
|
|
add_subdirectory(__support)
|
|
add_subdirectory(arpa)
|
|
add_subdirectory(complex)
|
|
add_subdirectory(ctype)
|
|
add_subdirectory(errno)
|
|
add_subdirectory(fenv)
|
|
add_subdirectory(link)
|
|
add_subdirectory(math)
|
|
add_subdirectory(netinet)
|
|
add_subdirectory(search)
|
|
add_subdirectory(setjmp)
|
|
add_subdirectory(stdbit)
|
|
add_subdirectory(stdfix)
|
|
add_subdirectory(stdio)
|
|
add_subdirectory(stdlib)
|
|
add_subdirectory(string)
|
|
add_subdirectory(strings)
|
|
add_subdirectory(ucontext)
|
|
add_subdirectory(wchar)
|
|
add_subdirectory(wctype)
|
|
add_subdirectory(time)
|
|
add_subdirectory(unistd)
|
|
|
|
# Depends on utilities in stdlib
|
|
add_subdirectory(inttypes)
|
|
|
|
if(${LIBC_TARGET_OS} STREQUAL "linux")
|
|
add_subdirectory(fcntl)
|
|
add_subdirectory(poll)
|
|
add_subdirectory(sched)
|
|
add_subdirectory(sys)
|
|
add_subdirectory(termios)
|
|
endif()
|
|
|
|
if(LIBC_COMPILER_HAS_EXT_VECTOR_TYPE)
|
|
add_subdirectory(mathvec)
|
|
endif()
|
|
|
|
if(NOT LLVM_LIBC_FULL_BUILD)
|
|
return()
|
|
endif()
|
|
|
|
add_subdirectory(assert)
|
|
add_subdirectory(compiler)
|
|
add_subdirectory(dirent)
|
|
add_subdirectory(locale)
|
|
add_subdirectory(nl_types)
|
|
add_subdirectory(signal)
|
|
add_subdirectory(regex)
|
|
add_subdirectory(spawn)
|
|
|
|
if(${LIBC_TARGET_OS} STREQUAL "linux")
|
|
add_subdirectory(pthread)
|
|
add_subdirectory(semaphore)
|
|
endif()
|