Patrick Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame] | 1 | # |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame^] | 2 | # Copyright OpenEmbedded Contributors |
| 3 | # |
Patrick Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame] | 4 | # SPDX-License-Identifier: MIT |
| 5 | # |
| 6 | |
| 7 | import os |
| 8 | import shutil |
| 9 | import unittest |
| 10 | |
| 11 | from oeqa.core.utils.path import remove_safe |
| 12 | from oeqa.sdk.case import OESDKTestCase |
| 13 | |
| 14 | from oeqa.utils.subprocesstweak import errors_have_output |
| 15 | errors_have_output() |
| 16 | |
| 17 | class RustCompileTest(OESDKTestCase): |
| 18 | td_vars = ['MACHINE'] |
| 19 | |
| 20 | @classmethod |
| 21 | def setUpClass(self): |
| 22 | targetdir = os.path.join(self.tc.sdk_dir, "hello") |
| 23 | try: |
| 24 | shutil.rmtree(targetdir) |
| 25 | except FileNotFoundError: |
| 26 | pass |
| 27 | shutil.copytree(os.path.join(self.tc.sdk_files_dir, "rust/hello"), targetdir) |
| 28 | |
| 29 | def setUp(self): |
| 30 | machine = self.td.get("MACHINE") |
| 31 | if not self.tc.hasHostPackage("packagegroup-rust-cross-canadian-%s" % machine): |
| 32 | raise unittest.SkipTest("RustCompileTest class: SDK doesn't contain a Rust cross-canadian toolchain") |
| 33 | |
| 34 | def test_cargo_build(self): |
| 35 | self._run('cd %s/hello; cargo build' % self.tc.sdk_dir) |