Skip to content

Commit 1021bb3

Browse files
Merge pull request #115 from rdkcentral/develop
rebase
2 parents 4367c0c + c1a655e commit 1021bb3

20 files changed

+5132
-45
lines changed

.github/workflows/L1-tests.yml

Lines changed: 102 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: L1-tests
22

33
on:
44
push:
5-
branches: [ main, develop, 'sprint/**', 'release/**' ]
5+
branches: [ main, develop, 'sprint/**', 'release/**', 'topic/RDK*' ]
66
pull_request:
7-
branches: [ main, develop, 'sprint/**', 'release/**' ]
7+
branches: [ main, develop, 'sprint/**', 'release/**', 'topic/RDK*' ]
88

99
env:
1010
BUILD_TYPE: Debug
@@ -281,6 +281,68 @@ jobs:
281281
if: ${{ matrix.compiler == 'gcc' && matrix.coverage == 'with-coverage' && !env.ACT }}
282282
run: echo "TOOLCHAIN_FILE=$GITHUB_WORKSPACE/entservices-testframework/Tests/gcc-with-coverage.cmake" >> $GITHUB_ENV
283283

284+
- name: Build mocks
285+
run: >
286+
cmake
287+
-S "$GITHUB_WORKSPACE/entservices-testframework/Tests/mocks"
288+
-B build/mocks
289+
-DBUILD_SHARED_LIBS=ON
290+
-DRDK_SERVICES_L1_TEST=ON
291+
-DUSE_THUNDER_R4=ON
292+
-DCMAKE_TOOLCHAIN_FILE="${{ env.TOOLCHAIN_FILE }}"
293+
-DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/install/usr"
294+
-DCMAKE_MODULE_PATH="$GITHUB_WORKSPACE/install/tools/cmake"
295+
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
296+
-DCMAKE_CXX_FLAGS="
297+
-fprofile-arcs
298+
-ftest-coverage
299+
-DEXCEPTIONS_ENABLE=ON
300+
-DUSE_THUNDER_R4=ON
301+
-DTHUNDER_VERSION=4
302+
-DTHUNDER_VERSION_MAJOR=4
303+
-DTHUNDER_VERSION_MINOR=4
304+
-DRDK_SERVICES_L1_TEST
305+
-I $GITHUB_WORKSPACE/entservices-testframework/Tests/headers
306+
-I $GITHUB_WORKSPACE/entservices-testframework/Tests/headers/audiocapturemgr
307+
-I $GITHUB_WORKSPACE/entservices-testframework/Tests/headers/rdk/ds
308+
-I $GITHUB_WORKSPACE/entservices-testframework/Tests/headers/rdk/iarmbus
309+
-I $GITHUB_WORKSPACE/entservices-testframework/Tests/headers/rdk/iarmmgrs-hal
310+
-I $GITHUB_WORKSPACE/entservices-testframework/Tests/headers/ccec/drivers
311+
-I $GITHUB_WORKSPACE/entservices-testframework/Tests/headers/network
312+
-I $GITHUB_WORKSPACE/entservices-testframework/Tests
313+
-I $GITHUB_WORKSPACE/Thunder/Source
314+
-I $GITHUB_WORKSPACE/Thunder/Source/core
315+
-include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/devicesettings.h
316+
-include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/Iarm.h
317+
-include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/Rfc.h
318+
-include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/RBus.h
319+
-include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/Telemetry.h
320+
-include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/Udev.h
321+
-include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/maintenanceMGR.h
322+
-include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/pkg.h
323+
-include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/secure_wrappermock.h
324+
-include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/wpa_ctrl_mock.h
325+
-include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/readprocMockInterface.h
326+
-include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/gdialservice.h
327+
--coverage
328+
-Wall -Wno-unused-result -Wno-deprecated-declarations -Wno-error=format=
329+
-Wl,-wrap,system -Wl,-wrap,popen -Wl,-wrap,syslog -Wl,-wrap,v_secure_system -Wl,-wrap,v_secure_popen -Wl,-wrap,v_secure_pclose -Wl,-wrap,unlink -Wl,-wrap,v_secure_system -Wl,-wrap,pclose -Wl,-wrap,setmntent -Wl,-wrap,getmntent
330+
-DENABLE_TELEMETRY_LOGGING
331+
-DUSE_IARMBUS
332+
-DENABLE_SYSTEM_GET_STORE_DEMO_LINK
333+
-DENABLE_DEEP_SLEEP
334+
-DENABLE_SET_WAKEUP_SRC_CONFIG
335+
-DENABLE_THERMAL_PROTECTION
336+
-DUSE_DRM_SCREENCAPTURE
337+
-DHAS_API_SYSTEM
338+
-DHAS_API_POWERSTATE
339+
-DHAS_RBUS
340+
-DENABLE_DEVICE_MANUFACTURER_INFO"
341+
&&
342+
cmake --build build/mocks -j8
343+
&&
344+
cmake --install build/mocks
345+
284346
- name: Build entservices-inputoutput
285347
run: >
286348
cmake -G Ninja
@@ -345,7 +407,7 @@ jobs:
345407
-DDS_FOUND=ON
346408
-DHAS_FRONT_PANEL=ON
347409
-DRDK_SERVICES_L1_TEST=ON
348-
-DPLUGIN_HDCPPROFILE=OFF
410+
-DPLUGIN_HDCPPROFILE=ON
349411
-DPLUGIN_HDMICECSOURCE=ON
350412
-DPLUGIN_HDMICECSINK=ON
351413
-DUSE_THUNDER_R4=ON
@@ -419,7 +481,7 @@ jobs:
419481
-DCMAKE_DISABLE_FIND_PACKAGE_CEC=ON
420482
-DCMAKE_BUILD_TYPE=Debug
421483
-DDS_FOUND=ON
422-
-DPLUGIN_HDCPPROFILE=OFF
484+
-DPLUGIN_HDCPPROFILE=ON
423485
-DPLUGIN_HDMICECSOURCE=ON
424486
-DPLUGIN_HDMICECSINK=ON
425487
-DRDK_SERVICES_L1_TEST=ON
@@ -540,40 +602,40 @@ jobs:
540602
RdkServicesL1Test &&
541603
cp -rf $(pwd)/rdkL1TestResults.json $GITHUB_WORKSPACE/rdkL1TestResultsWithValgrind.json &&
542604
rm -rf $(pwd)/rdkL1TestResults.json
543-
544-
# - name: Generate coverage
545-
# if: ${{ matrix.coverage == 'with-coverage' && !env.ACT }}
546-
# run: >
547-
# cp $GITHUB_WORKSPACE/entservices-testframework/Tests/L1Tests/.lcovrc_l1 ~/.lcovrc
548-
# &&
549-
# lcov -c
550-
# -o coverage.info
551-
# -d build/entservices-inputoutput
552-
# &&
553-
# lcov
554-
# -r coverage.info
555-
# '/usr/include/*'
556-
# '*/build/entservices-inputoutput/_deps/*'
557-
# '*/install/usr/include/*'
558-
# '*/Tests/headers/*'
559-
# '*/Tests/mocks/*'
560-
# '*/Tests/L1Tests/tests/*'
561-
# '*/Thunder/*'
562-
# -o filtered_coverage.info
563-
# &&
564-
# genhtml
565-
# -o coverage
566-
# -t "entservices-inputoutput coverage"
567-
# filtered_coverage.info
568605
569-
# - name: Upload artifacts
570-
# if: ${{ !env.ACT }}
571-
# uses: actions/upload-artifact@v4
572-
# with:
573-
# name: artifacts
574-
# path: |
575-
# coverage/
576-
# valgrind_log
577-
# rdkL1TestResultsWithoutValgrind.json
578-
# rdkL1TestResultsWithValgrind.json
579-
# if-no-files-found: warn
606+
- name: Generate coverage
607+
if: ${{ matrix.coverage == 'with-coverage' && !env.ACT }}
608+
run: >
609+
cp $GITHUB_WORKSPACE/entservices-testframework/Tests/L1Tests/.lcovrc_l1 ~/.lcovrc
610+
&&
611+
lcov -c
612+
-o coverage.info
613+
-d build/entservices-inputoutput
614+
&&
615+
lcov
616+
-r coverage.info
617+
'/usr/include/*'
618+
'*/build/entservices-inputoutput/_deps/*'
619+
'*/install/usr/include/*'
620+
'*/Tests/headers/*'
621+
'*/Tests/mocks/*'
622+
'*/Tests/L1Tests/tests/*'
623+
'*/Thunder/*'
624+
-o filtered_coverage.info
625+
&&
626+
genhtml
627+
-o coverage
628+
-t "entservices-inputoutput coverage"
629+
filtered_coverage.info
630+
631+
- name: Upload artifacts
632+
if: ${{ !env.ACT }}
633+
uses: actions/upload-artifact@v4
634+
with:
635+
name: artifacts
636+
path: |
637+
coverage/
638+
valgrind_log
639+
rdkL1TestResultsWithoutValgrind.json
640+
rdkL1TestResultsWithValgrind.json
641+
if-no-files-found: warn

.github/workflows/L2-tests.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
name: L2-tests
22

3+
#enable the workflow incase of any plugin/testcase changes
34
on:
4-
push:
5-
branches: [ main, develop, 'sprint/**', 'release/**' ]
6-
pull_request:
7-
branches: [ main, develop, 'sprint/**', 'release/**' ]
5+
workflow_dispatch:
86

97
env:
108
BUILD_TYPE: Debug

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ string(TOLOWER ${NAMESPACE} STORAGE_DIRECTORY)
3636
# for writing pc and config files
3737
include(CmakeHelperFunctions)
3838

39+
if(RDK_SERVICE_L2_TEST)
40+
add_subdirectory(Tests/L2Tests)
41+
endif()
42+
43+
if(RDK_SERVICES_L1_TEST)
44+
add_subdirectory(Tests/L1Tests)
45+
endif()
46+
3947
if(PLUGIN_AVINPUT)
4048
add_subdirectory(AVInput)
4149
endif()

HdcpProfile/HdcpProfile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ namespace WPEFramework
8484
{
8585
message = _T("HdcpProfile could not be configured");
8686
}
87+
configure->Release();
8788
}
8889
else
8990
{
@@ -126,7 +127,6 @@ namespace WPEFramework
126127

127128
_hdcpProfile->Unregister(&_hdcpProfileNotification);
128129
Exchange::JHdcpProfile::Unregister(*this);
129-
130130
// Stop processing:
131131
RPC::IRemoteConnection *connection = service->RemoteConnection(_connectionId);
132132
VARIABLE_IS_NOT_USED uint32_t result = _hdcpProfile->Release();

HdcpProfile/HdcpProfileImplementation.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@
6161
HdcpProfileImplementation::~HdcpProfileImplementation()
6262
{
6363
LOGINFO("Call HdcpProfileImplementation destructor\n");
64+
if (_powerManagerPlugin) {
65+
_powerManagerPlugin.Reset();
66+
}
67+
if(_service != nullptr)
68+
{
69+
_service->Release();
70+
}
71+
DeinitializeIARM();
6472
HdcpProfileImplementation::_instance = nullptr;
6573
mShell = nullptr;
6674
}

Tests/.clang-format

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
---
2+
Language: Cpp
3+
# BasedOnStyle: WebKit
4+
AccessModifierOffset: -4
5+
AlignAfterOpenBracket: DontAlign
6+
AlignConsecutiveAssignments: false
7+
AlignConsecutiveDeclarations: false
8+
AlignEscapedNewlines: Right
9+
AlignOperands: false
10+
AlignTrailingComments: false
11+
AllowAllParametersOfDeclarationOnNextLine: true
12+
AllowShortBlocksOnASingleLine: false
13+
AllowShortCaseLabelsOnASingleLine: false
14+
AllowShortFunctionsOnASingleLine: All
15+
AllowShortIfStatementsOnASingleLine: false
16+
AllowShortLoopsOnASingleLine: false
17+
AlwaysBreakAfterDefinitionReturnType: None
18+
AlwaysBreakAfterReturnType: None
19+
AlwaysBreakBeforeMultilineStrings: false
20+
AlwaysBreakTemplateDeclarations: false
21+
BinPackArguments: true
22+
BinPackParameters: true
23+
BraceWrapping:
24+
AfterClass: false
25+
AfterControlStatement: false
26+
AfterEnum: false
27+
AfterFunction: true
28+
AfterNamespace: false
29+
AfterObjCDeclaration: false
30+
AfterStruct: false
31+
AfterUnion: false
32+
BeforeCatch: false
33+
BeforeElse: false
34+
IndentBraces: false
35+
SplitEmptyFunction: true
36+
SplitEmptyRecord: true
37+
SplitEmptyNamespace: true
38+
BreakBeforeBinaryOperators: All
39+
BreakBeforeBraces: WebKit
40+
BreakBeforeInheritanceComma: false
41+
BreakBeforeTernaryOperators: true
42+
BreakConstructorInitializersBeforeComma: false
43+
BreakConstructorInitializers: BeforeComma
44+
BreakAfterJavaFieldAnnotations: false
45+
BreakStringLiterals: true
46+
ColumnLimit: 0
47+
CommentPragmas: '^ IWYU pragma:'
48+
CompactNamespaces: false
49+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
50+
ConstructorInitializerIndentWidth: 4
51+
ContinuationIndentWidth: 4
52+
Cpp11BracedListStyle: false
53+
DerivePointerAlignment: false
54+
DisableFormat: false
55+
ExperimentalAutoDetectBinPacking: false
56+
FixNamespaceComments: false
57+
ForEachMacros:
58+
- foreach
59+
- Q_FOREACH
60+
- BOOST_FOREACH
61+
IncludeCategories:
62+
- Regex: '^"config\.h"'
63+
Priority: -1
64+
# The main header for a source file automatically gets category 0
65+
- Regex: '.*'
66+
Priority: 1
67+
- Regex: '^<.*\.h>'
68+
Priority: 2
69+
IncludeIsMainRegex: '(Test)?$'
70+
IndentCaseLabels: false
71+
IndentWidth: 4
72+
IndentWrappedFunctionNames: false
73+
JavaScriptQuotes: Leave
74+
JavaScriptWrapImports: true
75+
KeepEmptyLinesAtTheStartOfBlocks: true
76+
MacroBlockBegin: ''
77+
MacroBlockEnd: ''
78+
MaxEmptyLinesToKeep: 1
79+
NamespaceIndentation: Inner
80+
ObjCBlockIndentWidth: 4
81+
ObjCSpaceAfterProperty: true
82+
ObjCSpaceBeforeProtocolList: true
83+
PenaltyBreakAssignment: 2
84+
PenaltyBreakBeforeFirstCallParameter: 19
85+
PenaltyBreakComment: 300
86+
PenaltyBreakFirstLessLess: 120
87+
PenaltyBreakString: 1000
88+
PenaltyExcessCharacter: 1000000
89+
PenaltyReturnTypeOnItsOwnLine: 60
90+
PointerAlignment: Left
91+
ReflowComments: true
92+
SortIncludes: true
93+
SortUsingDeclarations: true
94+
SpaceAfterCStyleCast: false
95+
SpaceAfterTemplateKeyword: true
96+
SpaceBeforeAssignmentOperators: true
97+
SpaceBeforeParens: ControlStatements
98+
SpaceInEmptyParentheses: false
99+
SpacesBeforeTrailingComments: 1
100+
SpacesInAngles: false
101+
SpacesInContainerLiterals: true
102+
SpacesInCStyleCastParentheses: false
103+
SpacesInParentheses: false
104+
SpacesInSquareBrackets: false
105+
Standard: Cpp11
106+
TabWidth: 4
107+
UseTab: Never
108+
...

0 commit comments

Comments
 (0)