github.com/johnnyeven/libtools@v0.0.0-20191126065708-61829c1adf46/third_party/mlir/test/CMakeLists.txt (about)

     1  add_subdirectory(EDSC)
     2  add_subdirectory(mlir-cpu-runner)
     3  add_subdirectory(SDBM)
     4  add_subdirectory(lib)
     5  
     6  llvm_canonicalize_cmake_booleans(
     7    LLVM_BUILD_EXAMPLES
     8    )
     9  
    10  # Passed to lit.site.cfg.py.in to set up the path where to find the libraries
    11  # for linalg integration tests.
    12  set(MLIR_DIALECT_LINALG_INTEGRATION_TEST_LIB_DIR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
    13  
    14  # Passed to lit.site.cfg.py.in to set up the path where to find the libraries
    15  # for the mlir cuda runner tests.
    16  set(MLIR_CUDA_WRAPPER_LIBRARY_DIR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
    17  
    18  configure_lit_site_cfg(
    19    ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
    20    ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py
    21    MAIN_CONFIG
    22    ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py
    23    )
    24  configure_lit_site_cfg(
    25    ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in
    26    ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py
    27    MAIN_CONFIG
    28    ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.cfg.py
    29    )
    30  
    31  set(MLIR_TEST_DEPENDS
    32    FileCheck count not
    33    MLIRUnitTests
    34    mlir-cpu-runner
    35    mlir-edsc-builder-api-test
    36    mlir-opt
    37    mlir-sdbm-api-test
    38    mlir-tblgen
    39    mlir-translate
    40    cblas
    41    cblas_interface
    42    )
    43  
    44  if(LLVM_BUILD_EXAMPLES)
    45    list(APPEND MLIR_TEST_DEPENDS
    46      linalg1-opt
    47      toyc-ch1
    48      toyc-ch2
    49      toyc-ch3
    50      toyc-ch4
    51      toyc-ch5
    52      )
    53  endif()
    54  
    55  if(MLIR_CUDA_RUNNER_ENABLED)
    56    list(APPEND MLIR_TEST_DEPENDS
    57      mlir-cuda-runner
    58    )
    59  endif()
    60  
    61  add_lit_testsuite(check-mlir "Running the MLIR regression tests"
    62    ${CMAKE_CURRENT_BINARY_DIR}
    63    DEPENDS ${MLIR_TEST_DEPENDS}
    64    )
    65  set_target_properties(check-mlir PROPERTIES FOLDER "Tests")
    66  
    67  add_lit_testsuites(MLIR ${CMAKE_CURRENT_SOURCE_DIR}
    68    DEPENDS ${MLIR_TEST_DEPS}
    69  )