diff options
| -rw-r--r-- | meta-oe/recipes-extended/rsyslog/librelp/0001-Fix-function-inline-errors-in-debug-optimization-Og.patch (renamed from meta-oe/recipes-extended/rsyslog/files/0001-Fix-function-inline-errors-in-debug-optimization-Og.patch) | 0 | ||||
| -rw-r--r-- | meta-oe/recipes-extended/rsyslog/librelp/run-ptest | 10 | ||||
| -rw-r--r-- | meta-oe/recipes-extended/rsyslog/librelp_1.11.0.bb | 59 |
3 files changed, 68 insertions, 1 deletions
diff --git a/meta-oe/recipes-extended/rsyslog/files/0001-Fix-function-inline-errors-in-debug-optimization-Og.patch b/meta-oe/recipes-extended/rsyslog/librelp/0001-Fix-function-inline-errors-in-debug-optimization-Og.patch index 10e2b564cc..10e2b564cc 100644 --- a/meta-oe/recipes-extended/rsyslog/files/0001-Fix-function-inline-errors-in-debug-optimization-Og.patch +++ b/meta-oe/recipes-extended/rsyslog/librelp/0001-Fix-function-inline-errors-in-debug-optimization-Og.patch | |||
diff --git a/meta-oe/recipes-extended/rsyslog/librelp/run-ptest b/meta-oe/recipes-extended/rsyslog/librelp/run-ptest new file mode 100644 index 0000000000..a649a5716f --- /dev/null +++ b/meta-oe/recipes-extended/rsyslog/librelp/run-ptest | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # | ||
| 3 | set -e | ||
| 4 | set -o pipefail | ||
| 5 | |||
| 6 | SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" | ||
| 7 | cd ${SCRIPTPATH} | ||
| 8 | useradd tester || echo "user already exists" | ||
| 9 | su tester -c "make -C tests -k check-TESTS" | ||
| 10 | userdel tester | ||
diff --git a/meta-oe/recipes-extended/rsyslog/librelp_1.11.0.bb b/meta-oe/recipes-extended/rsyslog/librelp_1.11.0.bb index bac5abb052..cbbc31b7d1 100644 --- a/meta-oe/recipes-extended/rsyslog/librelp_1.11.0.bb +++ b/meta-oe/recipes-extended/rsyslog/librelp_1.11.0.bb | |||
| @@ -8,10 +8,67 @@ DEPENDS = "gmp nettle libidn zlib gnutls openssl" | |||
| 8 | 8 | ||
| 9 | SRC_URI = "git://github.com/rsyslog/librelp.git;protocol=https;branch=stable \ | 9 | SRC_URI = "git://github.com/rsyslog/librelp.git;protocol=https;branch=stable \ |
| 10 | file://0001-Fix-function-inline-errors-in-debug-optimization-Og.patch \ | 10 | file://0001-Fix-function-inline-errors-in-debug-optimization-Og.patch \ |
| 11 | file://run-ptest \ | ||
| 11 | " | 12 | " |
| 12 | 13 | ||
| 13 | SRCREV = "b421f56d9ee31a966058d23bd23c966221c91396" | 14 | SRCREV = "b421f56d9ee31a966058d23bd23c966221c91396" |
| 14 | 15 | ||
| 15 | S = "${WORKDIR}/git" | 16 | S = "${WORKDIR}/git" |
| 16 | 17 | ||
| 17 | inherit autotools pkgconfig | 18 | inherit autotools pkgconfig ptest |
| 19 | |||
| 20 | # For ptests, copy source tests/*.sh scripts, Makefile and | ||
| 21 | # executables and run them with make on target. | ||
| 22 | TESTDIR = "tests" | ||
| 23 | do_compile_ptest() { | ||
| 24 | echo 'buildtest-TESTS: $(check_PROGRAMS)' >> ${TESTDIR}/Makefile | ||
| 25 | oe_runmake -C ${TESTDIR} buildtest-TESTS | ||
| 26 | } | ||
| 27 | |||
| 28 | do_install_ptest() { | ||
| 29 | install -d ${D}${PTEST_PATH}/${TESTDIR} | ||
| 30 | |||
| 31 | # copy source tests/*.sh and python scripts | ||
| 32 | cp -f ${S}/${TESTDIR}/*.{sh,py} ${D}${PTEST_PATH}/${TESTDIR} | ||
| 33 | # install data files needed by the test scripts on the target | ||
| 34 | cp -f ${S}/${TESTDIR}/*.supp ${D}${PTEST_PATH}/${TESTDIR} | ||
| 35 | cp -rf ${S}/${TESTDIR}/tls-certs ${D}${PTEST_PATH}/${TESTDIR} | ||
| 36 | |||
| 37 | # copy executables | ||
| 38 | find ${B}/${TESTDIR} -type f -executable -exec cp {} ${D}${PTEST_PATH}/${TESTDIR} \; | ||
| 39 | cp -rf ${B}/${TESTDIR}/.libs ${D}${PTEST_PATH}/${TESTDIR} | ||
| 40 | # copy Makefile | ||
| 41 | # run-ptest will run make which runs the executables | ||
| 42 | cp -f ${B}/${TESTDIR}/Makefile ${D}${PTEST_PATH}/${TESTDIR} | ||
| 43 | cp -f ${B}/${TESTDIR}/set-envvars ${D}${PTEST_PATH}/${TESTDIR} | ||
| 44 | |||
| 45 | # give permissions to all users | ||
| 46 | # some tests need to write to this directory | ||
| 47 | chmod 777 -R ${D}${PTEST_PATH}/${TESTDIR} | ||
| 48 | |||
| 49 | # do NOT need to rebuild Makefile or $(check_PROGRAMS) | ||
| 50 | sed -i 's/^Makefile:.*$/Makefile:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile | ||
| 51 | sed -i 's/^check-TESTS:.*$/check-TESTS:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile | ||
| 52 | |||
| 53 | # fix the srcdir, top_srcdir, abs_top_builddir | ||
| 54 | sed -i 's,^\(srcdir = \).*,\1${PTEST_PATH}/${TESTDIR},' ${D}${PTEST_PATH}/${TESTDIR}/Makefile | ||
| 55 | sed -i 's,^\(top_srcdir = \).*,\1${PTEST_PATH}/${TESTDIR},' ${D}${PTEST_PATH}/${TESTDIR}/Makefile | ||
| 56 | sed -i 's,^\(abs_top_builddir = \).*,\1${PTEST_PATH}/,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile | ||
| 57 | |||
| 58 | # install test-driver | ||
| 59 | install -m 644 ${S}/test-driver ${D}${PTEST_PATH} | ||
| 60 | |||
| 61 | # fix the python3 path for tests/set-envar | ||
| 62 | sed -i -e s:${HOSTTOOLS_DIR}:${bindir}:g ${D}${PTEST_PATH}/${TESTDIR}/set-envvars | ||
| 63 | |||
| 64 | # these 2 scripts need help finding their /usr/lib/librelp/ptest/tests/.libs libraries | ||
| 65 | sed -i 's:${B}/src:${PTEST_PATH}/${TESTDIR}:' ${D}${PTEST_PATH}/${TESTDIR}/send | ||
| 66 | sed -i 's:${B}/src:${PTEST_PATH}/${TESTDIR}:' ${D}${PTEST_PATH}/${TESTDIR}/receive | ||
| 67 | } | ||
| 68 | |||
| 69 | RDEPENDS:${PN}-ptest += "\ | ||
| 70 | make bash coreutils libgcc util-linux gawk grep \ | ||
| 71 | python3-core python3-io \ | ||
| 72 | " | ||
| 73 | |||
| 74 | RRECOMMENDS:${PN}-ptest += " valgrind" | ||
