diff options
author | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2020-03-27 11:25:22 +0100 |
---|---|---|
committer | Stefan Schmidt <s.schmidt@samsung.com> | 2020-03-31 14:56:25 +0200 |
commit | 506b354842625ab0f29b12bb2791e6f587b2369a (patch) | |
tree | 77573013574d2ed9b6e4e4bbdadfad7ff3566b93 /src/bin | |
parent | 7891e8582bc9bfffa77e21e595306629a1c65d30 (diff) | |
download | efl-506b354842625ab0f29b12bb2791e6f587b2369a.tar.gz |
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')
-rw-r--r-- | src/bin/exactness/exactness_record.in | 61 | ||||
-rw-r--r-- | src/bin/exactness/meson.build | 12 |
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 @@ +#!/usr/bin/env python3 + +import argparse +import subprocess +import os + +parser = argparse.ArgumentParser(description='A scenario recorder for EFL based applications.' + '\tF1 - Request stabilization\n' + '\tF2 - Request shot\n' + '\tF3 - Request to save the scenario\n') +parser.add_argument('app', metavar='app', help='The app to run. You can also pass environment variables here.', type=str, nargs='*') +parser.add_argument('-t', '--tests', metavar='tests', help='Name of the filename where to store the test.', type=str) +parser.add_argument('-f', '--fontsdir', metavar='fontsdir', help='Specify a directory of the fonts that should be used.', type=str) +parser.add_argument('-L', '--license', help='the path where to find the meson build directory', action='store_true') +parser.add_argument('-C', '--copyright', help='the path where to find the meson build directory', action='store_true') +parser.add_argument('-V', '--version', help='the path where to find the meson build directory', action='store_true') + +G = parser.parse_args() + +if G.license: + print("BSD.") + exit(0) + +if G.copyright: + print("(C) 2017 Enlightenment.") + exit(0) + +if G.version: + print(@VERSION@) + exit(0) + +spawn_env = os.environ.copy() +spawn_env["LD_PRELOAD"] = @EXACTNESS_RECORD_PRELOAD_PATH@ + +if G.tests != None: + spawn_env["EXACTNESS_DEST"] = G.tests +else: + print("Tests dir must be passed!") + exit(-1) + +if G.fontsdir != None: + spawn_env["EXACTNESS_FONTS_DIR"] = G.fontsdir + +passed_all_the_env_vars = False +app = [] + +for argument in G.app: + if '=' not in argument: + passed_all_the_env_vars = True + else: + if passed_all_the_env_vars: + print("Error, env vars can only be specified at the beginning of the app call line") + exit(-1) + split_env_var = argument.split('=') + spawn_env[split_env_var[0]] = split_env_var[1] + + if passed_all_the_env_vars: + app.append(argument) + +recorder = subprocess.Popen(app, env=spawn_env) +recorder.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', dependencies: [ elementary ], c_args: '-DDATA_DIR="'+join_paths(dir_data, 'exactness')+'"', install: true, - ) +) + +exactness_env = configuration_data() +exactness_env.set_quoted('EXACTNESS_RECORD_PRELOAD_PATH', exactness_record_bin.full_path()) +exactness_env.set_quoted('VERSION', meson.project_version()) +configure_file( + input: 'exactness_record.in', + output: 'exactness_record', + configuration: exactness_env, + install_dir: get_option('bindir'), + install_mode: 'rwxr-xr-x') |