Skip to content
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

PR: gh #78 : Adding tests in ut-core to support multiple inputs #158

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"cwd": "${workspaceFolder}/tests/build/bin/",
"program": "${workspaceFolder}/tests/build/bin/ut-test",
"environment": [ {"name": "LD_LIBRARY_PATH", "value":"${workspaceFolder}/tests/build/bin/"} ],
"args": [ "-l", "${workspaceFolder}/tests/logs/", "-p", "${workspaceFolder}/tests/build/bin/assets/test_kvp.yaml"],
"args": [ "-l", "${workspaceFolder}/tests/logs/", "-p", "${workspaceFolder}/tests/build/bin/assets/test_kvp.yaml", "-p", "${workspaceFolder}/tests/build/bin/assets/config-test.yaml"],
"MIMode": "gdb",
"miDebuggerPath": "gdb",
"setupCommands": [
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ popd > /dev/null # ${MY_DIR}
# Therefore in that case it warns you but doesnt' chnage to that version, which could cause your tests to break.
# Change this to upgrade your ut-control Major versions. Non ABI Changes 1.x.x are supported, between major revisions

UT_CONTROL_PROJECT_VERSION="1.6.1" # Fixed version
UT_CONTROL_PROJECT_VERSION="1.6.2" # Fixed version

# Clone the Unit Test Requirements
[email protected]:rdkcentral/ut-control.git
Expand Down
2 changes: 1 addition & 1 deletion tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ framework:
make -C ../ framework TARGET=$(TARGET) VARIANT=${VARIANT}
@${ECHOE} ${GREEN}Copy Assets to [${BIN_DIR}/assets] ${NC}
@mkdir -p ${BIN_DIR}/assets
@cp ${ROOT_DIR}/src/assets/* ${BIN_DIR}/assets
@cp -r ${ROOT_DIR}/src/assets/* ${BIN_DIR}/assets
@cp ${ROOT_DIR}/src/*.sh ${BIN_DIR}/.
@${ECHOE} ${GREEN}Build Complete${NC}

Expand Down
59 changes: 59 additions & 0 deletions tests/src/assets/config-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
profile: DUMMY_PROFILE # Dummy string value
hal version: X.X.X # Dummy string value
components: # Array of dummy components
- name: ComponentManager1 # Dummy component object begins
interfaceVersion: X # Dummy integer value
ResourceList1: # Dummy resource list
- id: 0 # Dummy resource object begins
dummyCapabilities: # Array of dummy capabilities
- DUMMY_CAPABILITY_1
- DUMMY_CAPABILITY_2
- DUMMY_CAPABILITY_3
- DUMMY_CAPABILITY_4
supportsFeatureX: true
- id: 1
dummyCapabilities:
- DUMMY_CAPABILITY_1
- DUMMY_CAPABILITY_2
- DUMMY_CAPABILITY_3
- DUMMY_CAPABILITY_4
supportsFeatureX: true
- name: ComponentManager2 # Another dummy component
interfaceVersion: X
platformCapabilities:
- supportsFeatureY: false
sampleRateHz: 00000
pcmFormat: DUMMY_FORMAT
supportsAdditionalFormat: false
ResourceList2:
- id: 0
- id: 1
- name: ComponentManager3
interfaceVersion: X
supportedModes:
- DUMMY_MODE
ResourceList3:
- id: 0
dummyCapabilities:
- capability: DUMMY_CODEC_1
maxFrameRate: XX
maxFrameWidth: XXXX
maxFrameHeight: XXXX
- capability: DUMMY_CODEC_2
maxFrameRate: XX
maxFrameWidth: XXXX
maxFrameHeight: XXXX
supportedRanges:
- RANGE_1
- RANGE_2
- RANGE_3
supportsFeatureZ: true
- id: 1
dummyCapabilities:
- capability: DUMMY_CODEC_1
maxFrameRate: XX
maxFrameWidth: XXXX
maxFrameHeight: XXXX
supportedRanges:
- RANGE_1
supportsFeatureZ: true
4 changes: 4 additions & 0 deletions tests/src/assets/include/2d.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
"2":
value: true
include: assets/include/3d.yaml
3 changes: 3 additions & 0 deletions tests/src/assets/include/2s.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
"2":
value: true
4 changes: 4 additions & 0 deletions tests/src/assets/include/3d.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
"3":
value: true
include: assets/include/4d.yaml
3 changes: 3 additions & 0 deletions tests/src/assets/include/3s.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
"3":
value: true
4 changes: 4 additions & 0 deletions tests/src/assets/include/4d.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
"4":
value: true
include: assets/include/5d.yaml
3 changes: 3 additions & 0 deletions tests/src/assets/include/4s.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
"4":
value: true
3 changes: 3 additions & 0 deletions tests/src/assets/include/5d.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
"5":
value: true
4 changes: 4 additions & 0 deletions tests/src/assets/include/depth_check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
"1":
value: true
include: assets/include/2d.yaml
6 changes: 6 additions & 0 deletions tests/src/assets/include/single-include-file.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"1":
value: true
include_0: assets/include/2s.yaml
include_1: assets/include/3s.yaml
include_2: assets/include/4s.yaml
6 changes: 6 additions & 0 deletions tests/src/assets/include/single-include-url.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"1":
value: true
include_0: https://raw.githubusercontent.com/rdkcentral/ut-control/main/tests/src/assets/include/2s.yaml
include_1: https://raw.githubusercontent.com/rdkcentral/ut-control/main/tests/src/assets/include/3s.yaml
include_2: https://raw.githubusercontent.com/rdkcentral/ut-control/main/tests/src/assets/include/4s.yaml
18 changes: 16 additions & 2 deletions tests/src/c_source/ut_test_kvp_profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,22 @@ void test_ut_kvp_profile_open( void )
{
UT_LOG_STEP( "test_ut_kvp_profile_open - start" );
ut_kvp_profile_open( KVP_VALID_TEST_ASSERT_YAML_FILE );
ut_kvp_profile_open( KVP_VALID_TEST_ASSERT_YAML_FILE );
ut_kvp_profile_open( KVP_VALID_TEST_ASSERT_YAML_FILE );
UT_LOG_STEP( "ut_kvp_profile_open - %s", KVP_VALID_TEST_ASSERT_YAML_FILE);

ut_kvp_instance_t *pInstance;

pInstance = ut_kvp_profile_getInstance();
char* kvpdata = ut_kvp_getData(pInstance);

if(kvpdata != NULL)
{
// Print the emitted KVP string
printf("%s\n", kvpdata);
kanjoe24 marked this conversation as resolved.
Show resolved Hide resolved

// Free the emitted KVP string
free(kvpdata);
}

UT_LOG_STEP( "test_ut_kvp_profile_open - end" );
}

Expand Down