Skip to content

Commit

Permalink
new workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
parvathika authored and parvathinew committed Sep 3, 2024
1 parent 95285d2 commit 7f2279d
Show file tree
Hide file tree
Showing 27 changed files with 823 additions and 12 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/L1test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@

name: l1-test

on:
push:
branches: [ main, develop, 'topic/**']
branches: [ main, develop]
pull_request:
branches: [ main, develop]

Expand Down Expand Up @@ -191,9 +192,7 @@ jobs:
-DEXCEPTIONS_ENABLE=ON
-I ${{github.workspace}}/networkmanagerTests/headers
-I ${{github.workspace}}/networkmanager/Tests/headers/rdk/iarmbus
-I ${{github.workspace}}/networkmanager/Tests/headers/network
-Wall -Werror -Wno-error=format=
-Wl,-wrap,system -Wl,-wrap,popen -Wl,-wrap,syslog"
-I ${{github.workspace}}/networkmanager/Tests/headers/network"
-DCMAKE_DISABLE_FIND_PACKAGE_IARMBus=ON
-DENABLE_GNOME_NETWORKMANAGER=OFF
-DENABLE_NETWORKMANAGER_UNIT_TEST=ON
Expand Down
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ if(ENABLE_GNOME_NETWORKMANAGER)
pkg_check_modules(GLIB REQUIRED glib-2.0)
pkg_check_modules(LIBNM REQUIRED libnm)
else()
find_package(IARMBus REQUIRED)
find_package(IARMBus)
endif ()

if(ENABLE_NETWORKMANAGER_UNIT_TEST)
include(cmake/UnitTest.cmake)
endif()

message("Setup ProxyStub for INetworkManager.h")
find_package(CompileSettingsDebug CONFIG REQUIRED)
Expand Down
6 changes: 2 additions & 4 deletions NetworkManagerRDKProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,6 @@ namespace WPEFramework
}
void NetworkManagerImplementation::threadEventRegistration()
{
IARM_Result_t res = IARM_RESULT_SUCCESS;
IARM_Result_t retVal = IARM_RESULT_SUCCESS;
do
{
Expand Down Expand Up @@ -599,7 +598,7 @@ namespace WPEFramework
usleep(500*1000);
retry++;
}
}while((retVal != IARM_RESULT_SUCCESS) && (retry < 3));
}while((retVal != IARM_RESULT_SUCCESS) && (retry < 10));

if(retVal != IARM_RESULT_SUCCESS)
{
Expand Down Expand Up @@ -1216,7 +1215,7 @@ const string CIDR_PREFIXES[CIDR_NETMASK_IP_LEN] = {
if (!signalStrength.empty())
{
signalStrengthOut = std::stof(signalStrength.c_str());
NMLOG_INFO ("WiFiSignalStrength in dB = %s",signalStrengthOut);
NMLOG_INFO ("WiFiSignalStrength in dB = %f",signalStrengthOut);
}

if (signalStrengthOut == 0)
Expand Down Expand Up @@ -1311,7 +1310,6 @@ const string CIDR_PREFIXES[CIDR_NETMASK_IP_LEN] = {
{
LOG_ENTRY_FUNCTION();
uint32_t rc = Core::ERROR_RPC_CALL_FAILED;
IARM_Result_t retVal = IARM_RESULT_SUCCESS;
IARM_Bus_WiFiSrvMgr_Param_t param;
memset(&param, 0, sizeof(param));

Expand Down
4 changes: 2 additions & 2 deletions NetworkManagerStunClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ bool client::bind(
auto time_in_cache = std::chrono::duration_cast<std::chrono::seconds>(
std::chrono::steady_clock::now() - m_last_cache_time);

verbose("client::bind cache time=%lld\n", time_in_cache.count());
verbose("client::bind cache time=%ld\n", time_in_cache.count());

if(time_in_cache.count() < m_cache_timeout)
{
Expand Down Expand Up @@ -672,7 +672,7 @@ std::unique_ptr<message> client::send_binding_request(std::chrono::milliseconds
std::unique_ptr<message> client::send_binding_request(sockaddr_storage const & addr,
std::chrono::milliseconds wait_time)
{
this->verbose("sending binding request with wait time:%lld ms\n", wait_time.count());
this->verbose("sending binding request with wait time:%ld ms\n", wait_time.count());
this->create_udp_socket(addr.ss_family);
std::unique_ptr<message> binding_request(message_factory::create_binding_request());
std::unique_ptr<message> binding_response(this->send_message(addr, *binding_request, wait_time));
Expand Down
181 changes: 181 additions & 0 deletions Tests/L1 Tests/.lcovrc_l1
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
#
# /etc/lcovrc - system-wide defaults for LCOV
#
# To change settings for a single user, place a customized copy of this file
# at location ~/.lcovrc
#

# Specify an external style sheet file (same as --css-file option of genhtml)
#genhtml_css_file = gcov.css

# Specify coverage rate limits (in %) for classifying file entries
# HI: hi_limit <= rate <= 100 graph color: green
# MED: med_limit <= rate < hi_limit graph color: orange
# LO: 0 <= rate < med_limit graph color: red
genhtml_hi_limit = 75
genhtml_med_limit = 50

# Width of line coverage field in source code view
genhtml_line_field_width = 12

# Width of branch coverage field in source code view
genhtml_branch_field_width = 16

# Width of overview image (used by --frames option of genhtml)
genhtml_overview_width = 80

# Resolution of overview navigation: this number specifies the maximum
# difference in lines between the position a user selected from the overview
# and the position the source code window is scrolled to (used by --frames
# option of genhtml)
genhtml_nav_resolution = 4

# Clicking a line in the overview image should show the source code view at
# a position a bit further up so that the requested line is not the first
# line in the window. This number specifies that offset in lines (used by
# --frames option of genhtml)
genhtml_nav_offset = 10

# Do not remove unused test descriptions if non-zero (same as
# --keep-descriptions option of genhtml)
genhtml_keep_descriptions = 0

# Do not remove prefix from directory names if non-zero (same as --no-prefix
# option of genhtml)
genhtml_no_prefix = 0

# Do not create source code view if non-zero (same as --no-source option of
# genhtml)
genhtml_no_source = 0

# Replace tabs with number of spaces in source view (same as --num-spaces
# option of genhtml)
genhtml_num_spaces = 8

# Highlight lines with converted-only data if non-zero (same as --highlight
# option of genhtml)
genhtml_highlight = 0

# Include color legend in HTML output if non-zero (same as --legend option of
# genhtml)
genhtml_legend = 0

# Use FILE as HTML prolog for generated pages (same as --html-prolog option of
# genhtml)
#genhtml_html_prolog = FILE

# Use FILE as HTML epilog for generated pages (same as --html-epilog option of
# genhtml)
#genhtml_html_epilog = FILE

# Use custom filename extension for pages (same as --html-extension option of
# genhtml)
#genhtml_html_extension = html

# Compress all generated html files with gzip.
#genhtml_html_gzip = 1

# Include sorted overview pages (can be disabled by the --no-sort option of
# genhtml)
genhtml_sort = 1

# Include function coverage data display (can be disabled by the
# --no-func-coverage option of genhtml)
#genhtml_function_coverage = 1

# Include branch coverage data display (can be disabled by the
# --no-branch-coverage option of genhtml)
#genhtml_branch_coverage = 1

# Specify the character set of all generated HTML pages
genhtml_charset=UTF-8

# Allow HTML markup in test case description text if non-zero
genhtml_desc_html=0

# Specify the precision for coverage rates
#genhtml_precision=1

# Show missed counts instead of hit counts
#genhtml_missed=1

# Demangle C++ symbols
#genhtml_demangle_cpp=1

# Name of the tool used for demangling C++ function names
#genhtml_demangle_cpp_tool = c++filt

# Specify extra parameters to be passed to the demangling tool
#genhtml_demangle_cpp_params = ""

# Location of the gcov tool (same as --gcov-info option of geninfo)
#geninfo_gcov_tool = gcov

# Adjust test names to include operating system information if non-zero
#geninfo_adjust_testname = 0

# Calculate checksum for each source code line if non-zero (same as --checksum
# option of geninfo if non-zero, same as --no-checksum if zero)
#geninfo_checksum = 1

# Specify whether to capture coverage data for external source files (can
# be overridden by the --external and --no-external options of geninfo/lcov)
#geninfo_external = 1

# Enable libtool compatibility mode if non-zero (same as --compat-libtool option
# of geninfo if non-zero, same as --no-compat-libtool if zero)
#geninfo_compat_libtool = 0

# Use gcov's --all-blocks option if non-zero
#geninfo_gcov_all_blocks = 1

# Specify compatiblity modes (same as --compat option of geninfo).
#geninfo_compat = libtool=on, hammer=auto, split_crc=auto

# Adjust path to source files by removing or changing path components that
# match the specified pattern (Perl regular expression format)
#geninfo_adjust_src_path = /tmp/build => /usr/src

# Specify if geninfo should try to automatically determine the base-directory
# when collecting coverage data.
geninfo_auto_base = 1

# Use gcov intermediate format? Valid values are 0, 1, auto
geninfo_intermediate = auto

# Specify if exception branches should be excluded from branch coverage.
geninfo_no_exception_branch = 0

# Directory containing gcov kernel files
# lcov_gcov_dir = /proc/gcov

# Location of the insmod tool
lcov_insmod_tool = /sbin/insmod

# Location of the modprobe tool
lcov_modprobe_tool = /sbin/modprobe

# Location of the rmmod tool
lcov_rmmod_tool = /sbin/rmmod

# Location for temporary directories
lcov_tmp_dir = /tmp

# Show full paths during list operation if non-zero (same as --list-full-path
# option of lcov)
lcov_list_full_path = 0

# Specify the maximum width for list output. This value is ignored when
# lcov_list_full_path is non-zero.
lcov_list_width = 80

# Specify the maximum percentage of file names which may be truncated when
# choosing a directory prefix in list output. This value is ignored when
# lcov_list_full_path is non-zero.
lcov_list_truncate_max = 20

# Specify if function coverage data should be collected and processed.
lcov_function_coverage = 1

# Specify if branch coverage data should be collected and processed.
lcov_branch_coverage = 0
File renamed without changes.
1 change: 1 addition & 0 deletions Tests/gcc-with-coverage.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")
46 changes: 46 additions & 0 deletions Tests/mocks/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#if not stated otherwise in this file or this component's LICENSE file the
# following copyright and licenses apply:
#
# Copyright 2023 Synamedia
#
# 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)
set(MODULE_NAME TestMocklib)

include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/e39786088138f2749d64e9e90e0f9902daa77c40.zip
)
FetchContent_MakeAvailable(googletest)


add_library(${MODULE_NAME} SHARED
Rfc.cpp
Iarm.cpp
Wraps.cpp
RBus.cpp
Telemetry.cpp
devicesettings.cpp
Udev.cpp
)
target_link_libraries(${MODULE_NAME} PRIVATE gmock_main)

set_target_properties(${MODULE_NAME} PROPERTIES
CXX_STANDARD 11
CXX_STANDARD_REQUIRED YES)


install(TARGETS ${MODULE_NAME}
DESTINATION lib)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 7f2279d

Please sign in to comment.