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

Function _run_simd_tests

ci/autoresearch/phases.py:1345–1425  ·  view source on GitHub ↗

Run SIMD test suite via RPC.

(ctx: RunContext)

Source from the content-addressed store, hash-verified

1343
1344
1345async def _run_simd_tests(ctx: RunContext) -> int:
1346 """Run SIMD test suite via RPC."""
1347 upload_port = ctx.upload_port
1348 assert upload_port is not None
1349 serial_iface = ctx.serial_iface
1350
1351 print()
1352 print("=" * 60)
1353 print("SIMD TEST MODE - Comprehensive Test Suite")
1354 print("=" * 60)
1355 print()
1356
1357 client: RpcClient | None = None
1358 try:
1359 print(" Connecting to device...", end="", flush=True)
1360 client = RpcClient(upload_port, timeout=30.0, serial_interface=serial_iface)
1361 await client.connect(boot_wait=1.0)
1362 print(f" {Fore.GREEN}ok{Style.RESET_ALL}")
1363
1364 print(" Sending testSimd RPC...", end="", flush=True)
1365 response = await client.send_and_match(
1366 "testSimd", match_key="passed", retries=3
1367 )
1368 print(f" {Fore.GREEN}ok{Style.RESET_ALL}")
1369 print()
1370
1371 total = response.get("totalTests", 0)
1372 passed_count = response.get("passedTests", 0)
1373 failed_count = response.get("failedTests", 0)
1374 failures = response.get("failures", [])
1375
1376 print(f" Results: {passed_count}/{total} passed", end="")
1377 if failed_count > 0:
1378 print(f", {failed_count} FAILED")
1379 else:
1380 print()
1381
1382 if failures:
1383 print()
1384 print(f" {Fore.RED}Failed tests:{Style.RESET_ALL}")
1385 for name in failures:
1386 print(f" - {name}")
1387
1388 print()
1389 simd_passed = response.get("passed", False)
1390
1391 print(" Sending testSimdBenchmark RPC...", end="", flush=True)
1392 bench = await client.send_and_match(
1393 "testSimdBenchmark", match_key="success", retries=2
1394 )
1395 print(f" {Fore.GREEN}ok{Style.RESET_ALL}")
1396 print()
1397
1398 print(json.dumps(bench.data, indent=2))
1399 print()
1400
1401 if simd_passed:
1402 print(f"{Fore.GREEN}SIMD TEST PASSED ({total} tests){Style.RESET_ALL}")

Callers 1

Calls 7

connectMethod · 0.95
send_and_matchMethod · 0.95
closeMethod · 0.95
RpcClientClass · 0.90
printFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected