diff options
-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): | |||
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: | ||
130 | def 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 | ||
123 | parser = argparse.ArgumentParser(description='Run the examples of efl') | 137 | parser = argparse.ArgumentParser(description='Run the examples of efl') |
124 | parser.add_argument('builddir', metavar='build', help='the path where to find the meson build directory') | 138 | parser.add_argument('builddir', metavar='build', help='the path where to find the meson build directory') |
125 | 139 | ||
140 | |||
126 | G = parser.parse_args() | 141 | G = parser.parse_args() |
127 | #Run meson to fetch all examples | 142 | #Run meson to fetch all examples |
128 | meson_introspect = subprocess.Popen(["meson", "introspect", G.builddir, "--targets"], | 143 | meson_introspect = subprocess.Popen(["meson", "introspect", G.builddir, "--targets"], |
@@ -131,7 +146,7 @@ meson_introspect = subprocess.Popen(["meson", "introspect", G.builddir, "--targe | |||
131 | ) | 146 | ) |
132 | meson_introspect.poll() | 147 | meson_introspect.poll() |
133 | build_targets = json.loads(meson_introspect.stdout.read()) | 148 | build_targets = json.loads(meson_introspect.stdout.read()) |
134 | examples = [b["filename"] for b in build_targets if "examples" in b["filename"] and b["type"] == "executable"] | 149 | examples = [meson_fetch_filename(b["filename"]) for b in build_targets if "examples" in meson_fetch_filename(b["filename"]) and b["type"] == "executable"] |
135 | state = State(len(examples)) | 150 | state = 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 |
137 | with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor: | 152 | with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor: |