summaryrefslogtreecommitdiff
path: root/examples_checks.py
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-03-13 16:59:17 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-03-14 11:06:55 +0100
commit5e4560c7cc049a7b337e7258418d03a0d6fc4e83 (patch)
tree48678e07a815104995cd49c59ce8d80065d91a4e /examples_checks.py
parentc3f823418dc2643f352333b7feac902fe80fbdc5 (diff)
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-xexamples_checks.py19
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):
105 args = [] 105 args = []
106 if os.path.basename(example) in example_preparation: 106 if os.path.basename(example) in example_preparation:
107 args = example_preparation[os.path.basename(example)]() 107 args = example_preparation[os.path.basename(example)]()
108 run = subprocess.Popen([G.builddir + "/" + example] + args, 108
109 #meson changed behaviour from 0.49 to 0.50 so we need this:
110 if os.path.isabs(example):
111 example_dir = example
112 else:
113 example_dir = os.path.join(G.builddir, example)
114
115 run = subprocess.Popen([example_dir] + args,
109 stdout = subprocess.PIPE, 116 stdout = subprocess.PIPE,
110 stderr = subprocess.PIPE, 117 stderr = subprocess.PIPE,
111 ) 118 )
@@ -119,10 +126,18 @@ def simulate_example(example):
119 else: 126 else:
120 return (example, True if b'ERR' in outs or b'ERR' in errs else False, run.poll()) 127 return (example, True if b'ERR' in outs or b'ERR' in errs else False, run.poll())
121 128
129#meson changed behaviour from 0.49 to 0.50 so we need this:
130def meson_fetch_filename(filename_object):
131 if isinstance(filename_object, str):
132 return filename_object
133 else:
134 return filename_object[0]
135
122 136
123parser = argparse.ArgumentParser(description='Run the examples of efl') 137parser = argparse.ArgumentParser(description='Run the examples of efl')
124parser.add_argument('builddir', metavar='build', help='the path where to find the meson build directory') 138parser.add_argument('builddir', metavar='build', help='the path where to find the meson build directory')
125 139
140
126G = parser.parse_args() 141G = parser.parse_args()
127#Run meson to fetch all examples 142#Run meson to fetch all examples
128meson_introspect = subprocess.Popen(["meson", "introspect", G.builddir, "--targets"], 143meson_introspect = subprocess.Popen(["meson", "introspect", G.builddir, "--targets"],
@@ -131,7 +146,7 @@ meson_introspect = subprocess.Popen(["meson", "introspect", G.builddir, "--targe
131) 146)
132meson_introspect.poll() 147meson_introspect.poll()
133build_targets = json.loads(meson_introspect.stdout.read()) 148build_targets = json.loads(meson_introspect.stdout.read())
134examples = [b["filename"] for b in build_targets if "examples" in b["filename"] and b["type"] == "executable"] 149examples = [meson_fetch_filename(b["filename"]) for b in build_targets if "examples" in meson_fetch_filename(b["filename"]) and b["type"] == "executable"]
135state = State(len(examples)) 150state = State(len(examples))
136#simulate all examples in parallel with up to 5 runners 151#simulate all examples in parallel with up to 5 runners
137with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor: 152with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor: