Home | History | Annotate | Download | only in test
      1 macro(pythonize_bool var)
      2   if (${var})
      3     set(${var} True)
      4   else()
      5     set(${var} False)
      6   endif()
      7 endmacro()
      8 
      9 set(LIBCXX_LIT_VARIANT "libcxx" CACHE STRING
     10     "Configuration variant to use for LIT.")
     11 
     12 pythonize_bool(LIBCXX_ENABLE_EXCEPTIONS)
     13 pythonize_bool(LIBCXX_ENABLE_RTTI)
     14 pythonize_bool(LIBCXX_ENABLE_SHARED)
     15 pythonize_bool(LIBCXX_BUILD_32_BITS)
     16 pythonize_bool(LIBCXX_ENABLE_GLOBAL_FILESYSTEM_NAMESPACE)
     17 pythonize_bool(LIBCXX_ENABLE_STDIN)
     18 pythonize_bool(LIBCXX_ENABLE_STDOUT)
     19 pythonize_bool(LIBCXX_ENABLE_THREADS)
     20 pythonize_bool(LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS)
     21 pythonize_bool(LIBCXX_ENABLE_MONOTONIC_CLOCK)
     22 pythonize_bool(LIBCXX_GENERATE_COVERAGE)
     23 pythonize_bool(LIBCXXABI_USE_LLVM_UNWINDER)
     24 
     25 # The tests shouldn't link to any ABI library when it has been linked into
     26 # libc++ statically.
     27 if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY)
     28   set(LIBCXX_CXX_ABI_LIBNAME "none")
     29 endif()
     30 set(LIBCXX_TARGET_INFO "libcxx.test.target_info.LocalTI" CACHE STRING
     31     "TargetInfo to use when setting up test environment.")
     32 set(LIBCXX_EXECUTOR "None" CACHE STRING
     33     "Executor to use when running tests.")
     34 
     35 set(AUTO_GEN_COMMENT "## Autogenerated by libcxx configuration.\n# Do not edit!")
     36 
     37 configure_file(
     38   ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
     39   ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
     40   @ONLY)
     41 
     42 add_lit_testsuite(check-libcxx
     43   "Running libcxx tests"
     44   ${CMAKE_CURRENT_BINARY_DIR}
     45   DEPENDS cxx)
     46 
     47 if (LIBCXX_GENERATE_COVERAGE)
     48   include(CodeCoverage)
     49   set(output_dir "${CMAKE_CURRENT_BINARY_DIR}/coverage")
     50   set(capture_dirs "${LIBCXX_LIB_CMAKEFILES_DIR}/cxx.dir/;${CMAKE_CURRENT_BINARY_DIR}")
     51   set(extract_dirs "${LIBCXX_SOURCE_DIR}/include;${LIBCXX_SOURCE_DIR}/src")
     52   setup_lcov_test_target_coverage("cxx" "${output_dir}" "${capture_dirs}" "${extract_dirs}")
     53 endif()
     54