Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] support/testing: add coremark test
@ 2024-01-07 12:56 Julien Olivain
  2024-02-05 14:54 ` Peter Korsgaard
  0 siblings, 1 reply; 2+ messages in thread
From: Julien Olivain @ 2024-01-07 12:56 UTC (permalink / raw)
  To: buildroot; +Cc: Julien Olivain

Signed-off-by: Julien Olivain <ju.o@free.fr>
---
 DEVELOPERS                                    |  1 +
 .../testing/tests/package/test_coremark.py    | 33 +++++++++++++++++++
 2 files changed, 34 insertions(+)
 create mode 100644 support/testing/tests/package/test_coremark.py

diff --git a/DEVELOPERS b/DEVELOPERS
index d7543247f2..622986cc98 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1761,6 +1761,7 @@ F:	support/testing/tests/package/test_acpica/
 F:	support/testing/tests/package/test_brotli.py
 F:	support/testing/tests/package/test_bzip2.py
 F:	support/testing/tests/package/test_compressor_base.py
+F:	support/testing/tests/package/test_coremark.py
 F:	support/testing/tests/package/test_ddrescue.py
 F:	support/testing/tests/package/test_ddrescue/
 F:	support/testing/tests/package/test_dos2unix.py
diff --git a/support/testing/tests/package/test_coremark.py b/support/testing/tests/package/test_coremark.py
new file mode 100644
index 0000000000..8bd2f32143
--- /dev/null
+++ b/support/testing/tests/package/test_coremark.py
@@ -0,0 +1,33 @@
+import os
+
+import infra.basetest
+
+
+class TestCoreMark(infra.basetest.BRTest):
+    config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
+        """
+        BR2_PACKAGE_COREMARK=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()
+
+        log_file = "run1.log"
+
+        # Run a CoreMark benchmark.
+        self.assertRunOk(f"coremark > {log_file}", timeout=60)
+
+        # Print the log file on console, for debugging.
+        self.assertRunOk(f"cat {log_file}")
+
+        # The "coremark" program return code is always 0 (success).
+        # So the correct execution is validated from the run log.
+        valid_msg = "Correct operation validated."
+        cmd = f"grep -F '{valid_msg}' {log_file}"
+        self.assertRunOk(cmd)
-- 
2.43.0

_______________________________________________
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:[~2024-02-05 14:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-07 12:56 [Buildroot] [PATCH 1/1] support/testing: add coremark test Julien Olivain
2024-02-05 14:54 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox