blob: f329fcebac9c8bc89576ff5a4c03ea968b6935fb [file] [log] [blame]
Brad Bishopbec4ebc2022-08-03 09:55:16 -04001#! /usr/bin/env python3
2
3from pathlib import Path
4import sys
5from listmachines import list_machines
6
7metaarm = Path.cwd()
8
9if metaarm.name != "meta-arm":
10 print("Not running inside meta-arm")
11 sys.exit(1)
12
13# Find all layers
14layers = (p.name for p in metaarm.glob("meta-*") if p.is_dir())
15# All machine configurations
16machines = list_machines(layers)
17
18# All kas files
19kas = metaarm.glob("ci/*.yml")
20kas = set(p.stem for p in kas)
21
22missing = machines - kas
23print(f"The following machines are missing: {', '.join(sorted(missing))}.")
24
25covered = len(machines) - len(missing)
26total = len(machines)
27percent = int(covered / total * 100)
28print(f"Coverage: {percent}%")