2
1

test_gumbo_parser.py 934 B

123456789101112131415161718192021222324252627
  1. import os
  2. import infra.basetest
  3. class TestGumboParser(infra.basetest.BRTest):
  4. br2_external = [infra.filepath("tests/package/br2-external/gumbo-parser")]
  5. config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
  6. """
  7. BR2_PACKAGE_GUMBO_PARSER=y
  8. BR2_PACKAGE_GUMBO_PARSER_TEST=y
  9. BR2_TARGET_ROOTFS_CPIO=y
  10. # BR2_TARGET_ROOTFS_TAR is not set
  11. """
  12. def test_run(self):
  13. cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio")
  14. self.emulator.boot(arch="armv5",
  15. kernel="builtin",
  16. options=["-initrd", cpio_file])
  17. self.emulator.login()
  18. # Run the test program and check output
  19. out, ret = self.emulator.run("/usr/bin/gumbo_test")
  20. self.assertEqual(ret, 0)
  21. self.assertIn("HTML parsing successful", "\n".join(out))
  22. self.assertIn("Found title: Test HTML", "\n".join(out))