mirror of
https://github.com/PartialVolume/shredos.x86_64.git
synced 2026-03-13 22:22:13 +00:00
28 lines
934 B
Python
28 lines
934 B
Python
import os
|
|
|
|
import infra.basetest
|
|
|
|
|
|
class TestGumboParser(infra.basetest.BRTest):
|
|
br2_external = [infra.filepath("tests/package/br2-external/gumbo-parser")]
|
|
config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
|
|
"""
|
|
BR2_PACKAGE_GUMBO_PARSER=y
|
|
BR2_PACKAGE_GUMBO_PARSER_TEST=y
|
|
BR2_TARGET_ROOTFS_CPIO=y
|
|
# BR2_TARGET_ROOTFS_TAR is not set
|
|
"""
|
|
|
|
def test_run(self):
|
|
cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio")
|
|
self.emulator.boot(arch="armv5",
|
|
kernel="builtin",
|
|
options=["-initrd", cpio_file])
|
|
self.emulator.login()
|
|
|
|
# Run the test program and check output
|
|
out, ret = self.emulator.run("/usr/bin/gumbo_test")
|
|
self.assertEqual(ret, 0)
|
|
self.assertIn("HTML parsing successful", "\n".join(out))
|
|
self.assertIn("Found title: Test HTML", "\n".join(out))
|