rdkcentral / ut-core

Unit Test - Core Framework
Apache License 2.0
4 stars 0 forks source link

input configuration to switch a test active / inactive #24

Closed Ulrond closed 5 months ago

Ulrond commented 8 months ago

Scope

allow enabling / disabling of individual tests based on a configuration input file into the test.

This allows for control based on configuration to disable specific tests

Related to #13 you can use this framework internals to allow the reading of a configuration, and driving the enabling / disabling of each test as required.

e.g.

hdmiProfile.yml

hdmicec:
  config:
    extendedEnumsSupported: false

then in the testing code you would perform

bool extendedEnumsSupported = ut_kvp_getBoolField( ut_getPlatformProfile(), ""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);
}

So basically:

void *ut_getPlatformProfile( void ) → Needs to be added to the ut_main.c ut-.h, whereas part of the switch processing the global is set up by loading via file during the processing of the -p switch.

Extended Data with Examples

Example of profile for HDMI

hdmi:
 config:
   extendedEnumsSupported: true
  test:
   basic_edid:
     header:
      manufacturer_id: "SAM"
      product_code: 1234
      version: 1.3

    basic_display_parameters:
      input_voltage: Digital
      max_horizontal_size: 40  # cm
      max_vertical_size: 25  # cm
      gamma: 2.20

    chromaticity_coordinates:
      red:
        x: 0.640
        y: 0.330
      green:
        x: 0.300
        y: 0.600
      blue:
        x: 0.150
        y: 0.060
      white_point:
        x: 0.313
        y: 0.329

    established_timings:
      - 720x400@70Hz
      - 800x600@60Hz

    standard_timing_identifications:
      - 1024x768@75Hz
      - 1280x1024@75Hz

    detailed_timing_descriptors:
      - pixel_clock: 65.00  # MHz
        horizontal_active: 1024
        horizontal_blanking: 248
        # ... Other horizontal parameters
        vertical_active: 768
        vertical_blanking: 38
        # ... Other vertical parameters

    extension_blocks:
      - cea_861:  # Placeholder for CEA-861 data 
Ulrond commented 5 months ago

now closed and merged to develop