Skip to content

Commit

Permalink
fixup! chore: CI to test CPP SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaKasar committed Nov 8, 2024
1 parent 1669e35 commit 8741307
Showing 1 changed file with 33 additions and 34 deletions.
67 changes: 33 additions & 34 deletions src/sdks/core/src/cpp/sdk/cpptest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

cmake_minimum_required(VERSION 3.3)

project(FireboltCoreSDKTests)
project(FireboltManageSDKTests)

if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${SYSROOT_PATH}/usr" CACHE INTERNAL "" FORCE)
Expand All @@ -40,53 +40,52 @@ endif ()
find_package(WPEFramework CONFIG REQUIRED)
find_package(${NAMESPACE}Core CONFIG REQUIRED)

set(TESTAPP TestFireboltCore)
if(ENABLE_TESTS)
set(TESTAPP TestFireboltManage)

message("Setup ${TESTAPP}")
message("Setup ${TESTAPP}")

add_executable(${TESTAPP} CoreSDKTest.cpp Main.cpp)
add_executable(${TESTAPP} ManageSDKTest.cpp Main.cpp)

target_link_libraries(${TESTAPP}
PRIVATE
${NAMESPACE}Core::${NAMESPACE}Core
${FIREBOLT_NAMESPACE}SDK::${FIREBOLT_NAMESPACE}SDK
nlohmann_json_schema_validator
gtest_main
)

target_include_directories(${TESTAPP}
PRIVATE
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include/>
)
target_link_libraries(${TESTAPP}
PRIVATE
${NAMESPACE}Core::${NAMESPACE}Core
${FIREBOLT_NAMESPACE}SDK::${FIREBOLT_NAMESPACE}SDK
nlohmann_json_schema_validator
gtest_main
)

if (POLYMORPHICS_REDUCER_METHODS)
target_compile_definitions(${TESTAPP}
PUBLIC
POLYMORPHICS_REDUCER_METHODS=1)
endif()
target_include_directories(${TESTAPP}
PRIVATE
$<BUILD_INTERFACE:${FIREBOLT_PATH}/usr/include/${FIREBOLT_NAMESPACE}SDK>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SRC_DIR}/>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SRC_DIR}/../>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include/>
)

set_target_properties(${TESTAPP} PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED YES
)
set_target_properties(${TESTAPP} PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED YES
)

add_custom_command(
TARGET ${TESTAPP}
POST_BUILD
COMMENT "=================== Installing TestApp ======================"
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/${FIREBOLT_NAMESPACE}/usr/bin
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/${TESTAPP} ${CMAKE_BINARY_DIR}/${FIREBOLT_NAMESPACE}/usr/bin
)
add_custom_command(
TARGET ${TESTAPP}
POST_BUILD
COMMENT "=================== Installing TestApp ======================"
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/${FIREBOLT_NAMESPACE}/usr/bin
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/${TESTAPP} ${CMAKE_BINARY_DIR}/${FIREBOLT_NAMESPACE}/usr/bin
)
endif()

if(ENABLE_UNIT_TESTS)
set(UNIT_TESTS_APP FireboltCoreUnitTests)
set(UNIT_TESTS_APP FireboltManageUnitTests)

message("Setup ${UNIT_TESTS_APP}")

file(GLOB UNIT_TESTS "unit/*")

add_executable(${UNIT_TESTS_APP}
CoreSDKTest.cpp
ManageSDKTest.cpp
Unit.cpp
${UNIT_TESTS}
)
Expand Down

0 comments on commit 8741307

Please sign in to comment.