aboutsummaryrefslogtreecommitdiffstats
path: root/ci/check-machine-coverage
blob: 19f9571a889e5cf3b1659bb1248650a9c7d9e471 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#! /usr/bin/env python3

from pathlib import Path
import sys

metazephyr = Path.cwd()

if metazephyr.name != "meta-zephyr":
    print("Not running inside meta-zephyr")
    sys.exit(1)

# All machine configurations
machines = metazephyr.glob("meta-zephyr-bsp/conf/machine/*.conf")
machines = set(p.stem for p in machines)

# All kas files
kas = metazephyr.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}%")