From 26dfa76faa883c35fe3e5ff4b2b33f4102059a81 Mon Sep 17 00:00:00 2001 From: Mitya Selivanov <0x7fffff@guattari.ru> Date: Fri, 5 Aug 2022 21:17:16 +0400 Subject: Async function & unit-testing --- source/test/integration/find_package/.gitignore | 2 ++ .../test/integration/find_package/CMakeLists.txt | 34 ++++++++++++++++++++++ .../integration/find_package/source/CMakeLists.txt | 10 +++++++ source/test/integration/find_package/source/main.c | 5 ++++ 4 files changed, 51 insertions(+) create mode 100644 source/test/integration/find_package/.gitignore create mode 100644 source/test/integration/find_package/CMakeLists.txt create mode 100644 source/test/integration/find_package/source/CMakeLists.txt create mode 100644 source/test/integration/find_package/source/main.c (limited to 'source/test/integration/find_package') diff --git a/source/test/integration/find_package/.gitignore b/source/test/integration/find_package/.gitignore new file mode 100644 index 0000000..0ba45dd --- /dev/null +++ b/source/test/integration/find_package/.gitignore @@ -0,0 +1,2 @@ +/build/ +/install/ diff --git a/source/test/integration/find_package/CMakeLists.txt b/source/test/integration/find_package/CMakeLists.txt new file mode 100644 index 0000000..f21cdae --- /dev/null +++ b/source/test/integration/find_package/CMakeLists.txt @@ -0,0 +1,34 @@ +cmake_minimum_required(VERSION 3.16) +set(NAME kit-integration-find-package) +project(${NAME}-root) + +include(ExternalProject) + +ExternalProject_Add( + kit + GIT_REPOSITORY https://github.com/automainint/kit.git + GIT_TAG dev + CMAKE_ARGS + -D CMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_SOURCE_DIR}/install + -D KIT_ENABLE_TESTING=OFF) + +ExternalProject_Add( + ${NAME} + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/source + CMAKE_ARGS + -D CMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_SOURCE_DIR}/install) + +ExternalProject_Add_StepDependencies(${NAME} build kit) + +include(GNUInstallDirs) + +enable_testing() + +add_test( + NAME ${NAME}-run + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/install/${CMAKE_INSTALL_BINDIR}/${NAME}${CMAKE_EXECUTABLE_SUFFIX}) + +set_tests_properties( + ${NAME}-run + PROPERTIES + TIMEOUT "15") diff --git a/source/test/integration/find_package/source/CMakeLists.txt b/source/test/integration/find_package/source/CMakeLists.txt new file mode 100644 index 0000000..2dc34a1 --- /dev/null +++ b/source/test/integration/find_package/source/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.16) +set(NAME kit-integration-find-package) +project(${NAME} C) + +find_package(kit REQUIRED) + +add_executable(${NAME}) +target_sources(${NAME} PRIVATE main.c) +target_link_libraries(${NAME} PRIVATE kit::kit) +install(TARGETS ${NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/source/test/integration/find_package/source/main.c b/source/test/integration/find_package/source/main.c new file mode 100644 index 0000000..c9dc882 --- /dev/null +++ b/source/test/integration/find_package/source/main.c @@ -0,0 +1,5 @@ +#include + +int main() { + return 0; +} -- cgit v1.2.3