Skip to content
Merged
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
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ if(NOT WIN32)
endif()

if(TRITON_BUILD_UT)
# This is an aggregate target for all unit tests.
add_custom_target(TritonUnitTests)
set_target_properties(TritonUnitTests PROPERTIES FOLDER "Triton/Tests")
include(AddTritonUnitTest)
endif()

Expand Down Expand Up @@ -340,4 +343,10 @@ add_subdirectory(test)

if(TRITON_BUILD_UT)
add_subdirectory(unittest)
# This target runs all the unit tests.
add_custom_target(check-triton-unit-tests
COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure
DEPENDS TritonUnitTests
USES_TERMINAL
)
endif()
3 changes: 3 additions & 0 deletions cmake/AddTritonUnitTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,7 @@ function(add_triton_ut)
# laptop. I think the issue may be that the very first time you run a program
# it's a bit slow.
gtest_discover_tests(${__NAME} DISCOVERY_TIMEOUT 60)

# Add the unit test to the top-level unit test target.
add_dependencies(TritonUnitTests ${__NAME})
endfunction()