From: Mingli Yu <mingli...@windriver.com>

Add ptest support.

Signed-off-by: Mingli Yu <mingli...@windriver.com>
---
 meta/recipes-extended/pam/libpam/run-ptest | 31 ++++++++++++++++++++++
 meta/recipes-extended/pam/libpam_1.5.1.bb  | 17 +++++++++++-
 2 files changed, 47 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-extended/pam/libpam/run-ptest

diff --git a/meta/recipes-extended/pam/libpam/run-ptest 
b/meta/recipes-extended/pam/libpam/run-ptest
new file mode 100644
index 0000000000..69e729ce2a
--- /dev/null
+++ b/meta/recipes-extended/pam/libpam/run-ptest
@@ -0,0 +1,31 @@
+#! /bin/sh
+
+cd tests
+
+failed=0
+all=0
+
+for f in tst-*; do
+    "./$f" > /dev/null 2>&1
+    case "$?" in
+        0)
+            echo "PASS: $f"
+            all=$((all + 1))
+            ;;
+        77)
+            echo "SKIP: $f"
+            ;;
+        *)
+            echo "FAIL: $f"
+            failed=$((failed + 1))
+            all=$((all + 1))
+            ;;
+    esac
+done
+
+if [ "$failed" -eq 0 ] ; then
+  echo "All $all tests passed"
+else
+  echo "$failed of $all tests failed"
+fi
+
diff --git a/meta/recipes-extended/pam/libpam_1.5.1.bb 
b/meta/recipes-extended/pam/libpam_1.5.1.bb
index d6612bb936..f225487688 100644
--- a/meta/recipes-extended/pam/libpam_1.5.1.bb
+++ b/meta/recipes-extended/pam/libpam_1.5.1.bb
@@ -23,6 +23,7 @@ SRC_URI = 
"https://github.com/linux-pam/linux-pam/releases/download/v${PV}/Linux
            file://libpam-xtests.patch \
            
file://0001-modules-pam_namespace-Makefile.am-correctly-install-.patch \
            file://0001-Makefile.am-support-usrmage.patch \
+           file://run-ptest \
            "
 
 SRC_URI[sha256sum] = 
"201d40730b1135b1b3cdea09f2c28ac634d73181ccd0172ceddee3649c5792fc"
@@ -40,7 +41,7 @@ CFLAGS_append = " -fPIC "
 
 S = "${WORKDIR}/Linux-PAM-${PV}"
 
-inherit autotools gettext pkgconfig systemd
+inherit autotools gettext pkgconfig systemd ptest
 
 PACKAGECONFIG ??= ""
 PACKAGECONFIG[audit] = "--enable-audit,--disable-audit,audit,"
@@ -112,6 +113,13 @@ python populate_packages_prepend () {
     do_split_packages(d, pam_filterdir, r'^(.*)$', 'pam-filter-%s', 'PAM 
filter for %s', extra_depends='')
 }
 
+do_compile_ptest() {
+        cd tests
+        sed -i -e 's/$(MAKE) $(AM_MAKEFLAGS) check-TESTS//' Makefile
+        oe_runmake check-am
+        cd -
+}
+
 do_install() {
        autotools_do_install
 
@@ -131,6 +139,13 @@ do_install() {
        fi
 }
 
+do_install_ptest() {
+    if [ ${PTEST_ENABLED} = "1" ]; then
+        mkdir -p ${D}${PTEST_PATH}/tests
+        install -m 0755 ${B}/tests/.libs/* ${D}${PTEST_PATH}/tests
+    fi
+}
+
 inherit features_check
 REQUIRED_DISTRO_FEATURES = "pam"
 
-- 
2.17.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#147105): 
https://lists.openembedded.org/g/openembedded-core/message/147105
Mute This Topic: https://lists.openembedded.org/mt/80024714/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to