MCPcopy Create free account
hub / github.com/FastLED/FastLED / build_test_matrix

Function build_test_matrix

ci/autoresearch/driver_sweep.py:82–172  ·  view source on GitHub ↗

Build the full test matrix: sizes x lanes x lane counts (1, 2, 4). Uses finer granularity LED counts (1, 10, 25, 50, 75, 100) to identify failure thresholds, especially for multi-lane configurations on memory-constrained devices. Args: driver: Driver name (e.g. "PARLIO", "R

(driver: str)

Source from the content-addressed store, hash-verified

80
81
82def build_test_matrix(driver: str) -> list[TestCase]:
83 """Build the full test matrix: sizes x lanes x lane counts (1, 2, 4).
84
85 Uses finer granularity LED counts (1, 10, 25, 50, 75, 100) to identify
86 failure thresholds, especially for multi-lane configurations on
87 memory-constrained devices.
88
89 Args:
90 driver: Driver name (e.g. "PARLIO", "RMT", "SPI", "I2S")
91 """
92 base_sizes = [1, 10, 25, 50, 75, 100]
93 cases: list[TestCase] = []
94
95 for base_size in base_sizes:
96 # 1-lane config: legacy API
97 cases.append(
98 TestCase(
99 base_led_count=base_size,
100 lane_count=1,
101 lane_sizes=[base_size],
102 use_legacy_api=True,
103 driver=driver,
104 )
105 )
106
107 # 1-lane config: channel API (skip base=1, redundant with legacy)
108 if base_size > 1:
109 cases.append(
110 TestCase(
111 base_led_count=base_size,
112 lane_count=1,
113 lane_sizes=[base_size],
114 use_legacy_api=False,
115 driver=driver,
116 )
117 )
118
119 # 2-lane config: asymmetric sizes (~25% difference)
120 lane2_size = max(1, round(base_size * 0.75))
121 if lane2_size == base_size and base_size > 1:
122 lane2_size = base_size - 1
123
124 # 2-lane channel API
125 cases.append(
126 TestCase(
127 base_led_count=base_size,
128 lane_count=2,
129 lane_sizes=[base_size, lane2_size],
130 use_legacy_api=False,
131 driver=driver,
132 )
133 )
134
135 # 2-lane legacy API
136 cases.append(
137 TestCase(
138 base_led_count=base_size,
139 lane_count=2,

Callers 1

run_sweepFunction · 0.85

Calls 4

maxFunction · 0.85
roundFunction · 0.85
TestCaseClass · 0.70
appendMethod · 0.45

Tested by

no test coverage detected