summaryrefslogtreecommitdiff
path: root/tests/test_cases/deps/lint/expect.py
blob: d26343dcf75256dc42fcf1d8b17c0801b512e7df (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
#!/usr/bin/env python3

import json
import os
import sys

with open(sys.argv[1]) as f:
    invocations = json.load(f)

expected = set(sys.argv[2:])
found = set()

for name, cmd in invocations.items():
    print("- %s compiled as %r" % (name, cmd))
    found.add(os.path.basename(name))

if expected != found:
    print()
    print("Found: %r" % (found,))
    print("missing:%r" % (expected - found,))
    print("unexpected: %r" % (found - expected,))
    sys.exit(1)
else:
    print("OK")