diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2021-05-17 10:42:57 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2021-09-24 18:48:48 -0700 |
commit | 30202a24021587b7d7ddffd8312eb5b425b3e273 (patch) | |
tree | 8b03d4b62f0b35a520f8f5ef859df7156cd62395 /unittests/baseplatformtests.py | |
parent | f0a7b6e7c6bf97b22f3e5f1d600717ac7ba4162f (diff) | |
download | meson-30202a24021587b7d7ddffd8312eb5b425b3e273.zip meson-30202a24021587b7d7ddffd8312eb5b425b3e273.tar.gz meson-30202a24021587b7d7ddffd8312eb5b425b3e273.tar.bz2 |
compilers/rust: Add support for clippy
Clippy is a compiler wrapper for rust that provides an extra layer of
linting. It's quite popular, but unfortunately doesn't provide the
output of the compiler that it's wrapping in it's output, so we don't
detect that clippy is rustc. This small patch adds a new compiler class
(that is the Rustc class with a different id) and the necessary logic to
detect that clippy is in fact rustc)
Fixes: #8767
Diffstat (limited to 'unittests/baseplatformtests.py')
-rw-r--r-- | unittests/baseplatformtests.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/unittests/baseplatformtests.py b/unittests/baseplatformtests.py index 3492785..9371395 100644 --- a/unittests/baseplatformtests.py +++ b/unittests/baseplatformtests.py @@ -69,6 +69,7 @@ class BasePlatformTests(TestCase): self.uninstall_command = get_backend_commands(self.backend) # Test directories self.common_test_dir = os.path.join(src_root, 'test cases/common') + self.rust_test_dir = os.path.join(src_root, 'test cases/rust') self.vala_test_dir = os.path.join(src_root, 'test cases/vala') self.framework_test_dir = os.path.join(src_root, 'test cases/frameworks') self.unit_test_dir = os.path.join(src_root, 'test cases/unit') @@ -135,7 +136,7 @@ class BasePlatformTests(TestCase): os.environ.update(self.orig_env) super().tearDown() - def _run(self, command, *, workdir=None, override_envvars=None): + def _run(self, command, *, workdir=None, override_envvars: T.Optional[T.Mapping[str, str]] = None): ''' Run a command while printing the stdout and stderr to stdout, and also return a copy of it @@ -164,7 +165,7 @@ class BasePlatformTests(TestCase): extra_args=None, default_args=True, inprocess=False, - override_envvars=None, + override_envvars: T.Optional[T.Mapping[str, str]] = None, workdir=None, allow_fail: bool = False) -> str: """Call `meson setup` |