Skip to content

Commit

Permalink
Enable usage of llvm-lit on tests in test/ folder (#1728)
Browse files Browse the repository at this point in the history
  • Loading branch information
svuckovicTT authored Jan 9, 2025
1 parent 16522c6 commit 16eda55
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ run_results.json
ttrt_report.xml
cluster_descriptor.yaml

# lit config gets autogenerated during build
test/lit.site.cfg.py

# TTNN and TTMetal flatbuffers
*.ttnn
*.ttm
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ endif()
set(TTMLIR_TOOLCHAIN_DIR $ENV{TTMLIR_TOOLCHAIN_DIR})
set(TTMLIR_SOURCE_DIR ${PROJECT_SOURCE_DIR})
set(TTMLIR_BINARY_DIR ${PROJECT_BINARY_DIR})
set(LLVM_TOOLS_DIR "${TTMLIR_TOOLCHAIN_DIR}/bin")
set(LLVM_LIT_TOOLS_DIR "${TTMLIR_TOOLCHAIN_DIR}/src/llvm-project/llvm/utils/lit")
set(SHLIBEXT ".so")
include_directories(SYSTEM ${LLVM_INCLUDE_DIRS})
include_directories(SYSTEM ${MLIR_INCLUDE_DIRS})
include_directories(${TTMLIR_SOURCE_DIR}/include)
Expand Down
13 changes: 13 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,26 @@ llvm_canonicalize_cmake_booleans(
MLIR_ENABLE_BINDINGS_PYTHON
)

# Configure into build dir
#
configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py
MAIN_CONFIG
${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py
)

# Configure into source dir
#
configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py
MAIN_CONFIG
${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py
)

# Configure into unit tests dir
#
configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/unittests/lit.site.cfg.py.in
${CMAKE_CURRENT_BINARY_DIR}/unittests/lit.site.cfg.py
Expand Down

0 comments on commit 16eda55

Please sign in to comment.