* [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
* Re: [Buildroot] [PATCH] support/testing/tests/package/test_ruby.py: new runtime test
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
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-11-08 22:20 UTC (permalink / raw)
To: Waldemar Brodkorb; +Cc: buildroot
Hello Waldmar,
On Mon, 18 Sep 2023 10:25:11 +0200
Waldemar Brodkorb <wbx@openadk.org> wrote:
> 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
The entry in the DEVELOPERS file was missing.
> 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):
With just one test, there really wasn't a good reason to split into two
classes. So I've re-grouped the whole thing into just one class. We can
always split things later if we get more tests, and we need to
factorize some parts.
Applied with those changes, thanks!
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [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.