All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] support/testing/tests/package/test_ruby.py: new runtime test
@ 2023-09-18  8:25 Waldemar Brodkorb
  2023-11-08 22:20 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 2+ messages in thread
From: Waldemar Brodkorb @ 2023-09-18  8:25 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
---
 support/testing/tests/package/test_ruby.py | 42 ++++++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 support/testing/tests/package/test_ruby.py

diff --git a/support/testing/tests/package/test_ruby.py b/support/testing/tests/package/test_ruby.py
new file mode 100644
index 0000000000..bedd9afb1c
--- /dev/null
+++ b/support/testing/tests/package/test_ruby.py
@@ -0,0 +1,42 @@
+import os
+
+import infra.basetest
+
+
+class TestRubyBase(infra.basetest.BRTest):
+    config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
+        """
+        BR2_TARGET_ROOTFS_CPIO=y
+        # BR2_TARGET_ROOTFS_TAR is not set
+        """
+    interpreter = "ruby"
+
+    def login(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()
+
+class TestRuby(TestRubyBase):
+    config = TestRubyBase.config + \
+        """
+        BR2_PACKAGE_RUBY=y
+        BR2_PACKAGE_ZLIB=y
+        """
+
+    def version_test(self):
+        cmd = self.interpreter + " -v"
+        output, exit_code = self.emulator.run(cmd)
+        self.assertEqual(exit_code, 0)
+
+    def zlib_test(self, timeout=-1):
+        cmd = self.interpreter + " -e 'require \"zlib\"'"
+        _, exit_code = self.emulator.run(cmd, timeout)
+        self.assertEqual(exit_code, 0)
+
+    def test_run(self):
+        self.login()
+        self.version_test()
+        self.zlib_test()
+
-- 
2.39.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-08 22:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-18  8:25 [Buildroot] [PATCH] support/testing/tests/package/test_ruby.py: new runtime test Waldemar Brodkorb
2023-11-08 22:20 ` Thomas Petazzoni via buildroot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.