From 8741307f87d62672180ee1e1772ec8c48a75212a Mon Sep 17 00:00:00 2001 From: AdityaKasar Date: Fri, 8 Nov 2024 18:16:05 +0530 Subject: [PATCH] fixup! chore: CI to test CPP SDK --- .../core/src/cpp/sdk/cpptest/CMakeLists.txt | 67 +++++++++---------- 1 file changed, 33 insertions(+), 34 deletions(-) diff --git a/src/sdks/core/src/cpp/sdk/cpptest/CMakeLists.txt b/src/sdks/core/src/cpp/sdk/cpptest/CMakeLists.txt index 4b1b6a8f6..ad715a663 100644 --- a/src/sdks/core/src/cpp/sdk/cpptest/CMakeLists.txt +++ b/src/sdks/core/src/cpp/sdk/cpptest/CMakeLists.txt @@ -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) @@ -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 - $ -) + 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 + $ + $ + $ + $ + ) -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} )