diff options
| author | André Draszik <git@andred.net> | 2020-01-08 08:56:19 +0000 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2020-01-09 14:05:37 -0800 |
| commit | 06fda830525bf2ad6e2088b56c7d9b43c0ed05c2 (patch) | |
| tree | bdb75ccd5909214e43384aa0e5c3cb194b037874 | |
| parent | 955992bcc20fa1f05f723c91b4075f299574a876 (diff) | |
| download | meta-openembedded-06fda830525bf2ad6e2088b56c7d9b43c0ed05c2.tar.gz | |
oniguruma: enable ptest
All tests (with 3400 subtests) are passing (on musl+arm).
Signed-off-by: André Draszik <git@andred.net>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
3 files changed, 94 insertions, 1 deletions
diff --git a/meta-oe/recipes-support/onig/onig/0001-build-enable-serial-tests-automake-option-for-ptest.patch b/meta-oe/recipes-support/onig/onig/0001-build-enable-serial-tests-automake-option-for-ptest.patch new file mode 100644 index 0000000000..587e5ac1b8 --- /dev/null +++ b/meta-oe/recipes-support/onig/onig/0001-build-enable-serial-tests-automake-option-for-ptest.patch | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | From 8bf8189ec4a0d7ee569f66feb0e590e9602c31b6 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <git@andred.net> | ||
| 3 | Date: Mon, 6 Jan 2020 15:10:30 +0000 | ||
| 4 | Subject: [PATCH] build: enable serial-tests automake option (for ptest) | ||
| 5 | MIME-Version: 1.0 | ||
| 6 | Content-Type: text/plain; charset=UTF-8 | ||
| 7 | Content-Transfer-Encoding: 8bit | ||
| 8 | |||
| 9 | For ptest, we need to be able to compile the tests without | ||
| 10 | running them. | ||
| 11 | |||
| 12 | Enabling the serial-tests automake option will add | ||
| 13 | buildtest-TESTS and runtest-TESTS makefile targets, the | ||
| 14 | former being what we want. | ||
| 15 | |||
| 16 | Signed-off-by: André Draszik <git@andred.net> | ||
| 17 | --- | ||
| 18 | configure.ac | 2 +- | ||
| 19 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 20 | |||
| 21 | diff --git a/configure.ac b/configure.ac | ||
| 22 | index ac51e85..48e63ce 100644 | ||
| 23 | --- a/configure.ac | ||
| 24 | +++ b/configure.ac | ||
| 25 | @@ -3,7 +3,7 @@ AC_INIT(onig, 6.9.4) | ||
| 26 | |||
| 27 | AC_CONFIG_MACRO_DIR([m4]) | ||
| 28 | |||
| 29 | -AM_INIT_AUTOMAKE([-Wno-portability]) | ||
| 30 | +AM_INIT_AUTOMAKE([-Wno-portability serial-tests]) | ||
| 31 | AC_CONFIG_HEADERS([src/config.h]) | ||
| 32 | |||
| 33 | |||
| 34 | -- | ||
| 35 | 2.23.0.rc1 | ||
| 36 | |||
diff --git a/meta-oe/recipes-support/onig/onig/run-ptest b/meta-oe/recipes-support/onig/onig/run-ptest new file mode 100755 index 0000000000..2574d7efa5 --- /dev/null +++ b/meta-oe/recipes-support/onig/onig/run-ptest | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | #!/bin/sh -eu | ||
| 2 | |||
| 3 | my_cleanup() { | ||
| 4 | [ -n "${workdir:-}" ] && rm -rf "${workdir}" | ||
| 5 | } | ||
| 6 | |||
| 7 | trap "my_cleanup" EXIT | ||
| 8 | for sig in INT TERM ; do | ||
| 9 | # We want sig to expand right here and now, as it's | ||
| 10 | # a loop variable, not when signalled. For $$ it | ||
| 11 | # doesn't matter. | ||
| 12 | # shellcheck disable=SC2064 | ||
| 13 | trap "my_cleanup ; trap - EXIT ; trap - ${sig} ; kill -s ${sig} $$" ${sig} | ||
| 14 | done | ||
| 15 | |||
| 16 | workdir=$(mktemp -d -t onig.ptest.XXXXXX) | ||
| 17 | status="${workdir}/failed" | ||
| 18 | touch "${status}" | ||
| 19 | |||
| 20 | find tests/ -perm -111 -type f -exec sh -c ' | ||
| 21 | workdir="${1}" | ||
| 22 | status="${2}" | ||
| 23 | t="${3}" | ||
| 24 | t_log="${workdir}/$(basename ${t}).log" | ||
| 25 | |||
| 26 | res=0 | ||
| 27 | ./${t} > "${t_log}" 2>&1 \ | ||
| 28 | || res=$? | ||
| 29 | if [ $res -eq 0 ] ; then | ||
| 30 | echo "PASS: ${t}" | ||
| 31 | else | ||
| 32 | echo "FAIL: ${t}" | ||
| 33 | echo "$(basename ${t}): ${t_log}" >> "${status}" | ||
| 34 | fi | ||
| 35 | ' _ "${workdir}" "${status}" {} \; | ||
| 36 | |||
| 37 | if [ $(stat -c '%s' "${status}") -ne 0 ] ; then | ||
| 38 | exec >&2 | ||
| 39 | while IFS=': ' read -r t t_log ; do | ||
| 40 | printf "\n=========================\n" | ||
| 41 | printf "ERROR: %s:\n" "${t}" | ||
| 42 | printf -- "-------------------------\n" | ||
| 43 | cat "${t_log}" | ||
| 44 | done < "${status}" | ||
| 45 | fi | ||
| 46 | |||
| 47 | [ $(stat -c '%s' "${status}") -eq 0 ] | ||
diff --git a/meta-oe/recipes-support/onig/onig_6.9.4.bb b/meta-oe/recipes-support/onig/onig_6.9.4.bb index d873088fec..cfa86f04c1 100644 --- a/meta-oe/recipes-support/onig/onig_6.9.4.bb +++ b/meta-oe/recipes-support/onig/onig_6.9.4.bb | |||
| @@ -10,6 +10,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=1ee043784bdce7503e619b2d1a85798b" | |||
| 10 | SRC_URI = "\ | 10 | SRC_URI = "\ |
| 11 | https://github.com/kkos/oniguruma/releases/download/v${PV}/${BP}.tar.gz \ | 11 | https://github.com/kkos/oniguruma/releases/download/v${PV}/${BP}.tar.gz \ |
| 12 | file://0001-build-don-t-link-against-host-system-libraries.patch \ | 12 | file://0001-build-don-t-link-against-host-system-libraries.patch \ |
| 13 | file://0001-build-enable-serial-tests-automake-option-for-ptest.patch \ | ||
| 14 | file://run-ptest \ | ||
| 13 | " | 15 | " |
| 14 | 16 | ||
| 15 | SRC_URI[md5sum] = "a12d2fe997b789bd87cf63799c091879" | 17 | SRC_URI[md5sum] = "a12d2fe997b789bd87cf63799c091879" |
| @@ -17,6 +19,14 @@ SRC_URI[sha256sum] = "4669d22ff7e0992a7e93e116161cac9c0949cd8960d1c562982026726f | |||
| 17 | 19 | ||
| 18 | BINCONFIG = "${bindir}/onig-config" | 20 | BINCONFIG = "${bindir}/onig-config" |
| 19 | 21 | ||
| 20 | inherit autotools binconfig-disabled | 22 | inherit autotools binconfig-disabled ptest |
| 21 | 23 | ||
| 22 | BBCLASSEXTEND = "native" | 24 | BBCLASSEXTEND = "native" |
| 25 | |||
| 26 | do_compile_ptest() { | ||
| 27 | oe_runmake -C test buildtest-TESTS | ||
| 28 | } | ||
| 29 | |||
| 30 | do_install_ptest() { | ||
| 31 | install -Dm0755 -t ${D}${PTEST_PATH}/tests/ ${B}/test/.libs/* | ||
| 32 | } | ||
