summaryrefslogtreecommitdiff
path: root/unittest/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'unittest/CMakeLists.txt')
-rwxr-xr-xunittest/CMakeLists.txt58
1 files changed, 58 insertions, 0 deletions
diff --git a/unittest/CMakeLists.txt b/unittest/CMakeLists.txt
new file mode 100755
index 0000000..701c4ec
--- /dev/null
+++ b/unittest/CMakeLists.txt
@@ -0,0 +1,58 @@
+# Copyright (c) 2014-2017 Samsung Electronics Co., Ltd All Rights Reserved
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# @file CMakeLists.txt
+# @author
+# @author
+# @brief Cmake for tests
+#
+
+LINK_DIRECTORIES(${CMAKE_BINARY_DIR})
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/include)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/lib)
+
+SET(TARGET_GTEST_TESTS "gtest-beluga-launcher")
+
+FILE(GLOB TARGET_GTEST_TESTS_SRCS
+ beluga-launcher_dzl_dockerctl.cpp
+ beluga-launcher_dzl_dockerform.cpp
+ beluga-launcher_dzl_lifecycle.cpp
+ beluga-launcher_dzl_setting.cpp
+ beluga-launcher_main.cpp
+ ${CMAKE_SOURCE_DIR}/src/dzl_dockerform.c
+ ${CMAKE_SOURCE_DIR}/src/dzl_lifecycle.c
+ ${CMAKE_SOURCE_DIR}/src/dzl_dockercomm.c
+ ${CMAKE_SOURCE_DIR}/src/dzl_dockerctl.c
+ ${CMAKE_SOURCE_DIR}/src/dzl_setting.c
+ ${CMAKE_SOURCE_DIR}/src/lib/json_util.c
+ ${CMAKE_SOURCE_DIR}/src/lib/yaml_util.c)
+
+INCLUDE(FindPkgConfig)
+
+IF(NONE_GBS_BUILD)
+ INCLUDE_DIRECTORIES(${LINK_LIB_INCLUDE})
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fprofile-arcs -ftest-coverage")
+ set(CMAKE_EXE_LINKER_FLAGS ${LINK_FLAG})
+ELSE(NONE_GBS_BUILD)
+ pkg_check_modules(gtest_pkgs REQUIRED dlog glib-2.0 libcurl json-c gmock)
+ENDIF(NONE_GBS_BUILD)
+
+INCLUDE_DIRECTORIES(${gtest_pkgs_INCLUDE_DIRS})
+LINK_DIRECTORIES(${gtest_pkgs_LIBRARY_DIRS})
+
+ADD_EXECUTABLE(${TARGET_GTEST_TESTS} ${TARGET_GTEST_TESTS_SRCS})
+
+TARGET_LINK_LIBRARIES(${TARGET_GTEST_TESTS} ${gtest_pkgs_LIBRARIES} gmock json-c curl pthread yaml gcov --coverage)
+INSTALL(TARGETS ${TARGET_GTEST_TESTS} DESTINATION ${BIN_INSTALL_DIR})