All of lore.kernel.org
 help / color / mirror / Atom feed
From: Waldemar Brodkorb <wbx@openadk.org>
To: buildroot@buildroot.org
Subject: [Buildroot] [PATCH] support/testing/tests/package/test_ruby.py: new runtime test
Date: Mon, 18 Sep 2023 10:25:11 +0200	[thread overview]
Message-ID: <ZQgJZxHHCj8iLCdW@waldemar-brodkorb.de> (raw)

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

             reply	other threads:[~2023-09-18  8:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-18  8:25 Waldemar Brodkorb [this message]
2023-11-08 22:20 ` [Buildroot] [PATCH] support/testing/tests/package/test_ruby.py: new runtime test Thomas Petazzoni via buildroot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZQgJZxHHCj8iLCdW@waldemar-brodkorb.de \
    --to=wbx@openadk.org \
    --cc=buildroot@buildroot.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.