summaryrefslogtreecommitdiffstats
path: root/test cases/rust/16 internal c dependencies/test.py
blob: dacec120bbbab5b795d87638ee4230542978de7f (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
#!/usr/bin/env python3

import argparse
import subprocess
import sys


def main() -> None:
    parser = argparse.ArgumentParser()
    parser.add_argument('command')
    parser.add_argument('expected')
    args = parser.parse_args()

    out = subprocess.run(args.command, stdout=subprocess.PIPE)
    actual = out.stdout.decode().strip()

    if args.expected != actual:
        print('expected:', args.expected, file=sys.stderr)
        print('actual:  ', actual, file=sys.stderr)
        sys.exit(1)
    sys.exit(0)


if __name__ == "__main__":
    main()