test_rust.py 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import os
  2. import infra.basetest
  3. class TestRustBase(infra.basetest.BRTest):
  4. def login(self):
  5. img = os.path.join(self.builddir, "images", "rootfs.cpio")
  6. self.emulator.boot(arch="armv7",
  7. kernel="builtin",
  8. options=["-initrd", img])
  9. self.emulator.login()
  10. class TestRustBin(TestRustBase):
  11. config = \
  12. """
  13. BR2_arm=y
  14. BR2_cortex_a9=y
  15. BR2_ARM_ENABLE_NEON=y
  16. BR2_ARM_ENABLE_VFP=y
  17. BR2_TOOLCHAIN_EXTERNAL=y
  18. BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
  19. BR2_SYSTEM_DHCP="eth0"
  20. BR2_TARGET_ROOTFS_CPIO=y
  21. # BR2_TARGET_ROOTFS_TAR is not set
  22. BR2_PACKAGE_HOST_RUSTC=y
  23. BR2_PACKAGE_RIPGREP=y
  24. """
  25. def test_run(self):
  26. self.login()
  27. self.assertRunOk("rg Buildroot /etc/issue")
  28. class TestRust(TestRustBase):
  29. config = \
  30. """
  31. BR2_arm=y
  32. BR2_cortex_a9=y
  33. BR2_ARM_ENABLE_NEON=y
  34. BR2_ARM_ENABLE_VFP=y
  35. BR2_TOOLCHAIN_EXTERNAL=y
  36. BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
  37. BR2_SYSTEM_DHCP="eth0"
  38. BR2_TARGET_ROOTFS_CPIO=y
  39. # BR2_TARGET_ROOTFS_TAR is not set
  40. BR2_PACKAGE_HOST_RUSTC=y
  41. BR2_PACKAGE_HOST_RUST=y
  42. BR2_PACKAGE_RIPGREP=y
  43. """
  44. def test_run(self):
  45. self.login()
  46. self.assertRunOk("rg Buildroot /etc/issue")