Skip to content

Commit

Permalink
add ctest tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cnt0 committed Jun 10, 2023
1 parent 9bc8237 commit 91eda39
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
13 changes: 13 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,16 @@ if (NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
endif()

install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_BINARY_DIR})

# find_package(PkgConfig REQUIRED)
# pkg_check_modules(examiner REQUIRED libexaminer)
find_package(examiner REQUIRED)
# add_subdirectory(examiner)

add_executable(${PROJECT_NAME}_test test/test.c)
target_link_libraries(${PROJECT_NAME}_test PRIVATE ${PROJECT_NAME} examiner)
# target_link_libraries(${PROJECT_NAME}_test PRIVATE ${PROJECT_NAME} ${examiner_LINK_LIBRARIES})
# target_include_directories(${PROJECT_NAME}_test PRIVATE ${examiner_INCLUDE_DIRS})

include(CTest)
add_test(NAME ${PROJECT_NAME}_test COMMAND ${PROJECT_NAME}_test)
3 changes: 2 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"hidden": true,
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_PREFIX_PATH": "${sourceDir}/examiner-install"
}
},
{
Expand Down

0 comments on commit 91eda39

Please sign in to comment.