2018-02-04 19:07:49 +01:00
|
|
|
import os
|
|
|
|
|
|
|
|
import infra.basetest
|
|
|
|
|
|
|
|
|
|
|
|
class TestRustBase(infra.basetest.BRTest):
|
|
|
|
|
|
|
|
def login(self):
|
|
|
|
img = os.path.join(self.builddir, "images", "rootfs.cpio")
|
|
|
|
self.emulator.boot(arch="armv7",
|
|
|
|
kernel="builtin",
|
|
|
|
options=["-initrd", img])
|
|
|
|
self.emulator.login()
|
|
|
|
|
2022-03-15 22:08:54 +01:00
|
|
|
|
2018-02-04 19:07:49 +01:00
|
|
|
class TestRustBin(TestRustBase):
|
|
|
|
config = \
|
2018-11-16 23:21:47 +01:00
|
|
|
"""
|
|
|
|
BR2_arm=y
|
|
|
|
BR2_cortex_a9=y
|
|
|
|
BR2_ARM_ENABLE_NEON=y
|
|
|
|
BR2_ARM_ENABLE_VFP=y
|
|
|
|
BR2_TOOLCHAIN_EXTERNAL=y
|
|
|
|
BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
|
|
|
|
BR2_SYSTEM_DHCP="eth0"
|
|
|
|
BR2_TARGET_ROOTFS_CPIO=y
|
|
|
|
# BR2_TARGET_ROOTFS_TAR is not set
|
|
|
|
BR2_PACKAGE_HOST_RUSTC=y
|
2022-02-24 16:45:12 +01:00
|
|
|
BR2_PACKAGE_RIPGREP=y
|
2018-11-16 23:21:47 +01:00
|
|
|
"""
|
2018-02-04 19:07:49 +01:00
|
|
|
|
2018-02-12 22:02:08 +01:00
|
|
|
def test_run(self):
|
|
|
|
self.login()
|
2022-02-24 16:45:12 +01:00
|
|
|
self.assertRunOk("rg Buildroot /etc/issue")
|
2018-02-12 22:02:08 +01:00
|
|
|
|
2018-02-04 19:07:49 +01:00
|
|
|
|
|
|
|
class TestRust(TestRustBase):
|
|
|
|
config = \
|
2018-11-16 23:21:47 +01:00
|
|
|
"""
|
|
|
|
BR2_arm=y
|
|
|
|
BR2_cortex_a9=y
|
|
|
|
BR2_ARM_ENABLE_NEON=y
|
|
|
|
BR2_ARM_ENABLE_VFP=y
|
|
|
|
BR2_TOOLCHAIN_EXTERNAL=y
|
|
|
|
BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
|
|
|
|
BR2_SYSTEM_DHCP="eth0"
|
|
|
|
BR2_TARGET_ROOTFS_CPIO=y
|
|
|
|
# BR2_TARGET_ROOTFS_TAR is not set
|
|
|
|
BR2_PACKAGE_HOST_RUSTC=y
|
|
|
|
BR2_PACKAGE_HOST_RUST=y
|
2022-02-24 16:45:12 +01:00
|
|
|
BR2_PACKAGE_RIPGREP=y
|
2018-11-16 23:21:47 +01:00
|
|
|
"""
|
2018-02-12 22:02:08 +01:00
|
|
|
|
|
|
|
def test_run(self):
|
|
|
|
self.login()
|
2022-02-24 16:45:12 +01:00
|
|
|
self.assertRunOk("rg Buildroot /etc/issue")
|