aboutsummaryrefslogtreecommitdiffstats
path: root/meson/test cases/python3/4 custom target depends extmodule/blaster.py
diff options
context:
space:
mode:
Diffstat (limited to 'meson/test cases/python3/4 custom target depends extmodule/blaster.py')
-rw-r--r--meson/test cases/python3/4 custom target depends extmodule/blaster.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/meson/test cases/python3/4 custom target depends extmodule/blaster.py b/meson/test cases/python3/4 custom target depends extmodule/blaster.py
new file mode 100644
index 000000000..d2c93ad03
--- /dev/null
+++ b/meson/test cases/python3/4 custom target depends extmodule/blaster.py
@@ -0,0 +1,32 @@
+#!/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):
+ print('Returned result not an integer.')
+ sys.exit(1)
+
+if result != 1:
+ print(f'Returned result {result} is not 1.')
+ sys.exit(1)