summaryrefslogtreecommitdiff
path: root/src/bin/exactness
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2020-03-27 11:25:22 +0100
committerStefan Schmidt <s.schmidt@samsung.com>2020-03-31 14:56:25 +0200
commit506b354842625ab0f29b12bb2791e6f587b2369a (patch)
tree77573013574d2ed9b6e4e4bbdadfad7ff3566b93 /src/bin/exactness
parent7891e8582bc9bfffa77e21e595306629a1c65d30 (diff)
exactness_record: introduce runner script
this is just a little python script, so you can lunch exactness_record without the need of handdefining LD_PRELOAD Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org> Differential Revision: https://phab.enlightenment.org/D11611
Diffstat (limited to 'src/bin/exactness')
-rw-r--r--src/bin/exactness/exactness_record.in61
-rw-r--r--src/bin/exactness/meson.build12
2 files changed, 72 insertions, 1 deletions
diff --git a/src/bin/exactness/exactness_record.in b/src/bin/exactness/exactness_record.in
new file mode 100644
index 0000000000..9c6d4cf4fd
--- /dev/null
+++ b/src/bin/exactness/exactness_record.in
@@ -0,0 +1,61 @@
1#!/usr/bin/env python3
2
3import argparse
4import subprocess
5import os
6
7parser = argparse.ArgumentParser(description='A scenario recorder for EFL based applications.'
8 '\tF1 - Request stabilization\n'
9 '\tF2 - Request shot\n'
10 '\tF3 - Request to save the scenario\n')
11parser.add_argument('app', metavar='app', help='The app to run. You can also pass environment variables here.', type=str, nargs='*')
12parser.add_argument('-t', '--tests', metavar='tests', help='Name of the filename where to store the test.', type=str)
13parser.add_argument('-f', '--fontsdir', metavar='fontsdir', help='Specify a directory of the fonts that should be used.', type=str)
14parser.add_argument('-L', '--license', help='the path where to find the meson build directory', action='store_true')
15parser.add_argument('-C', '--copyright', help='the path where to find the meson build directory', action='store_true')
16parser.add_argument('-V', '--version', help='the path where to find the meson build directory', action='store_true')
17
18G = parser.parse_args()
19
20if G.license:
21 print("BSD.")
22 exit(0)
23
24if G.copyright:
25 print("(C) 2017 Enlightenment.")
26 exit(0)
27
28if G.version:
29 print(@VERSION@)
30 exit(0)
31
32spawn_env = os.environ.copy()
33spawn_env["LD_PRELOAD"] = @EXACTNESS_RECORD_PRELOAD_PATH@
34
35if G.tests != None:
36 spawn_env["EXACTNESS_DEST"] = G.tests
37else:
38 print("Tests dir must be passed!")
39 exit(-1)
40
41if G.fontsdir != None:
42 spawn_env["EXACTNESS_FONTS_DIR"] = G.fontsdir
43
44passed_all_the_env_vars = False
45app = []
46
47for argument in G.app:
48 if '=' not in argument:
49 passed_all_the_env_vars = True
50 else:
51 if passed_all_the_env_vars:
52 print("Error, env vars can only be specified at the beginning of the app call line")
53 exit(-1)
54 split_env_var = argument.split('=')
55 spawn_env[split_env_var[0]] = split_env_var[1]
56
57 if passed_all_the_env_vars:
58 app.append(argument)
59
60recorder = subprocess.Popen(app, env=spawn_env)
61recorder.wait()
diff --git a/src/bin/exactness/meson.build b/src/bin/exactness/meson.build
index 405cb240de..79b6cdbd2b 100644
--- a/src/bin/exactness/meson.build
+++ b/src/bin/exactness/meson.build
@@ -42,5 +42,15 @@ exactness_record_bin = library('exactness_record',
42 dependencies: [ elementary ], 42 dependencies: [ elementary ],
43 c_args: '-DDATA_DIR="'+join_paths(dir_data, 'exactness')+'"', 43 c_args: '-DDATA_DIR="'+join_paths(dir_data, 'exactness')+'"',
44 install: true, 44 install: true,
45 ) 45)
46
47exactness_env = configuration_data()
48exactness_env.set_quoted('EXACTNESS_RECORD_PRELOAD_PATH', exactness_record_bin.full_path())
49exactness_env.set_quoted('VERSION', meson.project_version())
46 50
51configure_file(
52 input: 'exactness_record.in',
53 output: 'exactness_record',
54 configuration: exactness_env,
55 install_dir: get_option('bindir'),
56 install_mode: 'rwxr-xr-x')