Run FastLED tests.
(arguments: dict[str, Any], project_root: Path)
| 598 | |
| 599 | |
| 600 | async def run_tests(arguments: dict[str, Any], project_root: Path) -> CallToolResult: |
| 601 | """Run FastLED tests.""" |
| 602 | test_type = arguments.get("test_type", "all") |
| 603 | specific_test = arguments.get("specific_test") |
| 604 | test_case = arguments.get("test_case") |
| 605 | use_clang = arguments.get("use_clang", False) |
| 606 | clean = arguments.get("clean", False) |
| 607 | verbose = arguments.get("verbose", False) |
| 608 | |
| 609 | # Use bash test format as per user directive |
| 610 | if test_case and specific_test: |
| 611 | # For individual TEST_CASE, we still need to use bash test with the test name |
| 612 | # The bash test script handles the details |
| 613 | cmd = ["bash", "test", specific_test] |
| 614 | context = f"Running test: bash test {specific_test}\n" |
| 615 | if test_case: |
| 616 | context += f"Note: To run specific TEST_CASE '{test_case}', the test framework will need to support filtering\n" |
| 617 | elif specific_test and test_type == "specific": |
| 618 | # Use bash test format for specific tests |
| 619 | cmd = ["bash", "test", specific_test] |
| 620 | context = f"Running specific test: bash test {specific_test}\n" |
| 621 | else: |
| 622 | # For all tests or cpp tests, use the original format |
| 623 | cmd = ["uv", "run", "test.py"] |
| 624 | |
| 625 | if test_type == "cpp": |
| 626 | cmd.append("--cpp") |
| 627 | |
| 628 | if use_clang: |
| 629 | cmd.append("--clang") |
| 630 | |
| 631 | if clean: |
| 632 | cmd.append("--clean") |
| 633 | |
| 634 | if verbose: |
| 635 | cmd.append("--verbose") |
| 636 | |
| 637 | context = f"Command executed: {' '.join(cmd)}\n" |
| 638 | |
| 639 | result = await run_command(cmd, project_root) |
| 640 | |
| 641 | return CallToolResult(content=[TextContent(type="text", text=context + result)]) |
| 642 | |
| 643 | |
| 644 | async def list_test_cases( |