buildroot.busybox.net archive mirror
 help / color / mirror / Atom feed
* [Buildroot] [git commit branch/next] support/testing/tests/package/test_nu.py: new runtime test
@ 2023-08-29 21:57 Thomas Petazzoni via buildroot
  0 siblings, 0 replies; only message in thread
From: Thomas Petazzoni via buildroot @ 2023-08-29 21:57 UTC (permalink / raw)
  To: buildroot

[-- Attachment #1: Type: text/plain, Size: 2654 bytes --]

commit: https://git.buildroot.net/buildroot/commit/?id=bea949996e193e3d40ea7dd45122f8fce75f8cd0
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/next

Load sample script support/testing/tests/package/sample_nu.nu onto the
target and verify proper execution by nushell

Signed-off-by: Sebastian Weyer <sebastian.weyer@smile.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 DEVELOPERS                                 |  2 ++
 support/testing/tests/package/sample_nu.nu |  6 ++++++
 support/testing/tests/package/test_nu.py   | 32 ++++++++++++++++++++++++++++++
 3 files changed, 40 insertions(+)

diff --git a/DEVELOPERS b/DEVELOPERS
index 24ec17a7c2..db0ea49f90 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2685,6 +2685,8 @@ F:	package/ripgrep/
 
 N:	Sebastian Weyer <sebastian.weyer@smile.fr>
 F:	package/nushell/
+F:	support/testing/tests/package/sample_nu.nu
+F:	support/testing/tests/package/test_nu.py
 
 N:	Sébastien Szymanski <sebastien.szymanski@armadeus.com>
 F:	package/mmc-utils/
diff --git a/support/testing/tests/package/sample_nu.nu b/support/testing/tests/package/sample_nu.nu
new file mode 100644
index 0000000000..5287862cf1
--- /dev/null
+++ b/support/testing/tests/package/sample_nu.nu
@@ -0,0 +1,6 @@
+#! /usr/bin/nu
+def greet [name] {
+  ["hello" $name]
+}
+
+greet "world"
diff --git a/support/testing/tests/package/test_nu.py b/support/testing/tests/package/test_nu.py
new file mode 100644
index 0000000000..14ddacfbc8
--- /dev/null
+++ b/support/testing/tests/package/test_nu.py
@@ -0,0 +1,32 @@
+import os
+
+import infra.basetest
+
+
+class TestNu(infra.basetest.BRTest):
+    # infra.basetest.BASIC_TOOLCHAIN_CONFIG cannot be used as it doesn't
+    # support a host rustc which is necessary for nushell
+    config = \
+        """
+        BR2_arm=y
+        BR2_cortex_a9=y
+        BR2_ARM_ENABLE_NEON=y
+        BR2_ARM_ENABLE_VFP=y
+        BR2_TOOLCHAIN_EXTERNAL=y
+        BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
+        BR2_SYSTEM_DHCP="eth0"
+        BR2_PACKAGE_NUSHELL=y
+        BR2_TARGET_ROOTFS_CPIO=y
+        BR2_ROOTFS_POST_BUILD_SCRIPT="{}"
+        BR2_ROOTFS_POST_SCRIPT_ARGS="{}"
+        """.format(infra.filepath("tests/package/copy-sample-script-to-target.sh"),
+                   infra.filepath("tests/package/sample_nu.nu"))
+
+    def test_run(self):
+        img = os.path.join(self.builddir, "images", "rootfs.cpio")
+        self.emulator.boot(arch="armv7",
+                           kernel="builtin",
+                           options=["-initrd", img])
+        self.emulator.login()
+        cmd = "nu sample_nu.nu"
+        self.assertRunOk(cmd)

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-08-30 20:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-29 21:57 [Buildroot] [git commit branch/next] support/testing/tests/package/test_nu.py: new runtime test Thomas Petazzoni via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).