Skip to contentSkip to conversation

libcheck: add ptest support

PATCH Superseded Pratik Farkase 3 participants 6 messages Nov 14, 2025 – Jan 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libcheck: add ptest support

Add package test (ptest) support to libcheck recipe to enable running the test suite on target devices.

The implementation installs:
- Test binaries (check_check, check_check_export)
- Test helper binaries and scripts
- Shell script tests that validate various output formats
- Test configuration files

All 9 upstream tests pass successfully:
START: ptest-runner
BEGIN: /usr/lib/libcheck/ptest
PASS: check_check_export
PASS: check_check
PASS: test_output.sh
PASS: test_check_nofork.sh
PASS: test_check_nofork_teardown.sh
PASS: test_xml_output.sh
PASS: test_log_output.sh
PASS: test_set_max_msg_size.sh
PASS: test_tap_output.sh
END: /usr/lib/libcheck/ptest
STOP: ptest-runner

Note: The test_vars SRCDIR path is set to /usr/src/debug/libcheck/0.15.2/tests to match the debug source paths embedded in compiled binaries.

---
 .../distro/include/ptest-packagelists.inc     |  1 +
 .../libcheck/libcheck/run-ptest               | 36 ++++++++++++++++++
 .../libcheck/libcheck_0.15.2.bb               | 37 ++++++++++++++++++-
 3 files changed, 73 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-support/libcheck/libcheck/run-ptest
meta/conf/distro/include/ptest-packagelists.inc +1 -0
index 06d113e264..3cd5f244be 100644
@@ -28,6 +28,7 @@ PTESTS_FAST = "\
     icu \
     json-c \
     json-glib \
+    libcheck \
     libconvert-asn1-perl \
     libexif \
     libgpg-error\
meta/recipes-support/libcheck/libcheck/run-ptest new file +36 -0
new file mode 100644
index 0000000000..fe252bc33d
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+# run-ptest script for libcheck
+# Runs the libcheck test suite and outputs results in ptest format
+
+cd tests || exit 1
+
+for test in check_check_export check_check; do
+    if [ -x ./$test ]; then
+        ./$test > /dev/null 2>&1
+        if [ $? -eq 0 ]; then
+            echo "PASS: $test"
+        else
+            echo "FAIL: $test"
+        fi
+    else
+        echo "SKIP: $test"
+    fi
+done
+
+for test in test_output.sh test_check_nofork.sh test_check_nofork_teardown.sh \
+            test_xml_output.sh test_log_output.sh test_set_max_msg_size.sh \
+            test_tap_output.sh; do
+    if [ -x ./$test ]; then
+        ./$test > /dev/null 2>&1
+        if [ $? -eq 0 ]; then
+            echo "PASS: $test"
+        else
+            echo "FAIL: $test"
+        fi
+    else
+        echo "SKIP: $test"
+    fi
+done
+
+exit 0
meta/recipes-support/libcheck/libcheck_0.15.2.bb +36 -1
index adf95f5040..52df7c22bb 100644
@@ -14,6 +14,7 @@ SRC_URI = "${GITHUB_BASE_URI}/download/${PV}/check-${PV}.tar.gz \
            file://automake-output.patch \
            file://subunit.patch \
            file://0001-Fix-texinfo-errors-and-warnings.patch \
+           file://run-ptest \
 "
 
 SRC_URI[sha256sum] = "a8de4e0bacfb4d76dd1c618ded263523b53b85d92a146d8835eb1a52932fa20a"
@@ -21,17 +22,51 @@ GITHUB_BASE_URI = "https://github.com/libcheck/check/releases/"
 
 S = "${UNPACKDIR}/check-${PV}"
 
-inherit cmake pkgconfig texinfo github-releases
+inherit cmake pkgconfig texinfo github-releases ptest
 
 RREPLACES:${PN} = "check (<= 0.9.5)"
 
 EXTRA_OECMAKE:append:class-target = " -DAWK_PATH=${bindir}/awk"
 EXTRA_OECMAKE = "-DENABLE_SUBUNIT_EXT=OFF"
 
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/tests
+
+    install -m 0755 ${B}/tests/check_check ${D}${PTEST_PATH}/tests/
+    install -m 0755 ${B}/tests/check_check_export ${D}${PTEST_PATH}/tests/
+
+    for binary in ${B}/tests/*; do
+        if [ -f "$binary" ] && [ -x "$binary" ]; then
+            case "$binary" in
+                *.sh) ;;
+                *) install -m 0755 "$binary" ${D}${PTEST_PATH}/tests/ || true ;;
+            esac
+        fi
+    done
+
+    for script in test_output.sh test_check_nofork.sh test_check_nofork_teardown.sh \
+                  test_xml_output.sh test_log_output.sh test_set_max_msg_size.sh \
+                  test_tap_output.sh; do
+        install -m 0755 ${S}/tests/$script ${D}${PTEST_PATH}/tests/
+    done
+
+    install -m 0755 ${S}/tests/test_output_strings ${D}${PTEST_PATH}/tests/
+
+    if [ -f ${B}/tests/test_vars ]; then
+        install -m 0644 ${B}/tests/test_vars ${D}${PTEST_PATH}/tests/
+        sed -i \
+            -e 's|if \[ x"[^"]*" != x"\." \];|if \[ x"/usr/src/debug/libcheck/0.15.2/tests" != x"." \];|g' \
+            -e 's|SRCDIR="[^"]*"|SRCDIR="/usr/src/debug/libcheck/0.15.2/tests/"|g' \
+            ${D}${PTEST_PATH}/tests/test_vars
+    fi
+}
+
 do_install:append:class-native() {
     create_cmdline_shebang_wrapper ${D}${bindir}/checkmk
 }
 
+RDEPENDS:${PN}-ptest += "bash libcheck"
+
 BBCLASSEXTEND = "native nativesdk"
 
 PACKAGES =+ "checkmk"
Signature · 1 line
2.43.0
#1 lore raw

Hi Pratik,

Thanks for adding a new test case. Some comments:

Quoted 18 lines · Pratik Farkase via lists.openembedded.org
meta/recipes-support/libcheck/libcheck/run-ptest new file +17 -0
+for test in check_check_export check_check; do
+    if [ -x ./$test ]; then
+        ./$test > /dev/null 2>&1
+        if [ $? -eq 0 ]; then
+            echo "PASS: $test"
+        else
+            echo "FAIL: $test"
+        fi
+    else
+        echo "SKIP: $test"
+    fi
+done
+
+for test in test_output.sh test_check_nofork.sh test_check_nofork_teardown.sh \
+            test_xml_output.sh test_log_output.sh test_set_max_msg_size.sh \
+            test_tap_output.sh; do
+    if [ -x ./$test ]; then

meta/recipes-support/libcheck/libcheck/run-ptest line 34

Quoted 10 lines
meta/recipes-support/libcheck/libcheck/run-ptest new file +10 -0
+        ./$test > /dev/null 2>&1
+        if [ $? -eq 0 ]; then
+            echo "PASS: $test"
+        else
+            echo "FAIL: $test"
+        fi
+    else
+        echo "SKIP: $test"
+    fi
+done

This looks like the same loop, twice. Why not merge them?

meta/recipes-support/libcheck/libcheck_0.15.2.bb GITHUB_BASE_URI = "https://github.com/libcheck/check/releases/" · line 42

Quoted 5 lines
meta/recipes-support/libcheck/libcheck_0.15.2.bb +5 -0
+    for binary in ${B}/tests/*; do
+        if [ -f "$binary" ] && [ -x "$binary" ]; then
+            case "$binary" in
+                *.sh) ;;
+                *) install -m 0755 "$binary" ${D}${PTEST_PATH}/tests/ || true ;;

Don’t ||true, if it fails we want this to fail.

Also considering the lists of tests is hardcoded in run-ptest _and_ upstream hasn’t been changed in four years, it might be easier to just hardcode the list of binaries that we install instead of playing games trying to identify the right output.

meta/recipes-support/libcheck/libcheck_0.15.2.bb GITHUB_BASE_URI = "https://github.com/libcheck/check/releases/" · line 51

Quoted 9 lines
meta/recipes-support/libcheck/libcheck_0.15.2.bb +9 -0
+            esac
+        fi
+    done
+
+    for script in test_output.sh test_check_nofork.sh test_check_nofork_teardown.sh \
+                  test_xml_output.sh test_log_output.sh test_set_max_msg_size.sh \
+                  test_tap_output.sh; do
+        install -m 0755 ${S}/tests/$script ${D}${PTEST_PATH}/tests/
+    done

This is just test/*.sh, right?

meta/recipes-support/libcheck/libcheck_0.15.2.bb GITHUB_BASE_URI = "https://github.com/libcheck/check/releases/" · line 60

Quoted 8 lines
meta/recipes-support/libcheck/libcheck_0.15.2.bb +8 -0
+    install -m 0755 ${S}/tests/test_output_strings ${D}${PTEST_PATH}/tests/
+
+    if [ -f ${B}/tests/test_vars ]; then
+        install -m 0644 ${B}/tests/test_vars ${D}${PTEST_PATH}/tests/
+        sed -i \
+            -e 's|if \[ x"[^"]*" != x"\." \];|if \[ x"/usr/src/debug/libcheck/0.15.2/tests" != x"." \];|g' \
+            -e 's|SRCDIR="[^"]*"|SRCDIR="/usr/src/debug/libcheck/0.15.2/tests/"|g' \
+            ${D}${PTEST_PATH}/tests/test_vars

Hard-coded paths that will break on upgrade. ${TARGET_DBGSRC_DIR} is the variable you want.

Quoted 1 line

+RDEPENDS:${PN}-ptest += "bash libcheck"

You can remove this: I don’t see any scripts that use bash, and the dependency on libcheck will be generated automatically.

Thanks,
Ross

#2 lore raw

Hi Ross,

Thank you for the detailed review and feedback!

I've addressed all your comments in v2:

1. Merged the duplicate test loops into a single loop
2. Removed || true from install commands
3. Hardcoded the list of helper binaries to install instead of dynamic detection
4. Simplified shell script installation using *.sh glob
5. Used ${TARGET_DBGSRC_DIR} instead of hardcoded /usr/src/debug path
6. Removed redundant RDEPENDS (bash and libcheck)

All 9 tests continue to pass on qemux86-64.

v2 patch is attached/sent separately.

Thanks again for the review!

Best Regards,
Pratik

________________________________________
From: Ross Burton <[email protected]>
Sent: Tuesday, November 18, 2025 1:10 PM
To: Pratik Farkase
Cc: [email protected]; [email protected]
Subject: Re: [OE-core] [PATCH] libcheck: add ptest support

Hi Pratik,

Thanks for adding a new test case. Some comments:

Quoted 18 lines · Pratik Farkase via lists.openembedded.org
meta/recipes-support/libcheck/libcheck/run-ptest new file +17 -0
+for test in check_check_export check_check; do
+    if [ -x ./$test ]; then
+        ./$test > /dev/null 2>&1
+        if [ $? -eq 0 ]; then
+            echo "PASS: $test"
+        else
+            echo "FAIL: $test"
+        fi
+    else
+        echo "SKIP: $test"
+    fi
+done
+
+for test in test_output.sh test_check_nofork.sh test_check_nofork_teardown.sh \
+            test_xml_output.sh test_log_output.sh test_set_max_msg_size.sh \
+            test_tap_output.sh; do
+    if [ -x ./$test ]; then

meta/recipes-support/libcheck/libcheck/run-ptest line 34

Quoted 10 lines
meta/recipes-support/libcheck/libcheck/run-ptest new file +10 -0
+        ./$test > /dev/null 2>&1
+        if [ $? -eq 0 ]; then
+            echo "PASS: $test"
+        else
+            echo "FAIL: $test"
+        fi
+    else
+        echo "SKIP: $test"
+    fi
+done

This looks like the same loop, twice. Why not merge them?

meta/recipes-support/libcheck/libcheck_0.15.2.bb GITHUB_BASE_URI = "https://github.com/libcheck/check/releases/" · line 42

Quoted 5 lines
meta/recipes-support/libcheck/libcheck_0.15.2.bb +5 -0
+    for binary in ${B}/tests/*; do
+        if [ -f "$binary" ] && [ -x "$binary" ]; then
+            case "$binary" in
+                *.sh) ;;
+                *) install -m 0755 "$binary" ${D}${PTEST_PATH}/tests/ || true ;;

Don’t ||true, if it fails we want this to fail.

Also considering the lists of tests is hardcoded in run-ptest _and_ upstream hasn’t been changed in four years, it might be easier to just hardcode the list of binaries that we install instead of playing games trying to identify the right output.

meta/recipes-support/libcheck/libcheck_0.15.2.bb GITHUB_BASE_URI = "https://github.com/libcheck/check/releases/" · line 51

Quoted 9 lines
meta/recipes-support/libcheck/libcheck_0.15.2.bb +9 -0
+            esac
+        fi
+    done
+
+    for script in test_output.sh test_check_nofork.sh test_check_nofork_teardown.sh \
+                  test_xml_output.sh test_log_output.sh test_set_max_msg_size.sh \
+                  test_tap_output.sh; do
+        install -m 0755 ${S}/tests/$script ${D}${PTEST_PATH}/tests/
+    done

This is just test/*.sh, right?

meta/recipes-support/libcheck/libcheck_0.15.2.bb GITHUB_BASE_URI = "https://github.com/libcheck/check/releases/" · line 60

Quoted 8 lines
meta/recipes-support/libcheck/libcheck_0.15.2.bb +8 -0
+    install -m 0755 ${S}/tests/test_output_strings ${D}${PTEST_PATH}/tests/
+
+    if [ -f ${B}/tests/test_vars ]; then
+        install -m 0644 ${B}/tests/test_vars ${D}${PTEST_PATH}/tests/
+        sed -i \
+            -e 's|if \[ x"[^"]*" != x"\." \];|if \[ x"/usr/src/debug/libcheck/0.15.2/tests" != x"." \];|g' \
+            -e 's|SRCDIR="[^"]*"|SRCDIR="/usr/src/debug/libcheck/0.15.2/tests/"|g' \
+            ${D}${PTEST_PATH}/tests/test_vars

Hard-coded paths that will break on upgrade. ${TARGET_DBGSRC_DIR} is the variable you want.

Quoted 1 line

+RDEPENDS:${PN}-ptest += "bash libcheck"

You can remove this: I don’t see any scripts that use bash, and the dependency on libcheck will be generated automatically.

Thanks,
Ross

#3 lore raw

PATCH v2 1/1 libcheck: add ptest support

In reply to Pratik Farkase

Add package test (ptest) support to libcheck recipe to enable running the test suite on target devices.

The implementation installs:
- Test binaries (check_check, check_check_export)
- Test helper binaries and scripts
- Shell script tests that validate various output formats
- Test configuration files

All 9 upstream tests pass successfully:
START: ptest-runner
BEGIN: /usr/lib/libcheck/ptest
PASS: check_check_export
PASS: check_check
PASS: test_output.sh
PASS: test_check_nofork.sh
PASS: test_check_nofork_teardown.sh
PASS: test_xml_output.sh
PASS: test_log_output.sh
PASS: test_set_max_msg_size.sh
PASS: test_tap_output.sh
END: /usr/lib/libcheck/ptest
STOP: ptest-runner

Note: The test_vars SRCDIR path is set to /usr/src/debug/libcheck/0.15.2/tests to match the debug source paths embedded in compiled binaries.

---
Changes in v2:
- Merged duplicate test loops in run-ptest
- Hardcoded binary list instead of dynamic detection
- Use *.sh glob for installing test scripts
- Use ${TARGET_DBGSRC_DIR} instead of hardcoded path
- Removed redundant RDEPENDS

---
 .../distro/include/ptest-packagelists.inc     |  1 +
 .../libcheck/libcheck/run-ptest               | 24 ++++++++++++++++
 .../libcheck/libcheck_0.15.2.bb               | 28 +++++++++++++++++--
 3 files changed, 51 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-support/libcheck/libcheck/run-ptest
meta/conf/distro/include/ptest-packagelists.inc +1 -0
index 06d113e264..3cd5f244be 100644
@@ -28,6 +28,7 @@ PTESTS_FAST = "\
     icu \
     json-c \
     json-glib \
+    libcheck \
     libconvert-asn1-perl \
     libexif \
     libgpg-error\
meta/recipes-support/libcheck/libcheck/run-ptest new file +24 -0
new file mode 100644
index 0000000000..6523b1d146
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+# run-ptest script for libcheck
+# Runs the libcheck test suite and outputs results in ptest format
+
+cd tests || exit 1
+
+for test in check_check_export check_check \
+            test_output.sh test_check_nofork.sh test_check_nofork_teardown.sh \
+            test_xml_output.sh test_log_output.sh test_set_max_msg_size.sh \
+            test_tap_output.sh; do
+    if [ -x ./$test ]; then
+        ./$test > /dev/null 2>&1
+        if [ $? -eq 0 ]; then
+            echo "PASS: $test"
+        else
+            echo "FAIL: $test"
+        fi
+    else
+        echo "SKIP: $test"
+    fi
+done
+
+exit 0
meta/recipes-support/libcheck/libcheck_0.15.2.bb +26 -2
index adf95f5040..e45c1d0264 100644
@@ -6,7 +6,6 @@ segmentation faults or other signals can be caught. Test results are \
 reportable in the following: Subunit, TAP, XML, and a generic logging format."
 HOMEPAGE = "https://libcheck.github.io/check/"
 SECTION = "devel"
-
 LICENSE  = "LGPL-2.1-or-later"
 LIC_FILES_CHKSUM = "file://COPYING.LESSER;md5=2d5025d4aa3495befef8f17206a5b0a1"
 
@@ -14,20 +13,45 @@ SRC_URI = "${GITHUB_BASE_URI}/download/${PV}/check-${PV}.tar.gz \
            file://automake-output.patch \
            file://subunit.patch \
            file://0001-Fix-texinfo-errors-and-warnings.patch \
+           file://run-ptest \
 "
 
 SRC_URI[sha256sum] = "a8de4e0bacfb4d76dd1c618ded263523b53b85d92a146d8835eb1a52932fa20a"
+
 GITHUB_BASE_URI = "https://github.com/libcheck/check/releases/"
 
 S = "${UNPACKDIR}/check-${PV}"
 
-inherit cmake pkgconfig texinfo github-releases
+inherit cmake pkgconfig texinfo github-releases ptest
 
 RREPLACES:${PN} = "check (<= 0.9.5)"
 
 EXTRA_OECMAKE:append:class-target = " -DAWK_PATH=${bindir}/awk"
 EXTRA_OECMAKE = "-DENABLE_SUBUNIT_EXT=OFF"
 
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/tests
+
+    install -m 0755 ${B}/tests/check_check ${D}${PTEST_PATH}/tests/
+    install -m 0755 ${B}/tests/check_check_export ${D}${PTEST_PATH}/tests/
+    install -m 0755 ${B}/tests/ex_output ${D}${PTEST_PATH}/tests/
+    install -m 0755 ${B}/tests/check_nofork ${D}${PTEST_PATH}/tests/
+    install -m 0755 ${B}/tests/check_nofork_teardown ${D}${PTEST_PATH}/tests/
+    install -m 0755 ${B}/tests/check_set_max_msg_size ${D}${PTEST_PATH}/tests/
+
+    install -m 0755 ${S}/tests/*.sh ${D}${PTEST_PATH}/tests/
+
+    install -m 0755 ${S}/tests/test_output_strings ${D}${PTEST_PATH}/tests/
+
+    if [ -f ${B}/tests/test_vars ]; then
+        install -m 0644 ${B}/tests/test_vars ${D}${PTEST_PATH}/tests/
+        sed -i \
+            -e 's|if \[ x"[^"]*" != x"\." \];|if \[ x"${TARGET_DBGSRC_DIR}/tests" != x"." \];|g' \
+            -e 's|SRCDIR="[^"]*"|SRCDIR="${TARGET_DBGSRC_DIR}/tests/"|g' \
+            ${D}${PTEST_PATH}/tests/test_vars
+    fi
+}
+
 do_install:append:class-native() {
     create_cmdline_shebang_wrapper ${D}${bindir}/checkmk
 }
Signature · 1 line
2.43.0
#4 lore raw

PATCH v2 1/1 libcheck: add ptest support

In reply to Pratik Farkase

Add package test (ptest) support to libcheck recipe to enable running the test suite on target devices.

The implementation installs:
- Test binaries (check_check, check_check_export)
- Test helper binaries and scripts
- Shell script tests that validate various output formats
- Test configuration files

All 9 upstream tests pass successfully:
START: ptest-runner
BEGIN: /usr/lib/libcheck/ptest
PASS: check_check_export
PASS: check_check
PASS: test_output.sh
PASS: test_check_nofork.sh
PASS: test_check_nofork_teardown.sh
PASS: test_xml_output.sh
PASS: test_log_output.sh
PASS: test_set_max_msg_size.sh
PASS: test_tap_output.sh
END: /usr/lib/libcheck/ptest
STOP: ptest-runner

Note: The test_vars SRCDIR path is set to /usr/src/debug/libcheck/0.15.2/tests to match the debug source paths embedded in compiled binaries.

---
Changes in v2:
- Merged duplicate test loops in run-ptest
- Hardcoded binary list instead of dynamic detection
- Use *.sh glob for installing test scripts
- Use ${TARGET_DBGSRC_DIR} instead of hardcoded path
- Removed redundant RDEPENDS

---
 .../distro/include/ptest-packagelists.inc     |  1 +
 .../libcheck/libcheck/run-ptest               | 24 ++++++++++++++++
 .../libcheck/libcheck_0.15.2.bb               | 28 +++++++++++++++++--
 3 files changed, 51 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-support/libcheck/libcheck/run-ptest
meta/conf/distro/include/ptest-packagelists.inc +1 -0
index 06d113e264..3cd5f244be 100644
@@ -28,6 +28,7 @@ PTESTS_FAST = "\
     icu \
     json-c \
     json-glib \
+    libcheck \
     libconvert-asn1-perl \
     libexif \
     libgpg-error\
meta/recipes-support/libcheck/libcheck/run-ptest new file +24 -0
new file mode 100644
index 0000000000..6523b1d146
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+# run-ptest script for libcheck
+# Runs the libcheck test suite and outputs results in ptest format
+
+cd tests || exit 1
+
+for test in check_check_export check_check \
+            test_output.sh test_check_nofork.sh test_check_nofork_teardown.sh \
+            test_xml_output.sh test_log_output.sh test_set_max_msg_size.sh \
+            test_tap_output.sh; do
+    if [ -x ./$test ]; then
+        ./$test > /dev/null 2>&1
+        if [ $? -eq 0 ]; then
+            echo "PASS: $test"
+        else
+            echo "FAIL: $test"
+        fi
+    else
+        echo "SKIP: $test"
+    fi
+done
+
+exit 0
meta/recipes-support/libcheck/libcheck_0.15.2.bb +26 -2
index adf95f5040..e45c1d0264 100644
@@ -6,7 +6,6 @@ segmentation faults or other signals can be caught. Test results are \
 reportable in the following: Subunit, TAP, XML, and a generic logging format."
 HOMEPAGE = "https://libcheck.github.io/check/"
 SECTION = "devel"
-
 LICENSE  = "LGPL-2.1-or-later"
 LIC_FILES_CHKSUM = "file://COPYING.LESSER;md5=2d5025d4aa3495befef8f17206a5b0a1"
 
@@ -14,20 +13,45 @@ SRC_URI = "${GITHUB_BASE_URI}/download/${PV}/check-${PV}.tar.gz \
            file://automake-output.patch \
            file://subunit.patch \
            file://0001-Fix-texinfo-errors-and-warnings.patch \
+           file://run-ptest \
 "
 
 SRC_URI[sha256sum] = "a8de4e0bacfb4d76dd1c618ded263523b53b85d92a146d8835eb1a52932fa20a"
+
 GITHUB_BASE_URI = "https://github.com/libcheck/check/releases/"
 
 S = "${UNPACKDIR}/check-${PV}"
 
-inherit cmake pkgconfig texinfo github-releases
+inherit cmake pkgconfig texinfo github-releases ptest
 
 RREPLACES:${PN} = "check (<= 0.9.5)"
 
 EXTRA_OECMAKE:append:class-target = " -DAWK_PATH=${bindir}/awk"
 EXTRA_OECMAKE = "-DENABLE_SUBUNIT_EXT=OFF"
 
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/tests
+
+    install -m 0755 ${B}/tests/check_check ${D}${PTEST_PATH}/tests/
+    install -m 0755 ${B}/tests/check_check_export ${D}${PTEST_PATH}/tests/
+    install -m 0755 ${B}/tests/ex_output ${D}${PTEST_PATH}/tests/
+    install -m 0755 ${B}/tests/check_nofork ${D}${PTEST_PATH}/tests/
+    install -m 0755 ${B}/tests/check_nofork_teardown ${D}${PTEST_PATH}/tests/
+    install -m 0755 ${B}/tests/check_set_max_msg_size ${D}${PTEST_PATH}/tests/
+
+    install -m 0755 ${S}/tests/*.sh ${D}${PTEST_PATH}/tests/
+
+    install -m 0755 ${S}/tests/test_output_strings ${D}${PTEST_PATH}/tests/
+
+    if [ -f ${B}/tests/test_vars ]; then
+        install -m 0644 ${B}/tests/test_vars ${D}${PTEST_PATH}/tests/
+        sed -i \
+            -e 's|if \[ x"[^"]*" != x"\." \];|if \[ x"${TARGET_DBGSRC_DIR}/tests" != x"." \];|g' \
+            -e 's|SRCDIR="[^"]*"|SRCDIR="${TARGET_DBGSRC_DIR}/tests/"|g' \
+            ${D}${PTEST_PATH}/tests/test_vars
+    fi
+}
+
 do_install:append:class-native() {
     create_cmdline_shebang_wrapper ${D}${bindir}/checkmk
 }
Signature · 1 line
2.43.0
#5 lore raw
Quoted 24 lines · Pratik Farkase

Add package test (ptest) support to libcheck recipe to enable running the test suite on target devices.

The implementation installs:
- Test binaries (check_check, check_check_export)
- Test helper binaries and scripts
- Shell script tests that validate various output formats
- Test configuration files

All 9 upstream tests pass successfully:
START: ptest-runner
BEGIN: /usr/lib/libcheck/ptest
PASS: check_check_export
PASS: check_check
PASS: test_output.sh
PASS: test_check_nofork.sh
PASS: test_check_nofork_teardown.sh
PASS: test_xml_output.sh
PASS: test_log_output.sh
PASS: test_set_max_msg_size.sh
PASS: test_tap_output.sh
END: /usr/lib/libcheck/ptest
STOP: ptest-runner

Quoted 6 lines

Note: The test_vars SRCDIR path is set to /usr/src/debug/libcheck/0.15.2/tests to match the debug source paths embedded in compiled binaries.

---

Hi Pratik,

Is that a new version? How does it differ from the version already merged?

https://git.openembedded.org/openembedded-core/commit/?id=1bb06e23c1c87829e5c4211e34229305c7d5f851

Thanks,
Mathieu

Signature · 3 lines
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com