-
Notifications
You must be signed in to change notification settings - Fork 52
RDK-53592 L1/L2 run_ut.sh script for OCDM client repository #293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,148 @@ | ||
| name: Unit tests | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: ["master"] | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-24.04 | ||
|
|
||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| sudo apt -y install build-essential pkg-config cmake ninja-build libusb-1.0-0-dev zlib1g-dev libssl-dev | ||
| sudo apt -y install nodejs npm | ||
|
|
||
| - name: Install GStreamer | ||
| run: | | ||
| sudo apt update | ||
| sudo apt install -y libunwind-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: '3.x' | ||
| - run: pip install jsonref | ||
|
|
||
| - name: Checkout ThunderTools | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| repository: rdkcentral/ThunderTools | ||
| ref: R5_1 | ||
| path: ThunderTools | ||
|
|
||
| - name: Build ThunderTools | ||
| run: > | ||
| cmake -G Ninja -S ThunderTools -B build/ThunderTools -DCMAKE_INSTALL_PREFIX="install" | ||
| cmake --build build/ThunderTools --target install | ||
|
|
||
| - name: Checkout Thunder | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| repository: rdkcentral/Thunder | ||
| ref: R5_1 | ||
| path: Thunder | ||
|
|
||
| - name: Build Thunder | ||
| run: > | ||
| cmake -G Ninja -S Thunder -B build/Thunder \ | ||
| -DBINDING="127.0.0.1" \ | ||
| -DCMAKE_BUILD_TYPE="Debug" \ | ||
| -DCMAKE_INSTALL_PREFIX="install" \ | ||
| -DPORT="55555" \ | ||
| -DTOOLS_SYSROOT="${PWD}" \ | ||
| -DINITV_SCRIPT=OFF | ||
| cmake --build build/Thunder --target install | ||
|
|
||
| - name: Checkout ThunderInterfaces | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| repository: rdkcentral/ThunderInterfaces | ||
| ref: R5_1 | ||
| path: ThunderInterfaces | ||
|
|
||
| - name: Build ThunderInterfaces | ||
| run: > | ||
| cmake -G Ninja -S ThunderInterfaces -B build/ThunderInterfaces \ | ||
| -DCMAKE_INSTALL_PREFIX="install" | ||
| cmake --build build/ThunderInterfaces --target install | ||
|
|
||
| - name: Checkout ThunderNanoServices | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| repository: rdkcentral/ThunderNanoServices | ||
| ref: R5_1 | ||
| path: ThunderNanoServices | ||
|
|
||
| - name: Build ThunderNanoServices | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you need to build ThunderNanoServices and ThunderNanoServicesRDK for these tests? |
||
| run: > | ||
| cmake -G Ninja -S ThunderNanoServices -B build/ThunderNanoServices \ | ||
| -DCMAKE_INSTALL_PREFIX="install" \ | ||
| -DPLUGIN_COMMANDER=ON \ | ||
| -DPLUGIN_DIALSERVER=ON \ | ||
| -DPLUGIN_DICTIONARY=ON \ | ||
| -DPLUGIN_FILETRANSFER=ON \ | ||
| -DPLUGIN_INPUTSWITCH=ON \ | ||
| -DPLUGIN_PROCESSMONITOR=ON \ | ||
| -DPLUGIN_RESOURCEMONITOR=ON \ | ||
| -DPLUGIN_SYSTEMCOMMANDS=ON \ | ||
| -DPLUGIN_SWITCHBOARD=ON \ | ||
| -DPLUGIN_WEBPROXY=ON \ | ||
| -DPLUGIN_WEBSHELL=ON | ||
| cmake --build build/ThunderNanoServices --target install | ||
|
|
||
| - name: Checkout ThunderNanoServicesRDK | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| repository: rdkcentral/ThunderNanoServicesRDK | ||
| ref: R5_1 | ||
| path: ThunderNanoServicesRDK | ||
|
|
||
| - name: Build ThunderNanoServicesRDK | ||
| run: > | ||
| cmake -G Ninja -S ThunderNanoServicesRDK -B build/ThunderNanoServicesRDK \ | ||
| -DCMAKE_INSTALL_PREFIX="install" \ | ||
| -DPLUGIN_DEVICEINFO=ON \ | ||
| -DPLUGIN_MESSAGECONTROL=ON \ | ||
| -DPLUGIN_MESSENGER=ON \ | ||
| -DPLUGIN_MONITOR=ON \ | ||
| -DPLUGIN_OPENCDMI=ON \ | ||
| -DPLUGIN_PERFORMANCEMETRICS=ON | ||
| cmake --build build/ThunderNanoServicesRDK --target install | ||
|
|
||
| - name: Checkout ThunderClientLibraries | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| repository: rdkcentral/ThunderClientLibraries | ||
| ref: R5_1 | ||
| path: ThunderClientLibraries | ||
|
|
||
| - name: Build ThunderClientLibraries | ||
| run: > | ||
| cmake -G Ninja -S ThunderClientLibraries -B build/ThunderClientLibraries \ | ||
| -DCMAKE_INSTALL_PREFIX="install" \ | ||
| -DBLUETOOTHAUDIOSINK=ON \ | ||
| -DDEVICEINFO=ON \ | ||
| -DDISPLAYINFO=ON \ | ||
| -DSECURITYAGENT=ON \ | ||
| -DPLAYERINFO=ON \ | ||
| -DPROTOCOLS=ON \ | ||
| -DVIRTUALINPUT=ON \ | ||
| -DCDMI=ON \ | ||
| -DL1_TESTS=ON \ | ||
| -DL2_TESTS=ON | ||
| cmake --build build/ThunderClientLibraries --target install | ||
|
|
||
| - name: Export path | ||
| run: > | ||
| export LD_LIBRARY_PATH=${PWD}/install/lib:${LD_LIBRARY_PATH} | ||
| export PATH=${PWD}/install/bin:${PATH} | ||
|
|
||
| - name: Run unit tests | ||
| run: /bin/bash ThunderClientLibraries/run.sh -c | ||
|
|
||
| - name: Upload test results to automatic test result management system | ||
| run: > | ||
| gtest-json-result-push.py ${{github.workspace}}/ThunderClientLibraries/TestReport.json https://rdkeorchestrationservice.as-g8.cf.comcast.net/rdke_orchestration_api/push_unit_test_results `pwd` | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # If not stated otherwise in this file or this component's LICENSE file the | ||
| # following copyright and licenses apply: | ||
| # | ||
| # Copyright 2024 RDK Management | ||
| # | ||
| # 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. | ||
|
|
||
| cmake_minimum_required(VERSION 3.8) | ||
| project(L1Test) | ||
|
|
||
| set(CMAKE_CXX_STANDARD 11) | ||
|
|
||
| find_package(Thunder) | ||
| find_package(ClientOCDM REQUIRED) | ||
| find_package(${NAMESPACE}Core REQUIRED) | ||
| find_package(${NAMESPACE}COM REQUIRED) | ||
| find_package(${NAMESPACE}Messaging REQUIRED) | ||
| find_package(CompileSettingsDebug CONFIG REQUIRED) | ||
| find_package(GTest REQUIRED) | ||
| include(CTest) | ||
|
|
||
| file(GLOB TESTS tests/*.cpp) | ||
|
|
||
| add_executable(${PROJECT_NAME} | ||
| gtest_main.cpp | ||
| ${TESTS} | ||
| ) | ||
|
|
||
| include_directories(../../Source/ocdm) | ||
| link_directories(../../Source/ocdm) | ||
|
|
||
| target_link_libraries(${PROJECT_NAME} | ||
| ${NAMESPACE}Core::${NAMESPACE}Core | ||
| ${NAMESPACE}COM::${NAMESPACE}COM | ||
| ${NAMESPACE}Messaging::${NAMESPACE}Messaging | ||
| CompileSettingsDebug::CompileSettingsDebug | ||
| ClientOCDM::ClientOCDM | ||
| GTest::GTest | ||
| ) | ||
|
|
||
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage") | ||
| set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage") | ||
|
|
||
| gtest_add_tests(TARGET ${PROJECT_NAME}) | ||
|
|
||
| install(TARGETS ${PROJECT_NAME} DESTINATION bin) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| /* | ||
| * If not stated otherwise in this file or this component's license file the | ||
| * following copyright and licenses apply: | ||
| * | ||
| * Copyright 2024 RDK Management | ||
| * | ||
| * 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. | ||
| */ | ||
|
|
||
| #include <gtest/gtest.h> | ||
|
|
||
| int main(int argc, char** argv) | ||
| { | ||
| testing::InitGoogleTest(&argc, argv); | ||
| return RUN_ALL_TESTS(); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #!/bin/bash | ||
| # This script will build and run the L1 tests | ||
|
|
||
| rm -rf build | ||
|
|
||
| mkdir build | ||
|
|
||
| cd build | ||
|
|
||
| export GTEST_OUTPUT="json" | ||
|
|
||
| cmake .. | ||
|
|
||
| make | ||
|
|
||
| ./L1Test | ||
|
|
||
| #Generate coverage report | ||
| if [ "$1" != "" ] && [ $1 = "-c" ]; then | ||
| lcov --capture --directory . --output-file coverage.info | ||
| lcov --remove coverage.info '/usr/*' --output-file coverage.info | ||
| lcov --list coverage.info | ||
| genhtml coverage.info --output-directory coverage_report | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| /* | ||
| * If not stated otherwise in this file or this component's license file the | ||
| * following copyright and licenses apply: | ||
| * | ||
| * Copyright 2024 RDK Management | ||
| * | ||
| * 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. | ||
| */ | ||
|
|
||
| #include "open_cdm_impl.h" | ||
| #include "open_cdm_ext.h" | ||
| #include <gtest/gtest.h> | ||
| using namespace testing; | ||
|
|
||
| class OpenCDMExtTest : public ::testing::Test { | ||
| protected: | ||
|
|
||
| void SetUp() override { | ||
| } | ||
|
|
||
| void TearDown() override { | ||
| } | ||
| }; | ||
|
|
||
| TEST_F(OpenCDMExtTest, opencdmCreateSystem) | ||
| { | ||
| int status = 0; | ||
| const char keySystem[] = "playready"; | ||
| struct OpenCDMSystem* result; | ||
| result = opencdm_create_system(keySystem); | ||
| EXPECT_EQ(result, nullptr); | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| /* | ||
| * If not stated otherwise in this file or this component's license file the | ||
| * following copyright and licenses apply: | ||
| * | ||
| * Copyright 2024 RDK Management | ||
| * | ||
| * 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. | ||
| */ | ||
|
|
||
| #include "open_cdm.h" | ||
| #include <gtest/gtest.h> | ||
| using namespace testing; | ||
|
|
||
| class OpenCDMTest : public ::testing::Test { | ||
| protected: | ||
|
|
||
| void SetUp() override { | ||
| } | ||
|
|
||
| void TearDown() override { | ||
| } | ||
| }; | ||
|
|
||
| TEST_F(OpenCDMTest, status) | ||
| { | ||
| int status = 1; | ||
| EXPECT_EQ(status, 1); | ||
| } | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You most likely don't need that, as Python in installed on the runners by default