-
Notifications
You must be signed in to change notification settings - Fork 0
Home
ut-core is a modular unit testing framework designed to streamline and simplify the process of developing and executing tests within the RDK Central ecosystem. It provides a collection of tools, utilities, and conventions to help you build robust and reliable tests for your software components.
- Modular Design: ut-core is built with a modular architecture, allowing you to select and use the components that best suit your specific testing needs.
- Flexible Test Definition: Define test cases and configurations using human-readable formats like YAML or JSON, making it easy to create and manage your tests.
- Data-Driven Testing: Parameterize your tests with input data to cover a wide range of scenarios and edge cases.
- Rich Assertion Library: Validate your test results using a comprehensive set of built-in assertions or create your own custom assertions.
- Test Reporting: Generate detailed test reports to easily identify and diagnose issues.
- Integration with CI/CD: Seamlessly integrate ut-core into your continuous integration and continuous delivery pipelines for automated testing.
- Extensibility: Extend ut-core's functionality by developing custom modules or plugins.
Here are some of the key modules within ut-core that you can explore in more detail:
- Standards: Useful reading on coding standards used
- ut_kvp_profile: A flexible profile extension to check kvp values
- FAQ: Frequently Asked Questions
The ut-core unit testing framework incorporates features from the ut-control
module. You can find detailed information about ut-control
on its wiki page: ut-control
Control features have moved to a separate repo ut-control
- ut_kvp - [ut_kvp: A Flexible Key-Value Pair Framework]
- ut_control_plane - ut_control_plane: Overview (ut_control_plane.h)
- ut_log.h - ut-log: Overview: UT-Log
(More subpages can be added here as you document additional ut-core modules)
- Installation: Follow the installation instructions in the ut-core repository to set up the framework in your development environment.
- Explore the Modules: Familiarize yourself with the different modules available in ut-core, each catering to specific testing needs.
- Define Your Tests: Use YAML or JSON to create test case definitions, input data, and expected results.
- Execute Your Tests: Run your tests using the ut-core test runner.
- Analyze Results: Review test reports to identify any failures or issues.
To execute your tests using the ut-core
framework, the main argument features will be linked into your test. This executable provides various command-line switches to customize how your tests are run:
The unit tests are also a combined binary with ut-core, therefore it also has the switches.
./tests/bin/ut-test -h
Help
-a - Automated Mode
-b - Basic Mode
-f - <filename> - set the output filename for automated mode
-t - List all tests run to a file
-l - Set the log Path
-p - <profile_filename> - specify the profile to load YAML or JSON, also used by kvp_profile
-h - Help
- hdmiProfile.yml
hdmicec:
config:
extendedEnumsSupported: false
- Passing a profile into the testing suite
./hdmi_cec -p hdmiProfile.yml
then in the testing code you would perform
bool extendedEnumsSupported = UT_KVP_PROFILE_GET_BOOL( "hdmicec/config/extendedEnumsSupported" );
if ( extendedEnumsSupported == false )
{
/* Complete suite is disabled due to supportExtendedEnums == false */
pSuite = UT_add_suite("test extended functions ", NULL, NULL );
UT_add_test(pSuite, "test extended bool", test_bool);
UT_add_test(pSuite, "test extended string", test_string);
UT_add_test(pSuite, "test extended uint32", test_uint32);
}
Refer to the documentation for more information ut_kvp_profile: Key Value Pair Assertions for Unit Testing
We welcome contributions to ut-core! If you have ideas for new features, bug fixes, or improvements to the documentation, please open an issue or submit a pull request on our GitHub repository.
Let us know if you have any questions or feedback!