summaryrefslogtreecommitdiff
path: root/build-aux/gen-installed-test.py
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2017-08-03 13:15:04 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2017-08-03 13:19:47 +0100
commitb09e4ca69b4dca6fd9d2e98a3722d765f86c837f (patch)
tree6b8044d29eaaf43066fce365eeb6e1f37111848c /build-aux/gen-installed-test.py
parent861a6dbea289d1ed98af1f66eb8024bc04464bd9 (diff)
downloadgdk-pixbuf-b09e4ca69b4dca6fd9d2e98a3722d765f86c837f.tar.gz
Move all aux scripts to their own directory
This makes it easier to find them and reference them.
Diffstat (limited to 'build-aux/gen-installed-test.py')
-rw-r--r--build-aux/gen-installed-test.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/build-aux/gen-installed-test.py b/build-aux/gen-installed-test.py
new file mode 100644
index 000000000..745abf339
--- /dev/null
+++ b/build-aux/gen-installed-test.py
@@ -0,0 +1,21 @@
+#!/usr/bin/env python3
+
+import sys
+import os
+import argparse
+
+def write_template(filename, data):
+ with open(filename, 'w') as f:
+ f.write(data)
+
+def build_template(bindir, binname):
+ return "[Test]\nType=session\nExec={}\n".format(os.path.join(bindir, binname))
+
+argparser = argparse.ArgumentParser(description='Generate installed-test data.')
+argparser.add_argument('--testbindir', metavar='dir', help='Installed test directory')
+argparser.add_argument('--testbin', metavar='name', help='Installed test name')
+argparser.add_argument('output', help='Output file')
+
+args = argparser.parse_args()
+
+write_template(args.output, build_template(args.testbindir, args.testbin))