Skip to content

Commit d86f5d3

Browse files
authored
[RDKEMW-2711] RDKEMW-3851: L1 - Move plugins Unit test to inputoutput repo (#92)
* L1 Test migration * Modifying L1-tests.yml * Adding HdmiInput in L1Tests/CMakeLists.txt * L1Tests/CMakeLists.txt * Update L1-tests.yml * Modifying L1Tests/CMakeLists.txt * Adding test_UtilsFile.cpp * Adding dependencies * Adding readme in tests folder * RDKEMW-3851: L1 - Move plugins Unit test to inputoutput repo * Modifying L1Tests/CMakeLists.txt * Rebasing test files * Rebasing test file from develop * Update L1-tests.yml * Update L1-tests.yml
1 parent d65169b commit d86f5d3

15 files changed

+4791
-0
lines changed

.github/workflows/L1-tests.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

CMakeLists.txt

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

39+
if(RDK_SERVICES_L1_TEST)
40+
add_subdirectory(Tests/L1Tests)
41+
endif()
42+
3943
if(PLUGIN_AVINPUT)
4044
add_subdirectory(AVInput)
4145
endif()

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+
...

Tests/L1Tests/.lcovrc_l1

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
#
2+
# /etc/lcovrc - system-wide defaults for LCOV
3+
#
4+
# To change settings for a single user, place a customized copy of this file
5+
# at location ~/.lcovrc
6+
#
7+
8+
# Specify an external style sheet file (same as --css-file option of genhtml)
9+
#genhtml_css_file = gcov.css
10+
11+
# Specify coverage rate limits (in %) for classifying file entries
12+
# HI: hi_limit <= rate <= 100 graph color: green
13+
# MED: med_limit <= rate < hi_limit graph color: orange
14+
# LO: 0 <= rate < med_limit graph color: red
15+
genhtml_hi_limit = 75
16+
genhtml_med_limit = 50
17+
18+
# Width of line coverage field in source code view
19+
genhtml_line_field_width = 12
20+
21+
# Width of branch coverage field in source code view
22+
genhtml_branch_field_width = 16
23+
24+
# Width of overview image (used by --frames option of genhtml)
25+
genhtml_overview_width = 80
26+
27+
# Resolution of overview navigation: this number specifies the maximum
28+
# difference in lines between the position a user selected from the overview
29+
# and the position the source code window is scrolled to (used by --frames
30+
# option of genhtml)
31+
genhtml_nav_resolution = 4
32+
33+
# Clicking a line in the overview image should show the source code view at
34+
# a position a bit further up so that the requested line is not the first
35+
# line in the window. This number specifies that offset in lines (used by
36+
# --frames option of genhtml)
37+
genhtml_nav_offset = 10
38+
39+
# Do not remove unused test descriptions if non-zero (same as
40+
# --keep-descriptions option of genhtml)
41+
genhtml_keep_descriptions = 0
42+
43+
# Do not remove prefix from directory names if non-zero (same as --no-prefix
44+
# option of genhtml)
45+
genhtml_no_prefix = 0
46+
47+
# Do not create source code view if non-zero (same as --no-source option of
48+
# genhtml)
49+
genhtml_no_source = 0
50+
51+
# Replace tabs with number of spaces in source view (same as --num-spaces
52+
# option of genhtml)
53+
genhtml_num_spaces = 8
54+
55+
# Highlight lines with converted-only data if non-zero (same as --highlight
56+
# option of genhtml)
57+
genhtml_highlight = 0
58+
59+
# Include color legend in HTML output if non-zero (same as --legend option of
60+
# genhtml)
61+
genhtml_legend = 0
62+
63+
# Use FILE as HTML prolog for generated pages (same as --html-prolog option of
64+
# genhtml)
65+
#genhtml_html_prolog = FILE
66+
67+
# Use FILE as HTML epilog for generated pages (same as --html-epilog option of
68+
# genhtml)
69+
#genhtml_html_epilog = FILE
70+
71+
# Use custom filename extension for pages (same as --html-extension option of
72+
# genhtml)
73+
#genhtml_html_extension = html
74+
75+
# Compress all generated html files with gzip.
76+
#genhtml_html_gzip = 1
77+
78+
# Include sorted overview pages (can be disabled by the --no-sort option of
79+
# genhtml)
80+
genhtml_sort = 1
81+
82+
# Include function coverage data display (can be disabled by the
83+
# --no-func-coverage option of genhtml)
84+
#genhtml_function_coverage = 1
85+
86+
# Include branch coverage data display (can be disabled by the
87+
# --no-branch-coverage option of genhtml)
88+
#genhtml_branch_coverage = 1
89+
90+
# Specify the character set of all generated HTML pages
91+
genhtml_charset=UTF-8
92+
93+
# Allow HTML markup in test case description text if non-zero
94+
genhtml_desc_html=0
95+
96+
# Specify the precision for coverage rates
97+
#genhtml_precision=1
98+
99+
# Show missed counts instead of hit counts
100+
#genhtml_missed=1
101+
102+
# Demangle C++ symbols
103+
#genhtml_demangle_cpp=1
104+
105+
# Name of the tool used for demangling C++ function names
106+
#genhtml_demangle_cpp_tool = c++filt
107+
108+
# Specify extra parameters to be passed to the demangling tool
109+
#genhtml_demangle_cpp_params = ""
110+
111+
# Location of the gcov tool (same as --gcov-info option of geninfo)
112+
#geninfo_gcov_tool = gcov
113+
114+
# Adjust test names to include operating system information if non-zero
115+
#geninfo_adjust_testname = 0
116+
117+
# Calculate checksum for each source code line if non-zero (same as --checksum
118+
# option of geninfo if non-zero, same as --no-checksum if zero)
119+
#geninfo_checksum = 1
120+
121+
# Specify whether to capture coverage data for external source files (can
122+
# be overridden by the --external and --no-external options of geninfo/lcov)
123+
#geninfo_external = 1
124+
125+
# Enable libtool compatibility mode if non-zero (same as --compat-libtool option
126+
# of geninfo if non-zero, same as --no-compat-libtool if zero)
127+
#geninfo_compat_libtool = 0
128+
129+
# Use gcov's --all-blocks option if non-zero
130+
#geninfo_gcov_all_blocks = 1
131+
132+
# Specify compatiblity modes (same as --compat option of geninfo).
133+
#geninfo_compat = libtool=on, hammer=auto, split_crc=auto
134+
135+
# Adjust path to source files by removing or changing path components that
136+
# match the specified pattern (Perl regular expression format)
137+
#geninfo_adjust_src_path = /tmp/build => /usr/src
138+
139+
# Specify if geninfo should try to automatically determine the base-directory
140+
# when collecting coverage data.
141+
geninfo_auto_base = 1
142+
143+
# Use gcov intermediate format? Valid values are 0, 1, auto
144+
geninfo_intermediate = auto
145+
146+
# Specify if exception branches should be excluded from branch coverage.
147+
geninfo_no_exception_branch = 0
148+
149+
# Directory containing gcov kernel files
150+
# lcov_gcov_dir = /proc/gcov
151+
152+
# Location of the insmod tool
153+
lcov_insmod_tool = /sbin/insmod
154+
155+
# Location of the modprobe tool
156+
lcov_modprobe_tool = /sbin/modprobe
157+
158+
# Location of the rmmod tool
159+
lcov_rmmod_tool = /sbin/rmmod
160+
161+
# Location for temporary directories
162+
lcov_tmp_dir = /tmp
163+
164+
# Show full paths during list operation if non-zero (same as --list-full-path
165+
# option of lcov)
166+
lcov_list_full_path = 0
167+
168+
# Specify the maximum width for list output. This value is ignored when
169+
# lcov_list_full_path is non-zero.
170+
lcov_list_width = 80
171+
172+
# Specify the maximum percentage of file names which may be truncated when
173+
# choosing a directory prefix in list output. This value is ignored when
174+
# lcov_list_full_path is non-zero.
175+
lcov_list_truncate_max = 20
176+
177+
# Specify if function coverage data should be collected and processed.
178+
lcov_function_coverage = 1
179+
180+
# Specify if branch coverage data should be collected and processed.
181+
lcov_branch_coverage = 0

0 commit comments

Comments
 (0)