|
43 | 43 |
|
44 | 44 | print("### Validation Tests") |
45 | 45 |
|
| 46 | +# Read platform-specific target lists from environment variables |
| 47 | +platform_targets = {} |
| 48 | +try: |
| 49 | + hw_targets = json.loads(os.environ.get("HW_TARGETS", "[]")) |
| 50 | + wokwi_targets = json.loads(os.environ.get("WOKWI_TARGETS", "[]")) |
| 51 | + qemu_targets = json.loads(os.environ.get("QEMU_TARGETS", "[]")) |
| 52 | + |
| 53 | + platform_targets["hw"] = sorted(hw_targets) if hw_targets else [] |
| 54 | + platform_targets["wokwi"] = sorted(wokwi_targets) if wokwi_targets else [] |
| 55 | + platform_targets["qemu"] = sorted(qemu_targets) if qemu_targets else [] |
| 56 | +except (json.JSONDecodeError, KeyError) as e: |
| 57 | + print(f"Warning: Could not parse platform targets from environment: {e}", file=sys.stderr) |
| 58 | + platform_targets = {"hw": [], "wokwi": [], "qemu": []} |
| 59 | + |
46 | 60 | proc_test_data = {} |
47 | | -target_list = [] |
48 | 61 |
|
49 | 62 | # Build executed tests map and collect targets |
50 | 63 | executed_tests_index = {} # {(platform, target, test_name): {tests, failures, errors}} |
|
64 | 77 | m = re.match(r"(.+?)(\d+)?$", rest) |
65 | 78 | test_name = m.group(1) if m else rest |
66 | 79 |
|
67 | | - if target not in target_list: |
68 | | - target_list.append(target) |
69 | | - |
70 | 80 | if platform not in proc_test_data: |
71 | 81 | proc_test_data[platform] = {} |
72 | 82 |
|
|
87 | 97 | executed_tests_index[(platform, target, test_name)] = proc_test_data[platform][test_name][target] |
88 | 98 | executed_run_counts[(platform, target, test_name)] = executed_run_counts.get((platform, target, test_name), 0) + 1 |
89 | 99 |
|
90 | | -target_list = sorted(target_list) |
91 | | - |
92 | 100 | # Render only executed tests grouped by platform/target/test |
93 | 101 | for platform in proc_test_data: |
94 | 102 | print("") |
95 | 103 | print(f"#### {platform.capitalize()}") |
96 | 104 | print("") |
| 105 | + |
| 106 | + # Get platform-specific target list |
| 107 | + target_list = platform_targets.get(platform, []) |
| 108 | + |
| 109 | + if not target_list: |
| 110 | + print(f"No targets configured for platform: {platform}") |
| 111 | + continue |
| 112 | + |
97 | 113 | print("Test", end="") |
98 | 114 |
|
99 | 115 | for target in target_list: |
100 | 116 | # Make target name uppercase and add hyfen if not esp32 |
| 117 | + display_target = target |
101 | 118 | if target != "esp32": |
102 | | - target = target.replace("esp32", "esp32-") |
| 119 | + display_target = target.replace("esp32", "esp32-") |
103 | 120 |
|
104 | | - print(f"|{target.upper()}", end="") |
| 121 | + print(f"|{display_target.upper()}", end="") |
105 | 122 |
|
106 | 123 | print("") |
107 | 124 | print("-" + "|:-:" * len(target_list)) |
|
0 commit comments