summaryrefslogtreecommitdiffstats
path: root/test cases/python/4 custom target depends extmodule/blaster.py
blob: 61b11f9229770b172c60bcf41b4c91f0204bff6f (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
27
28
29
30
#!/usr/bin/env python3

import os
import sys
import argparse

from pathlib import Path

filedir = Path(os.path.dirname(__file__)).resolve()
if list(filedir.glob('ext/*tachyon*')):
    sys.path.insert(0, (filedir / 'ext').as_posix())

import tachyon

parser = argparse.ArgumentParser()
parser.add_argument('-o', dest='output', default=None)

options = parser.parse_args(sys.argv[1:])

result = tachyon.phaserize('shoot')

if options.output:
    with open(options.output, 'w') as f:
        f.write('success')

if not isinstance(result, int):
    raise SystemExit('Returned result not an integer.')

if result != 1:
    raise SystemExit(f'Returned result {result} is not 1.')