From 4ebce2c3f25d98f9ba49d9fcc343ffbe760363af Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Sun, 25 Aug 2019 04:26:41 +1000 Subject: Add test priorities to force test start order --- mesonbuild/backend/backends.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'mesonbuild/backend') diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 512eeed..c0b2666 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -86,7 +86,7 @@ class TestSerialisation: is_parallel: bool, cmd_args: typing.List[str], env: build.EnvironmentVariables, should_fail: bool, timeout: typing.Optional[int], workdir: typing.Optional[str], - extra_paths: typing.List[str], protocol: str): + extra_paths: typing.List[str], protocol: str, priority: int): self.name = name self.project_name = project self.suite = suite @@ -103,6 +103,7 @@ class TestSerialisation: self.workdir = workdir self.extra_paths = extra_paths self.protocol = protocol + self.priority = priority class OptionProxy: def __init__(self, value): @@ -728,7 +729,7 @@ class Backend: def create_test_serialisation(self, tests): arr = [] - for t in tests: + for t in sorted(tests, key=lambda tst: -1 * tst.priority): exe = t.get_exe() if isinstance(exe, dependencies.ExternalProgram): cmd = exe.get_command() @@ -770,7 +771,8 @@ class Backend: raise MesonException('Bad object in test command.') ts = TestSerialisation(t.get_name(), t.project_name, t.suite, cmd, is_cross, exe_wrapper, t.is_parallel, cmd_args, t.env, - t.should_fail, t.timeout, t.workdir, extra_paths, t.protocol) + t.should_fail, t.timeout, t.workdir, + extra_paths, t.protocol, t.priority) arr.append(ts) return arr -- cgit v1.1