Skip to content

Commit

Permalink
native tests added
Browse files Browse the repository at this point in the history
  • Loading branch information
HaseenaSainul committed Jul 17, 2023
1 parent f4e3b79 commit be41b3e
Show file tree
Hide file tree
Showing 15 changed files with 1,379 additions and 424 deletions.
466 changes: 46 additions & 420 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,19 @@
"devDependencies": {
"@commitlint/cli": "^17.0.3",
"@commitlint/config-conventional": "^17.0.3",
"@firebolt-js/openrpc": "rdkcentral/firebolt-openrpc#next",
"@firebolt-js/openrpc": "file:../firebolt-openrpc",
"@firebolt-js/schemas": "0.10.0",
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/git": "^10.0.1",
"@semantic-release/npm": "^9.0.1",
"@semantic-release/release-notes-generator": "^10.0.1",
"ajv": "^6.12.6",
"production-changelog": "./src/js/production-changelog/",
"husky": "^8.0.0",
"jest": "^28.1.0",
"jest-environment-jsdom": "^28.1.3",
"mkdirp": "^2.1.6",
"nopt": "^7.1.0",
"production-changelog": "./src/js/production-changelog/",
"semantic-release": "^19.0.5",
"typescript": "^4.6.4"
},
Expand Down
4 changes: 2 additions & 2 deletions src/openrpc/capabilities.json
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@
}
],
"result": {
"name": "Default Result",
"name": "request",
"summary": "Returns an array of CapabilityInfo objects for the passed in capabilities.",
"schema": {
"type": "array",
Expand Down Expand Up @@ -907,4 +907,4 @@
}
}
}
}
}
68 changes: 68 additions & 0 deletions src/sdks/core/src/cpp/sdk/ctest/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Copyright 2023 Comcast Cable Communications Management, LLC
#
# 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.
#
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.3)

project(FireboltCoreSDKTests)

if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${SYSROOT_PATH}/usr" CACHE INTERNAL "" FORCE)
set(CMAKE_PREFIX_PATH ${SYSROOT_PATH}/usr/lib/cmake CACHE INTERNAL "" FORCE)
endif()

list(APPEND CMAKE_MODULE_PATH
"${SYSROOT_PATH}/usr/lib/cmake"
"${SYSROOT_PATH}/tools/cmake")
message("FIREBOLT_PATH inside cmake " ${FIREBOLT_PATH})
if (FIREBOLT_PATH)
set(CMAKE_FIREBOLT_PATH
"${FIREBOLT_PATH}/usr/lib/cmake/Firebolt"
"${FIREBOLT_PATH}/usr/lib/cmake/FireboltSDK")
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_FIREBOLT_PATH})
list(APPEND CMAKE_MODULE_PATH ${CMAKE_FIREBOLT_PATH})
else ()
set(FIREBOLT_PATH "${SYSROOT_PATH}" CACHE INTERNAL "" FORCE)
endif ()

find_package(WPEFramework CONFIG REQUIRED)
find_package(Firebolt CONFIG REQUIRED)
find_package(${FIREBOLT_NAMESPACE}SDK CONFIG REQUIRED)

set(TESTAPP TestFireboltCore)

message("Setup ${TESTAPP}")

add_executable(${TESTAPP} main.c)

target_link_libraries(${TESTAPP}
PRIVATE
${FIREBOLT_NAMESPACE}SDK::${FIREBOLT_NAMESPACE}SDK
)

target_include_directories(${TESTAPP}
PRIVATE
$<BUILD_INTERFACE:${FIREBOLT_PATH}/usr/include/${FIREBOLT_NAMESPACE}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SRC_DIR}/>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SRC_DIR}/../>
)

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
)
40 changes: 40 additions & 0 deletions src/sdks/core/src/cpp/sdk/ctest/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash
usage()
{
echo "options:"
echo " -t test path"
echo " -s sysroot path"
echo " -f firebolt path"
echo " -c clear build"
echo " -h : help"
echo
echo "usage: "
echo " ./build.sh -t testpath -c -f fireboltpath -s sysrootpath"
}

TestPath="."
FireboltPath=${FIREBOLT_PATH}
SysrootPath=${SYSROOT_PATH}
ClearBuild="N"
while getopts t:s:f:ch flag
do
case "${flag}" in
t) TestPath="${OPTARG}";;
s) SysrootPath="${OPTARG}";;
f) FireboltPath="${OPTARG}";;
c) ClearBuild="Y";;
h) usage && exit 1;;
esac
done

if [ "${ClearBuild}" == "Y" ];
then
rm -rf ${TestPath}/build
fi

echo "TestPath"
echo "${TestPath}"
echo "FireboltPath"
echo ${FireboltPath}
cmake -B${TestPath}/build -S${TestPath} -DSYSROOT_PATH=${SysrootPath} -DFIREBOLT_PATH=${FireboltPath}
cmake --build ${TestPath}/build
Loading

0 comments on commit be41b3e

Please sign in to comment.