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