Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve lit testing scripts. #94

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
##
#######################################################################################################################
#
# Copyright (c) 2020-2023 Advanced Micro Devices, Inc. All Rights Reserved.
# Copyright (c) 2020-2024 Advanced Micro Devices, Inc. All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -42,10 +42,9 @@ configure_lit_site_cfg(

add_lit_testsuite(check-llvm-dialects-lit "Running the llvm-dialects regression tests"
${CMAKE_CURRENT_BINARY_DIR}
${exclude_from_check_all}
DEPENDS ${LLVM_DIALECTS_TEST_DEPENDS}
${EXCLUDE_FROM_CHECK_ALL}
DEPENDS llvm-dialects-test-depends
)
set_target_properties(check-llvm-dialects-lit PROPERTIES FOLDER "Tests")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove this? AFAIK it is relevant for Visual Studio.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is already set on llvm-dialects-test-depends (not sure if it works though, going to double-check)


add_lit_testsuites(LLVM_DIALECTS ${CMAKE_CURRENT_SOURCE_DIR}
${exclude_from_check_all}
Expand Down
11 changes: 8 additions & 3 deletions test/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ llvm_map_components_to_libnames(llvm_libs Support Core)
set(DIALECTS_UNIT_TEST_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(DIALECTS_UNIT_TEST_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})

function(add_dialects_unit_test test_folder)
# Define test suite, link each test suite to llvm_dialects
macro(add_dialects_unit_test test_folder)
add_unittest(DialectsUnitTests ${test_folder} ${ARGN})
target_link_libraries(${test_folder} PRIVATE ${llvm_libs} llvm_dialects)

Expand All @@ -20,10 +21,9 @@ function(add_dialects_unit_test test_folder)
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/../dialect
${CMAKE_CURRENT_BINARY_DIR}/../dialect)
endfunction()
endmacro()

add_subdirectory(dialect)
add_subdirectory(interface)

# Let lit discover the GTest tests
configure_lit_site_cfg(
Expand All @@ -33,7 +33,12 @@ configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py
)

# Define the actual testing target. The tests are added in interface/.
add_lit_testsuite(check-llvm-dialects-units "Running the llvm-dialects unit tests"
${CMAKE_CURRENT_SOURCE_DIR}
${EXCLUDE_FROM_CHECK_ALL}
DEPENDS TestDialectTableGen DialectsUnitTests)

add_subdirectory(interface)

set_target_properties(check-llvm-dialects-units PROPERTIES FOLDER "Tests")
Loading