diff options
author | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2019-03-13 16:59:17 +0100 |
---|---|---|
committer | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2019-03-14 11:06:55 +0100 |
commit | 5e4560c7cc049a7b337e7258418d03a0d6fc4e83 (patch) | |
tree | 48678e07a815104995cd49c59ce8d80065d91a4e /examples_checks.py | |
parent | c3f823418dc2643f352333b7feac902fe80fbdc5 (diff) | |
download | efl-5e4560c7cc049a7b337e7258418d03a0d6fc4e83.tar.gz |
examples_check: fix for meson-0.50
meson changed behaviour ... the json output is slightly different, the
paths are now absolut. This fixes the behaviour and makes it work with
new and old versions.
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8327
Diffstat (limited to 'examples_checks.py')
-rwxr-xr-x | examples_checks.py | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/examples_checks.py b/examples_checks.py index fa9badc728..2a51c80819 100755 --- a/examples_checks.py +++ b/examples_checks.py @@ -105,7 +105,14 @@ def simulate_example(example): args = [] if os.path.basename(example) in example_preparation: args = example_preparation[os.path.basename(example)]() - run = subprocess.Popen([G.builddir + "/" + example] + args, + + #meson changed behaviour from 0.49 to 0.50 so we need this: + if os.path.isabs(example): + example_dir = example + else: + example_dir = os.path.join(G.builddir, example) + + run = subprocess.Popen([example_dir] + args, stdout = subprocess.PIPE, stderr = subprocess.PIPE, ) @@ -119,10 +126,18 @@ def simulate_example(example): else: return (example, True if b'ERR' in outs or b'ERR' in errs else False, run.poll()) +#meson changed behaviour from 0.49 to 0.50 so we need this: +def meson_fetch_filename(filename_object): + if isinstance(filename_object, str): + return filename_object + else: + return filename_object[0] + parser = argparse.ArgumentParser(description='Run the examples of efl') parser.add_argument('builddir', metavar='build', help='the path where to find the meson build directory') + G = parser.parse_args() #Run meson to fetch all examples meson_introspect = subprocess.Popen(["meson", "introspect", G.builddir, "--targets"], @@ -131,7 +146,7 @@ meson_introspect = subprocess.Popen(["meson", "introspect", G.builddir, "--targe ) meson_introspect.poll() build_targets = json.loads(meson_introspect.stdout.read()) -examples = [b["filename"] for b in build_targets if "examples" in b["filename"] and b["type"] == "executable"] +examples = [meson_fetch_filename(b["filename"]) for b in build_targets if "examples" in meson_fetch_filename(b["filename"]) and b["type"] == "executable"] state = State(len(examples)) #simulate all examples in parallel with up to 5 runners with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor: |