-
Notifications
You must be signed in to change notification settings - Fork 26
RDKEMW-16911 - L1 unit tests for xdialserver #199
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
Merged
Merged
Changes from all commits
Commits
Show all changes
81 commits
Select commit
Hold shift + click to select a range
3051cfe
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 dfe7a36
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 e1fca6e
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 549332f
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 00c605c
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 7d6319f
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 c9dc8f3
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 8e2350f
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 e9e5af7
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 c14cfff
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 e6fe2a5
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 6d82c7d
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 2dcd07d
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 bbe891c
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 f6fd97b
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 61c1e04
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 36e9568
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 90f399f
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 342bbef
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 129f558
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 4544418
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 71e92a2
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 49f6015
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 ddfbeb1
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 c95194f
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 6d73736
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 8bc42e3
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 746473f
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 21b369f
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 2334ca6
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 bb543a7
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 f92274a
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 9094d2c
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 51ab903
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 145fa7a
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 f9b66ca
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 75015b9
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 0214d86
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 41600cd
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 5f843aa
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 5c03e51
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 5809b70
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 7270c9a
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 d8309a7
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 5a1874d
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 bd0c153
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 e3171f1
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 838bb43
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 fd2d6a6
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 874e442
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 11df700
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 300275e
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 e288f38
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 ada8b33
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 2a4a195
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 658de2d
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 b314c78
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 aeddd10
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 03fc591
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 f8a029d
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 e5cadc2
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 99fb7ec
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 4825b2d
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 3f4db48
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 9e7f29d
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 ef58835
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 9c50613
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 2db6910
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 04b8a49
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 35025dc
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 22adc93
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 e268257
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 3d79876
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 3ba9339
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 b831e8b
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 86bf6c7
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 46b2768
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 146de47
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 b25b4f4
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 846e6f2
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 cfa5da2
RDKEMW-16911 - L1 unit tests for xdialserver
hgfell683 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,252 @@ | ||
| name: L1-tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - develop | ||
| - main | ||
| pull_request: | ||
| branches: | ||
| - develop | ||
| - main | ||
| workflow_call: | ||
| secrets: | ||
| RDKCM_RDKE: | ||
| required: true | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| BUILD_TYPE: Debug | ||
|
|
||
| jobs: | ||
| L1-tests: | ||
| name: Build and run unit tests | ||
| runs-on: ubuntu-22.04 | ||
|
|
||
| steps: | ||
| - name: Set up CMake | ||
| uses: jwlawson/actions-setup-cmake@v1.13 | ||
| with: | ||
| cmake-version: '3.16.x' | ||
| github-api-token: '' | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: '3.x' | ||
| - run: pip install jsonref | ||
|
|
||
| - name: ACK External Trigger | ||
| run: | | ||
| echo "Message: External Trigger Received for L1 Tests" | ||
| echo "Trigger Source: ${{ inputs.caller_source }}" | ||
|
|
||
| - name: Set up CMake | ||
| uses: jwlawson/actions-setup-cmake@v1.13 | ||
| with: | ||
| cmake-version: '3.16.x' | ||
|
|
||
|
hgfell683 marked this conversation as resolved.
|
||
| - name: Install packages | ||
| run: > | ||
| sudo apt update | ||
| && | ||
| sudo apt install -y | ||
| autoconf automake libtool pkg-config | ||
| libgtest-dev libgmock-dev | ||
| build-essential g++ cmake | ||
| valgrind lcov clang ninja-build | ||
| libglib2.0-dev libdbus-1-dev | ||
| libgssdp-1.2-dev libsoup2.4-dev libxml2-dev | ||
| uuid-dev libcurl4-openssl-dev | ||
| libsystemd-dev libboost-all-dev libwebsocketpp-dev | ||
| meson libcunit1 libcunit1-dev curl | ||
| protobuf-compiler-grpc libgrpc-dev libgrpc++-dev | ||
| libyajl-dev | ||
|
|
||
| - name: Build trower-base64 | ||
| run: | | ||
| if [ ! -d "trower-base64" ]; then | ||
| git clone https://github.com/xmidt-org/trower-base64.git | ||
| fi | ||
| cd trower-base64 | ||
| meson setup --warnlevel 3 --werror build | ||
| ninja -C build | ||
| sudo ninja -C build install | ||
|
|
||
| - name: Checkout xdialserver | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| path: xdialserver | ||
|
|
||
| # - name: Checkout entservices-testframework | ||
| # uses: actions/checkout@v3 | ||
| # with: | ||
| # repository: rdkcentral/entservices-testframework | ||
| # path: entservices-testframework | ||
| # token: ${{ secrets.RDKCM_RDKE }} | ||
| # ref: feature/RDKEMW-14961-2 | ||
|
|
||
| - name: Checkout googletest | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| repository: google/googletest | ||
| path: googletest | ||
| ref: v1.15.0 | ||
|
|
||
| - name: Build googletest | ||
| run: | | ||
| cmake -S "$GITHUB_WORKSPACE/googletest" \ | ||
| -B build/googletest \ | ||
| -DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/install/usr" \ | ||
| -DBUILD_GMOCK=ON \ | ||
| -DBUILD_SHARED_LIBS=OFF \ | ||
| -DCMAKE_POSITION_INDEPENDENT_CODE=ON | ||
| cmake --build build/googletest -j$(nproc) | ||
| cmake --install build/googletest | ||
|
|
||
| # - name: Generate external headers | ||
| # # Empty headers to mute errors | ||
| # run: > | ||
| # cd "$GITHUB_WORKSPACE/entservices-testframework/Tests/" | ||
| # && | ||
| # mkdir -p | ||
| # headers | ||
| # headers/WPEFramework | ||
| # headers/WPEFramework/core | ||
| # headers/WPEFramework/interfaces | ||
| # headers/rdk/iarmbus | ||
| # headers/rdk/iarmmgrs-hal | ||
| # headers/uuid | ||
| # && | ||
| # cd headers | ||
| # && | ||
| # touch | ||
| # WPEFramework/core.h | ||
| # WPEFramework/interfaces.h | ||
| # WPEFramework/plugins.h | ||
| # rdk/iarmbus/libIBus.h | ||
| # rdk/iarmbus/libIBusDaemon.h | ||
| # rdk/iarmmgrs-hal/iarmmgrs_hal.h | ||
| # uuid/uuid.h | ||
| # && | ||
| # mkdir -p proc | ||
| # && | ||
| # touch proc/readproc.h | ||
|
|
||
| - name: Generate stub headers | ||
| # Individual shadow headers that source files #include are generated | ||
| # here as thin wrappers so they never need to be committed. | ||
| # Truly empty stubs are created with touch. | ||
| # C++ shim definitions for gdial.cpp live in | ||
| # tests/L1Tests/stubs/gdial_cpp_test_stubs.hpp and are included by | ||
| # lightweight wrappers generated here. | ||
| run: | | ||
| STUBS="$GITHUB_WORKSPACE/xdialserver/tests/L1Tests/stubs" | ||
| WRAPPER='#pragma once' | ||
| CPP_WRAPPER='#pragma once\n#include "gdial_cpp_test_stubs.hpp"' | ||
|
|
||
| # Create stubs directory if it doesn't exist | ||
| mkdir -p "$STUBS" | ||
|
|
||
| # Shadow headers: block the real headers and redirect to the | ||
| # combined stub. | ||
| for f in \ | ||
| libIBus.h libIARMCore.h; do | ||
| printf "$WRAPPER\n" > "$STUBS/$f" | ||
| done | ||
|
|
||
| # Empty stubs: headers from WPEFramework and IARM that are unused | ||
| # in the test paths. | ||
| touch \ | ||
| "$STUBS/libIARMBus.h" \ | ||
| "$STUBS/libIBusDaemon.h" \ | ||
| "$STUBS/libIARMUtil.h" | ||
|
|
||
| # gdial.cpp wrappers: keep source definitions in a committed mock | ||
| # file and generate only include shims here. | ||
| mkdir -p "$STUBS/com" "$STUBS/json" "$STUBS/securityagent" | ||
| for f in core.h plugins.h securityagent/SecurityTokenUtil.h; do | ||
| printf "$CPP_WRAPPER\n" > "$STUBS/$f" | ||
| done | ||
|
|
||
| # Truly empty stubs for unused headers. | ||
| touch \ | ||
| "$STUBS/com/Ids.h" \ | ||
| "$STUBS/json/JsonData_Netflix.h" \ | ||
| "$STUBS/json/JsonData_StateControl.h" | ||
|
|
||
| - name: Build xdialserver L1 tests | ||
| run: | | ||
| cd "$GITHUB_WORKSPACE/xdialserver" | ||
| autoreconf -if | ||
|
|
||
| # Compiler / linker flags for coverage instrumentation | ||
| export CFLAGS="-fprofile-arcs -ftest-coverage -g -O0" | ||
| export CXXFLAGS="-fprofile-arcs -ftest-coverage -g -O0" | ||
| export LDFLAGS="--coverage" | ||
|
|
||
| # Tell pkg-config / the build where to find googletest | ||
| export PKG_CONFIG_PATH="$GITHUB_WORKSPACE/install/usr/lib/pkgconfig:${PKG_CONFIG_PATH:-}" | ||
| export CPPFLAGS="-I$GITHUB_WORKSPACE/install/usr/include" | ||
| export LIBRARY_PATH="$GITHUB_WORKSPACE/install/usr/lib:${LIBRARY_PATH:-}" | ||
|
|
||
| ./configure --enable-l1tests | ||
| # TESTFRAMEWORK_DIR="$GITHUB_WORKSPACE/entservices-testframework" | ||
| make -C tests/L1Tests | ||
|
|
||
| - name: Run unit tests without valgrind | ||
| run: | | ||
| cd "$GITHUB_WORKSPACE/xdialserver/tests/L1Tests" | ||
| ./run_L1Tests --gtest_output="json:$GITHUB_WORKSPACE/xdialserverL1TestResults.json" | ||
| cp "$GITHUB_WORKSPACE/xdialserverL1TestResults.json" \ | ||
| "$GITHUB_WORKSPACE/xdialserverL1TestResultsWithoutValgrind.json" | ||
|
|
||
| - name: Run unit tests with valgrind | ||
| if: ${{ !env.ACT }} | ||
| run: | | ||
| cd "$GITHUB_WORKSPACE/xdialserver/tests/L1Tests" | ||
| valgrind \ | ||
| --tool=memcheck \ | ||
| --log-file="$GITHUB_WORKSPACE/valgrind_log" \ | ||
| --leak-check=yes \ | ||
| --show-reachable=yes \ | ||
| --track-fds=yes \ | ||
| --fair-sched=try \ | ||
| ./run_L1Tests --gtest_output="json:$GITHUB_WORKSPACE/xdialserverL1TestResultsWithValgrind.json" | ||
|
|
||
| - name: Generate coverage | ||
| if: ${{ !env.ACT }} | ||
| run: | | ||
| lcov -c \ | ||
| -o coverage.info \ | ||
| -d "$GITHUB_WORKSPACE/xdialserver" | ||
|
|
||
| lcov -r coverage.info \ | ||
| '/usr/include/*' \ | ||
| '*/install/usr/include/*' \ | ||
| '*/googletest/*' \ | ||
| '*/entservices-testframework/*' \ | ||
| '*/tests/*' \ | ||
| '*/mocks/*' \ | ||
| '*/stubs/*' \ | ||
| -o filtered_coverage.info | ||
|
|
||
| genhtml \ | ||
| -o coverage \ | ||
| -t "xdialserver L1 coverage" \ | ||
| filtered_coverage.info | ||
|
|
||
| - name: Upload artifacts | ||
| if: ${{ !env.ACT }} | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: artifacts-L1-xdialserver | ||
| path: | | ||
| coverage/ | ||
| valgrind_log | ||
| xdialserverL1TestResultsWithoutValgrind.json | ||
| xdialserverL1TestResultsWithValgrind.json | ||
| if-no-files-found: warn | ||
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,20 @@ | ||
| ########################################################################## | ||
| # If not stated otherwise in this file or this component's LICENSE | ||
| # file the following copyright and licenses apply: | ||
| # | ||
| # Copyright 2019 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. | ||
| ########################################################################## | ||
|
|
||
| SUBDIRS = 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,72 @@ | ||
| ########################################################################## | ||
| # If not stated otherwise in this file or this component's LICENSE | ||
| # file the following copyright and licenses apply: | ||
| # | ||
| # Copyright 2019 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. | ||
| ########################################################################## | ||
|
|
||
| AC_INIT([xdialserver], [1.0.0]) | ||
| AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects]) | ||
|
|
||
| AC_PROG_CC | ||
| AC_PROG_CXX | ||
| AC_PROG_RANLIB | ||
| AM_PROG_AR | ||
|
|
||
| # Check for pkg-config | ||
| PKG_CHECK_MODULES([GLIB], [glib-2.0]) | ||
| PKG_CHECK_MODULES([GIO], [gio-2.0]) | ||
|
|
||
| # Check for DIAL protocol dependencies | ||
| PKG_CHECK_MODULES([GSSDP], [gssdp-1.2], | ||
| [], | ||
| [PKG_CHECK_MODULES([GSSDP], [gssdp-1.0], | ||
| [], | ||
| [AC_MSG_WARN([gssdp library not found])])]) | ||
|
hgfell683 marked this conversation as resolved.
|
||
|
|
||
| PKG_CHECK_MODULES([SOUP], [libsoup-2.4], | ||
| [], | ||
| [PKG_CHECK_MODULES([SOUP], [libsoup-3.0], | ||
| [], | ||
| [AC_MSG_WARN([libsoup library not found])])]) | ||
|
hgfell683 marked this conversation as resolved.
|
||
|
|
||
| PKG_CHECK_MODULES([XML2], [libxml-2.0]) | ||
|
|
||
| # Optional RDK-specific packages | ||
| PKG_CHECK_MODULES([WPEFRAMEWORK], [WPEFramework], [], | ||
| [AC_MSG_WARN([WPEFramework development headers not found - platform tests may be limited])]) | ||
| PKG_CHECK_MODULES([IARMBUS], [libIARMBus], [], | ||
| [AC_MSG_WARN([libIARMBus development headers not found - IARM tests may be limited])]) | ||
|
|
||
| # L1 Tests support | ||
| AC_ARG_ENABLE([l1tests], | ||
| [AS_HELP_STRING([--enable-l1tests], [Enable L1 unit tests])], | ||
| [enable_l1tests="$enableval"], | ||
| [enable_l1tests="no"]) | ||
|
|
||
| AM_CONDITIONAL([ENABLE_L1TESTS], [test "x$enable_l1tests" = "xyes"]) | ||
|
|
||
| if test "x$enable_l1tests" = "xyes"; then | ||
| PKG_CHECK_MODULES([GTEST], [gtest], [], [AC_MSG_WARN([gtest not found in pkg-config])]) | ||
| PKG_CHECK_MODULES([GMOCK], [gmock], [], [AC_MSG_WARN([gmock not found in pkg-config])]) | ||
| fi | ||
|
|
||
| AC_CONFIG_FILES([ | ||
| Makefile | ||
| tests/Makefile | ||
| tests/L1Tests/Makefile | ||
| ]) | ||
|
|
||
| AC_OUTPUT | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.