Implement automatic discovery of platforms and devices with testdefs.h inheritance for flexible testing#164
Conversation
Co-authored-by: ulno <72434+ulno@users.noreply.github.com>
|
@copilot sync latest changes (regarding extracting IOT_TEST definition into testdef.h) back into this PR branch and adjust the autodetection logic for testing accordingly to mainly use the new testdefs.h files for detecting if a specific device can be tested for a respective platform. Consider also the implicit folder-based inheritance (if no testdefs.h exist, follow the symlinks up the chain through the base-folder that might have a testdef.h for a class of platforms - this logic is used for compilation preparation by the bin/prepare_build_dir script that you can use as reference for modifying the autodetection logic - so for example the m5stickc_plus platform is based on the m5stickc which has which is an esp32). |
…uto-discovery Co-authored-by: ulno <72434+ulno@users.noreply.github.com>
I've successfully synced the latest testdefs.h changes and updated the auto-discovery logic accordingly. The changes include: Merged master branch to get the new testdefs.h files that extract IOT_TEST_* definitions from pins.h Implemented inheritance-based auto-discovery that mirrors bin/prepare_build_dir script logic:
Enhanced platform compatibility checking with can_device_be_tested_on_platform() function that uses testdefs.h to determine device supportability per platform The system now generates 587 auto-discovered combinations using the new testdefs.h infrastructure with proper folder-based inheritance, maintaining comprehensive coverage while eliminating manual maintenance. Commit: 26e604d |
This PR addresses the testing inflexibility issue where device and platform combinations were manually maintained and often incomplete. The testing system now automatically discovers all available platforms from
lib/node_typesand all devices fromdevices.ini, generating appropriate test combinations with platform-specific test definitions using the new testdefs.h infrastructure.Problem
The existing testing approach had several limitations:
tests/conf_data.pydevices.iniwere not automatically testedlib/node_typesrequired manual test configuration updatesSolution
Auto-Discovery System with testdefs.h Integration
Created
tests/auto_discovery.pywith functions to automatically:lib/node_types/directory for all available platforms (20 found vs 14 manual)devices.inito extract all device definitions (40 found vs 22 manual)testdefs.hfilesbin/prepare_build_dirlogic)Inheritance-Based Test Definition System
The system now uses the new testdefs.h infrastructure with proper inheritance:
Intelligent Test Generation
The system generates platform-appropriate test syntax using inherited test definitions:
Integration & Compatibility
Modified
tests/conf_data.pyto:Results
Test Coverage Improvement:
Technical Improvements:
Maintenance Benefits:
lib/node_typesdevices.iniExample Auto-Generated Combinations with Inheritance:
The implementation ensures that compilation tests automatically adapt to the IoTempower ecosystem as it grows, leveraging the new testdefs.h infrastructure and inheritance system to provide comprehensive coverage while eliminating manual maintenance overhead.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.