Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] libc-test: add libc testsuite for musl
@ 2022-11-03  5:39 Chase Qi
  2022-11-03 13:22 ` [OE-core] " Alexandre Belloni
  2022-11-03 13:51 ` Ross Burton
  0 siblings, 2 replies; 4+ messages in thread
From: Chase Qi @ 2022-11-03  5:39 UTC (permalink / raw)
  To: openembedded-core; +Cc: Chase Qi

libc-test is a collection of unit test to measure the correctness and
robustness of a C/POSIX standard library implementation. It is developed
as part of the musl project.

Signed-off-by: Chase Qi <chase.qi@linaro.org>
---
 meta/recipes-core/musl/libc-test/run-ptest | 17 ++++++++
 meta/recipes-core/musl/libc-test_git.bb    | 45 ++++++++++++++++++++++
 2 files changed, 62 insertions(+)
 create mode 100644 meta/recipes-core/musl/libc-test/run-ptest
 create mode 100644 meta/recipes-core/musl/libc-test_git.bb

diff --git a/meta/recipes-core/musl/libc-test/run-ptest b/meta/recipes-core/musl/libc-test/run-ptest
new file mode 100644
index 0000000000..30abcdfba5
--- /dev/null
+++ b/meta/recipes-core/musl/libc-test/run-ptest
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+make cleanall
+make run | tee libc-test.log
+
+echo ""
+echo "--- ptest result ---"
+if grep -q '^FAIL src.*\.exe.*' libc-test.log; then
+    # Consolidate output format.
+    # e.g. "FAIL src/api/main.exe [status 1]" -> "FAIL: api_main"
+    grep '^FAIL src.*\.exe.*' libc-test.log \
+        | sed 's|^FAIL src/|FAIL: |;s|/|_|;s|\.exe.*\]||'
+    exit 1
+else
+    echo "PASS: libc-test"
+    exit 0
+fi
diff --git a/meta/recipes-core/musl/libc-test_git.bb b/meta/recipes-core/musl/libc-test_git.bb
new file mode 100644
index 0000000000..d5d8845727
--- /dev/null
+++ b/meta/recipes-core/musl/libc-test_git.bb
@@ -0,0 +1,45 @@
+SUMMARY = "Musl libc test to be run with ptest"
+HOMEPAGE = "https://wiki.musl-libc.org/libc-test.html"
+DESCRIPTION = "libc-test is a collection of unit tests to measure the \
+correctness and robustness of a C/POSIX standard library implementation. It is \
+developed as part of the musl project."
+SECTION = "tests"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=43ed1245085be90dc934288117d55a3b"
+
+inherit ptest
+
+SRCREV = "18e28496adee3d84fefdda6efcb9c5b8996a2398"
+SRC_URI = " \
+    git://nsz.repo.hu:49100/repo/libc-test;branch=master \
+    file://run-ptest \
+"
+MIRRORS += "git://nsz.repo.hu:49100/repo/libc-test git://repo.or.cz/libc-test"
+
+S = "${WORKDIR}/git"
+
+# libc-test 'make' or 'make run' command is designed to build and run tests. It
+# reports both build and test failures. The commands should be run on target.
+do_compile() {
+    :
+}
+
+RDEPENDS:${PN}-ptest = " \
+    bash \
+    grep \
+    musl \
+    packagegroup-core-buildessential \
+    sed \
+"
+
+do_install_ptest () {
+    cp ${S}/Makefile ${D}${PTEST_PATH}
+    cp ${S}/config.mak.def ${D}${PTEST_PATH}/config.mak
+    cp -r ${S}/src ${D}${PTEST_PATH}/
+}
+
+# libc-test-ptest depends on empty libc-test.
+ALLOW_EMPTY:${PN} = "1"
+
+COMPATIBLE_HOST = "null"
+COMPATIBLE_HOST:libc-musl = "(.*)"
-- 
2.25.1



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

end of thread, other threads:[~2022-11-04 10:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-03  5:39 [PATCH] libc-test: add libc testsuite for musl Chase Qi
2022-11-03 13:22 ` [OE-core] " Alexandre Belloni
2022-11-03 13:51 ` Ross Burton
2022-11-04 10:16   ` Chase Qi

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