diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2019-07-10 01:01:21 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-10 01:01:21 +0300 |
commit | 15d56079ad790880c4a42183d0f31934062a409c (patch) | |
tree | 782dc5a092dccd11fa7a2b0b0e2fc4128ade1c02 /run_unittests.py | |
parent | a310ba863e4104178d509c2c920d12fd391f6a84 (diff) | |
parent | 706ebc37f87508a02c547a0fd27a59f31c7a7663 (diff) | |
download | meson-15d56079ad790880c4a42183d0f31934062a409c.zip meson-15d56079ad790880c4a42183d0f31934062a409c.tar.gz meson-15d56079ad790880c4a42183d0f31934062a409c.tar.bz2 |
Merge pull request #5621 from mesonbuild/paralleltests
Run tests in paralled with pytest when installed
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-x | run_unittests.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/run_unittests.py b/run_unittests.py index d9281cf..33174b1 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -3398,7 +3398,7 @@ recommended as it is not supported on some platforms''') for entry in res: name = entry['name'] - self.assertEquals(entry['subproject'], expected[name]) + self.assertEqual(entry['subproject'], expected[name]) def test_introspect_projectinfo_subproject_dir(self): testdir = os.path.join(self.common_test_dir, '79 custom subproject dir') @@ -6480,6 +6480,17 @@ def unset_envs(): def main(): unset_envs() + pytest_args = ['-n', 'auto', './run_unittests.py'] + if shutil.which('pytest-3'): + return subprocess.run(['pytest-3'] + pytest_args).returncode + elif shutil.which('pytest'): + return subprocess.run(['pytest'] + pytest_args).returncode + try: + import pytest # noqa: F401 + return subprocess.run(python_command + ['-m', 'pytest'] + pytest_args).returncode + except ImportError: + pass + # All attempts at locating pytest failed, fall back to plain unittest. cases = ['InternalTests', 'DataTests', 'AllPlatformTests', 'FailureTests', 'PythonTests', 'NativeFileTests', 'RewriterTests', 'CrossFileTests', 'TAPParserTests', |