summaryrefslogtreecommitdiff
path: root/source/test/integration
diff options
context:
space:
mode:
Diffstat (limited to 'source/test/integration')
-rw-r--r--source/test/integration/fetch_content/.gitignore1
-rw-r--r--source/test/integration/fetch_content/CMakeLists.txt19
-rw-r--r--source/test/integration/fetch_content/main.c5
-rw-r--r--source/test/integration/find_package/.gitignore2
-rw-r--r--source/test/integration/find_package/CMakeLists.txt34
-rw-r--r--source/test/integration/find_package/source/CMakeLists.txt10
-rw-r--r--source/test/integration/find_package/source/main.c5
7 files changed, 76 insertions, 0 deletions
diff --git a/source/test/integration/fetch_content/.gitignore b/source/test/integration/fetch_content/.gitignore
new file mode 100644
index 0000000..84c048a
--- /dev/null
+++ b/source/test/integration/fetch_content/.gitignore
@@ -0,0 +1 @@
+/build/
diff --git a/source/test/integration/fetch_content/CMakeLists.txt b/source/test/integration/fetch_content/CMakeLists.txt
new file mode 100644
index 0000000..efa83d0
--- /dev/null
+++ b/source/test/integration/fetch_content/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 3.16)
+set(NAME kit-integration-fetch-content)
+project(${NAME} C)
+
+include(FetchContent)
+FetchContent_Declare(
+ kit
+ GIT_REPOSITORY https://github.com/automainint/kit.git
+ GIT_TAG dev)
+set(KIT_ENABLE_TESTING OFF)
+FetchContent_MakeAvailable(kit)
+
+add_executable(${NAME})
+target_sources(${NAME} PRIVATE main.c)
+target_link_libraries(${NAME} PRIVATE kit::kit)
+
+enable_testing()
+add_test(NAME ${NAME}-run COMMAND ${NAME})
+set_tests_properties(${NAME}-run PROPERTIES TIMEOUT "15")
diff --git a/source/test/integration/fetch_content/main.c b/source/test/integration/fetch_content/main.c
new file mode 100644
index 0000000..c9dc882
--- /dev/null
+++ b/source/test/integration/fetch_content/main.c
@@ -0,0 +1,5 @@
+#include <kit/async_function.h>
+
+int main() {
+ return 0;
+}
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 <kit/async_function.h>
+
+int main() {
+ return 0;
+}