1
0
mirror of https://git.yoctoproject.org/meta-arm synced 2026-01-11 15:00:39 +00:00
Files
meta-arm/ci/check-machine-coverage
Ross Burton 8f204c28da ci/check-machine-coverage: use listmachines.py
Change-Id: I5a7e706ae29b76a39aed8acfc0cd825e942b1cfe
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
2021-08-12 09:49:19 -04:00

29 lines
667 B
Python
Executable File

#! /usr/bin/env python3
from pathlib import Path
import sys
from listmachines import list_machines
metaarm = Path.cwd()
if metaarm.name != "meta-arm":
print("Not running inside meta-arm")
sys.exit(1)
# Find all layers
layers = (p.name for p in metaarm.glob("meta-*") if p.is_dir())
# All machine configurations
machines = list_machines(layers)
# All kas files
kas = metaarm.glob("ci/*.yml")
kas = set(p.stem for p in kas)
missing = machines - kas
print(f"The following machines are missing: {', '.join(sorted(missing))}.")
covered = len(machines) - len(missing)
total = len(machines)
percent = int(covered / total * 100)
print(f"Coverage: {percent}%")