1 # CMakeLists.txt file for unit testing OpenMP offloading runtime library.
2 if(NOT OPENMP_TEST_COMPILER_ID STREQUAL "Clang" OR
3 OPENMP_TEST_COMPILER_VERSION VERSION_LESS 6.0.0)
4 libomptarget_say("Can only test with Clang compiler in version 6.0.0 or later.")
5 libomptarget_warning_say("The check-libomptarget target will not be available!")
9 if(LIBOMPTARGET_ENABLE_DEBUG)
10 set(LIBOMPTARGET_DEBUG True)
12 set(LIBOMPTARGET_DEBUG False)
15 # Replace the space from user's input with ";" in case that CMake add escape
16 # char into the lit command.
17 string(REPLACE " " ";" LIBOMPTARGET_LIT_ARG_LIST "${LIBOMPTARGET_LIT_ARGS}")
19 string(REGEX MATCHALL "([^\ ]+\ |[^\ ]+$)" SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM_TARGETS}")
20 foreach(CURRENT_TARGET IN LISTS SYSTEM_TARGETS)
21 string(STRIP "${CURRENT_TARGET}" CURRENT_TARGET)
23 add_openmp_testsuite(check-libomptarget-${CURRENT_TARGET}
24 "Running libomptarget tests"
25 ${CMAKE_CURRENT_BINARY_DIR}/${CURRENT_TARGET}
26 DEPENDS omptarget omp ${LIBOMPTARGET_TESTED_PLUGINS}
27 ARGS ${LIBOMPTARGET_LIT_ARG_LIST})
28 list(APPEND LIBOMPTARGET_LIT_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CURRENT_TARGET})
30 # Configure the lit.site.cfg.in file
31 set(AUTO_GEN_COMMENT "## Autogenerated by libomptarget configuration.\n# Do not edit!")
32 get_filename_component(CUDA_LIBDIR "${CUDA_cudart_static_LIBRARY}" DIRECTORY)
33 configure_file(lit.site.cfg.in ${CURRENT_TARGET}/lit.site.cfg @ONLY)
37 add_openmp_testsuite(check-libomptarget
38 "Running libomptarget tests"
39 ${LIBOMPTARGET_LIT_TESTSUITES}
40 EXCLUDE_FROM_CHECK_ALL
41 DEPENDS omptarget omp ${LIBOMPTARGET_TESTED_PLUGINS}
42 ARGS ${LIBOMPTARGET_LIT_ARG_LIST})