2017-11-30 03:31:52 +08:00
|
|
|
# CMakeLists.txt file for unit testing OpenMP offloading runtime library.
|
2018-07-16 01:29:43 +08:00
|
|
|
if(NOT OPENMP_TEST_COMPILER_ID STREQUAL "Clang" OR
|
|
|
|
OPENMP_TEST_COMPILER_VERSION VERSION_LESS 6.0.0)
|
2017-12-01 01:08:31 +08:00
|
|
|
libomptarget_say("Can only test with Clang compiler in version 6.0.0 or later.")
|
|
|
|
libomptarget_warning_say("The check-libomptarget target will not be available!")
|
|
|
|
return()
|
|
|
|
endif()
|
2017-01-26 05:27:24 +08:00
|
|
|
|
2019-03-26 23:19:15 +08:00
|
|
|
if(LIBOMPTARGET_ENABLE_DEBUG)
|
2017-08-14 23:09:59 +08:00
|
|
|
set(LIBOMPTARGET_DEBUG True)
|
|
|
|
else()
|
|
|
|
set(LIBOMPTARGET_DEBUG False)
|
|
|
|
endif()
|
|
|
|
|
2021-07-19 09:54:05 +08:00
|
|
|
# Replace the space from user's input with ";" in case that CMake add escape
|
|
|
|
# char into the lit command.
|
|
|
|
string(REPLACE " " ";" LIBOMPTARGET_LIT_ARG_LIST "${LIBOMPTARGET_LIT_ARGS}")
|
|
|
|
|
2021-04-27 18:23:18 +08:00
|
|
|
string(REGEX MATCHALL "([^\ ]+\ |[^\ ]+$)" SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM_TARGETS}")
|
|
|
|
foreach(CURRENT_TARGET IN LISTS SYSTEM_TARGETS)
|
|
|
|
string(STRIP "${CURRENT_TARGET}" CURRENT_TARGET)
|
2021-07-19 01:16:03 +08:00
|
|
|
add_openmp_testsuite(check-libomptarget-${CURRENT_TARGET}
|
|
|
|
"Running libomptarget tests"
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/${CURRENT_TARGET}
|
|
|
|
DEPENDS omptarget omp ${LIBOMPTARGET_TESTED_PLUGINS}
|
2021-07-19 09:54:05 +08:00
|
|
|
ARGS ${LIBOMPTARGET_LIT_ARG_LIST})
|
2021-04-27 18:23:18 +08:00
|
|
|
list(APPEND LIBOMPTARGET_LIT_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CURRENT_TARGET})
|
2017-11-30 03:31:52 +08:00
|
|
|
|
2021-04-27 18:23:18 +08:00
|
|
|
# Configure the lit.site.cfg.in file
|
|
|
|
set(AUTO_GEN_COMMENT "## Autogenerated by libomptarget configuration.\n# Do not edit!")
|
2021-04-28 05:27:32 +08:00
|
|
|
get_filename_component(CUDA_LIBDIR "${CUDA_cudart_static_LIBRARY}" DIRECTORY)
|
2021-04-27 18:23:18 +08:00
|
|
|
configure_file(lit.site.cfg.in ${CURRENT_TARGET}/lit.site.cfg @ONLY)
|
|
|
|
endforeach()
|
|
|
|
|
2021-07-19 01:16:03 +08:00
|
|
|
add_openmp_testsuite(check-libomptarget
|
|
|
|
"Running libomptarget tests"
|
|
|
|
${LIBOMPTARGET_LIT_TESTSUITES}
|
|
|
|
EXCLUDE_FROM_CHECK_ALL
|
|
|
|
DEPENDS omptarget omp ${LIBOMPTARGET_TESTED_PLUGINS}
|
2021-07-19 09:54:05 +08:00
|
|
|
ARGS ${LIBOMPTARGET_LIT_ARG_LIST})
|