summaryrefslogtreecommitdiff
path: root/unittests/allplatformstests.py
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2024-12-20 18:00:58 +0100
committerJussi Pakkanen <jpakkane@gmail.com>2025-04-02 15:43:15 +0300
commit6cc848dafdf5696430a0fa68b5717fb788e70820 (patch)
tree75edc31bb2c8837275843668facc2bfcd7ac5df9 /unittests/allplatformstests.py
parent19482e4553775d4612f5fcc1c7c124774e9a0f79 (diff)
downloadmeson-6cc848dafdf5696430a0fa68b5717fb788e70820.tar.gz
rust: new target rustdoc
Another rust tool, another rough copy of the code to run clippy. Apart from the slightly different command lines, the output is in a directory and test targets are skipped. Knowing the output directory can be useful, so print that on successful execution of rustdoc. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'unittests/allplatformstests.py')
-rw-r--r--unittests/allplatformstests.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/unittests/allplatformstests.py b/unittests/allplatformstests.py
index fbb1c91b5..a189065f6 100644
--- a/unittests/allplatformstests.py
+++ b/unittests/allplatformstests.py
@@ -4917,6 +4917,24 @@ class AllPlatformTests(BasePlatformTests):
self.assertEqual(res[data_type][file], details)
@skip_if_not_language('rust')
+ @unittest.skipIf(not shutil.which('rustdoc'), 'Test requires rustdoc')
+ def test_rustdoc(self) -> None:
+ if self.backend is not Backend.ninja:
+ raise unittest.SkipTest('Rust is only supported with ninja currently')
+ try:
+ with tempfile.TemporaryDirectory() as tmpdir:
+ testdir = os.path.join(tmpdir, 'a')
+ shutil.copytree(os.path.join(self.rust_test_dir, '9 unit tests'),
+ testdir)
+ self.init(testdir)
+ self.build('rustdoc')
+ except PermissionError:
+ # When run under Windows CI, something (virus scanner?)
+ # holds on to the git files so cleaning up the dir
+ # fails sometimes.
+ pass
+
+ @skip_if_not_language('rust')
@unittest.skipIf(not shutil.which('clippy-driver'), 'Test requires clippy-driver')
def test_rust_clippy(self) -> None:
if self.backend is not Backend.ninja: