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
3 changes: 1 addition & 2 deletions commit_info
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
1. add examples of system test
2. fix multi threading bugs on some machines (e.g.., the aarach64), force a single tread now by torch::set_num_threads(1);
1. simplify the cmake of test

38 changes: 16 additions & 22 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,23 @@
#set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_FLAGS "-std=c++20 -Wall -Werror=return-type -Werror=unused-variable -Werror=unused-parameter")
enable_testing()
add_executable(cpp_test SystemTest/SimpleTest.cpp)
add_executable(sketch_test SystemTest/SketchTest.cpp)
message(STATUS " Libraries: ${LIBRARIES}")
target_link_libraries(cpp_test
IntelliStream
)
target_link_libraries(sketch_test
IntelliStream
)
# avoid undefined reference to "main" in test.cpp

add_test(
NAME catch_test
COMMAND $<TARGET_FILE:cpp_test> --success
)
add_test(
NAME sketch_test
COMMAND $<TARGET_FILE:sketch_test> --success
)


file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/torchscripts
DESTINATION ${CMAKE_CURRENT_BINARY_DIR})

file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/scripts
DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
macro(add_catch_test appName SOURCE_FILES SOURCE_LIBS)
get_property(SOURCE_FILES_LOCAL GLOBAL PROPERTY "${PROP_NAME}_SOURCE_PROP")
set(${SOURCE_FILES} ${SOURCE_FILES_LOCAL})
add_executable(${appName} ${SOURCE_FILES})
target_link_libraries(${appName} ${SOURCE_LIBS})
add_test(
NAME catch_${appName}
COMMAND $<TARGET_FILE:${appName}> --success
)
endmacro()
add_catch_test(cpp_test SystemTest/SimpleTest.cpp IntelliStream)
add_catch_test(sketch_test SystemTest/SketchTest.cpp IntelliStream)