|
| 1 | +# |
| 2 | +# Copyright 2021 The Modelbox Project Authors. All Rights Reserved. |
| 3 | +# |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
| 15 | + |
| 16 | + |
| 17 | +cmake_minimum_required(VERSION 3.10) |
| 18 | + |
| 19 | +file(GLOB MANAGER_TEST_SOURCE *.cpp *.cc *.c) |
| 20 | + |
| 21 | +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) |
| 22 | +include_directories(${CMAKE_CURRENT_BINARY_DIR}) |
| 23 | +include_directories(${MOCK_DRIVER_CTRL_INCLUDE}) |
| 24 | +include_directories(${TEST_INCLUDE}) |
| 25 | +include_directories(${DRIVER_UNIT_TEST_INCLUDE}) |
| 26 | + |
| 27 | +set(MANAGER_TEST_SOURCE ${MANAGER_TEST_SOURCE} CACHE INTERNAL "") |
| 28 | + |
| 29 | +add_executable(manager-unit EXCLUDE_FROM_ALL |
| 30 | + ${MANAGER_TEST_SOURCE} |
| 31 | + ${MODELBOX_MANAGER_SOURCES} |
| 32 | +) |
| 33 | + |
| 34 | +target_link_libraries(manager-unit pthread) |
| 35 | +target_link_libraries(manager-unit rt) |
| 36 | +target_link_libraries(manager-unit gtest_main) |
| 37 | +target_link_libraries(manager-unit gmock_main) |
| 38 | +target_link_libraries(manager-unit ${HUAWEI_SECURE_C_LIBRARIES}) |
| 39 | +target_link_libraries(manager-unit ${TLOG_STATIC_LIBRARIES}) |
| 40 | + |
| 41 | +add_custom_target(unittest-manager |
| 42 | + COMMAND ${TEST_RUNNER_LIST} ${CMAKE_CURRENT_BINARY_DIR}/manager-unit |
| 43 | + DEPENDS manager-unit |
| 44 | + WORKING_DIRECTORY ${TEST_WORKING_DIR} |
| 45 | + COMMENT "Run manager-unit Test..." |
| 46 | +) |
| 47 | + |
| 48 | +list(APPEND MODELBOX_UNIT_TEST_TARGETS manager) |
| 49 | +set(MODELBOX_UNIT_TEST_TARGETS ${MODELBOX_UNIT_TEST_TARGETS} CACHE INTERNAL "") |
| 50 | + |
| 51 | +list(APPEND MODELBOX_UNIT_TEST_RUN_TARGETS unittest-manager) |
| 52 | +set(MODELBOX_UNIT_TEST_RUN_TARGETS ${MODELBOX_UNIT_TEST_RUN_TARGETS} CACHE INTERNAL "") |
0 commit comments