summaryrefslogtreecommitdiff
path: root/tests/gen-installed-test.py
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2017-05-19 14:15:35 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2017-05-19 17:32:28 +0100
commit386939f9d576e8ac956f88fd85f87d1fba76e9ed (patch)
tree5eec82eaab7e3547741630daf9d944e627186a62 /tests/gen-installed-test.py
parent09623d50ac8afd9b246e571372972142af5daaa3 (diff)
downloadpango-386939f9d576e8ac956f88fd85f87d1fba76e9ed.tar.gz
meson: Install tests and additional data
Diffstat (limited to 'tests/gen-installed-test.py')
-rw-r--r--tests/gen-installed-test.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/gen-installed-test.py b/tests/gen-installed-test.py
new file mode 100644
index 00000000..794ea107
--- /dev/null
+++ b/tests/gen-installed-test.py
@@ -0,0 +1,23 @@
+import sys
+import argparse
+import os
+
+template = '''[Test]
+Type=session
+Exec={}
+'''
+
+def build_template(test_dir, test_name):
+ return template.format(os.path.join(test_dir, test_name))
+
+if __name__ == '__main__':
+ argparser = argparse.ArgumentParser(description='Generate installed-test description file')
+ argparser.add_argument('installed_test_dir', help='Path for installed test binaries')
+ argparser.add_argument('test_name', help='Name of the test unit')
+ argparser.add_argument('out_dir', help='Path for the output')
+
+ args = argparser.parse_args()
+
+ outfile = os.path.join(args.out_dir, args.test_name + '.test')
+ with open(outfile, 'w') as f:
+ f.write(build_template(args.installed_test_dir, args.test_name))