diff options
| author | Oleksandr <oleksandr.s.popovych@globallogic.com> | 2020-07-20 19:54:42 +0300 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-07-22 12:45:56 +0100 |
| commit | 147db377f41e9ead122b654a2be54dc0ca83f020 (patch) | |
| tree | eaac6ff87e69a8af385508cc550dd900de666608 /meta | |
| parent | 0f5ae7e79b87c6d903ca57cb695d802deb8d61d8 (diff) | |
| download | poky-147db377f41e9ead122b654a2be54dc0ca83f020.tar.gz | |
expat: Added ptest
For ptest support of expat package:
- expat_2.2.9.bb recipe was switched on cmake-based building system to
avoid cahnges in autotools build system which considered in upstream as
potentially deprecated (https://github.com/libexpat/libexpat/issues/330).
- cmake-native_3.17.3.bb recipe was forced to use bundled version of
expat from CMake source tree. Therefore expat-native package has been removed
from DEPENDS variable for cmake-native recipe. Without
these changes, next dependency loop appears:
Dependency loop #1 found:
Task /home/opopovych/repos/poky/meta/recipes-devtools/cmake/cmake-native_3.17.3.bb:do_compile (dependent Tasks ['cmake-native_3.17.3.bb:do_configure'])
Task /home/opopovych/repos/poky/meta/recipes-devtools/cmake/cmake-native_3.17.3.bb:do_install (dependent Tasks ['cmake-native_3.17.3.bb:do_compile'])
Task /home/opopovych/repos/poky/meta/recipes-devtools/cmake/cmake-native_3.17.3.bb:do_populate_sysroot (dependent Tasks ['cmake-native_3.17.3.bb:do_install'])
Task virtual:native:/home/opopovych/repos/poky/meta/recipes-core/expat/expat_2.2.9.bb:do_prepare_recipe_sysroot (dependent Tasks ['cmake-native_3.17.3.bb:do_populate_sysroot', 'ninja_1.10.0.bb:do_populate_sysroot', 'expat_2.2.9.bb:do_fetch'])
Task virtual:native:/home/opopovych/repos/poky/meta/recipes-core/expat/expat_2.2.9.bb:do_configure (dependent Tasks ['expat_2.2.9.bb:do_patch', 'expat_2.2.9.bb:do_prepare_recipe_sysroot', 'expat_2.2.9.bb:do_generate_toolchain_file', 'expat_2.2.9.bb:do_deploy_source_date_epoch'])
Task virtual:native:/home/opopovych/repos/poky/meta/recipes-core/expat/expat_2.2.9.bb:do_compile (dependent Tasks ['expat_2.2.9.bb:do_configure'])
Task virtual:native:/home/opopovych/repos/poky/meta/recipes-core/expat/expat_2.2.9.bb:do_install (dependent Tasks ['expat_2.2.9.bb:do_compile'])
Task virtual:native:/home/opopovych/repos/poky/meta/recipes-core/expat/expat_2.2.9.bb:do_populate_sysroot (dependent Tasks ['expat_2.2.9.bb:do_install'])
Task /home/opopovych/repos/poky/meta/recipes-devtools/cmake/cmake-native_3.17.3.bb:do_prepare_recipe_sysroot (dependent Tasks ['expat_2.2.9.bb:do_populate_sysroot', 'xz_5.2.5.bb:do_populate_sysroot', 'bzip2_1.0.8.bb:do_populate_sysroot', 'ncurses_6.2.bb:do_populate_sysroot', 'zlib_1.2.11.bb:do_populate_sysroot', 'cmake-native_3.17.3.bb:do_fetch', 'curl_7.71.1.bb:do_populate_sysroot'])
Task /home/opopovych/repos/poky/meta/recipes-devtools/cmake/cmake-native_3.17.3.bb:do_configure (dependent Tasks ['cmake-native_3.17.3.bb:do_deploy_source_date_epoch', 'cmake-native_3.17.3.bb:do_patch', 'cmake-native_3.17.3.bb:do_prepare_recipe_sysroot'])
- run-ptest script that initalizes testing, copies testing
executables' output to log file and measures execution time of each testing
executable was added.
- patch that implements output of each testcase result in testing exectutable
was added.
(From OE-Core rev: 3adba877e1b5e5f69a6d1501611624e2d3789a9b)
Signed-off-by: Oleksandr Popovych <oleksandr.s.popovych@globallogic.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/recipes-core/expat/expat/0001-Add-output-of-tests-result.patch | 83 | ||||
| -rw-r--r-- | meta/recipes-core/expat/expat/run-ptest | 23 | ||||
| -rw-r--r-- | meta/recipes-core/expat/expat_2.2.9.bb | 14 | ||||
| -rw-r--r-- | meta/recipes-devtools/cmake/cmake-native_3.17.3.bb | 3 |
4 files changed, 118 insertions, 5 deletions
diff --git a/meta/recipes-core/expat/expat/0001-Add-output-of-tests-result.patch b/meta/recipes-core/expat/expat/0001-Add-output-of-tests-result.patch new file mode 100644 index 0000000000..c5c18ead74 --- /dev/null +++ b/meta/recipes-core/expat/expat/0001-Add-output-of-tests-result.patch | |||
| @@ -0,0 +1,83 @@ | |||
| 1 | From aa84835a00bfd65e784d58411e76f60658e939dc Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Oleksandr Popovych <oleksandr.s.popovych@globallogic.com> | ||
| 3 | Date: Tue, 18 Feb 2020 19:04:55 +0200 | ||
| 4 | Subject: [PATCH] Add output of tests result | ||
| 5 | |||
| 6 | Added console output of testing results in form 'RESULT: TEST_NAME'. | ||
| 7 | |||
| 8 | Changed verbose mode of test application set by '-v' ('--verbose') | ||
| 9 | argument to CK_NORMAL. | ||
| 10 | Added new supported argument '-vv' ('--extra-verbose') that changes | ||
| 11 | verbose mode of test application to CK_VERBOSE. Results of each test | ||
| 12 | are shown in output only if this mode is set. | ||
| 13 | |||
| 14 | Upstream-Status: Denied | ||
| 15 | |||
| 16 | This patch changes potentially deprecated feature that shoud be changed | ||
| 17 | in upstream. [https://github.com/libexpat/libexpat/issues/382] | ||
| 18 | |||
| 19 | Signed-off-by: Oleksandr Popovych <oleksandr.s.popovych@globallogic.com> | ||
| 20 | --- | ||
| 21 | tests/minicheck.c | 10 +++++++++- | ||
| 22 | tests/runtests.c | 4 +++- | ||
| 23 | 2 files changed, 12 insertions(+), 2 deletions(-) | ||
| 24 | |||
| 25 | diff --git a/expat/tests/minicheck.c b/expat/tests/minicheck.c | ||
| 26 | index a5a1efb..94fa412 100644 | ||
| 27 | --- a/tests/minicheck.c | ||
| 28 | +++ b/tests/minicheck.c | ||
| 29 | @@ -164,6 +164,8 @@ srunner_run_all(SRunner *runner, int verbosity) { | ||
| 30 | if (tc->setup != NULL) { | ||
| 31 | /* setup */ | ||
| 32 | if (setjmp(env)) { | ||
| 33 | + if (verbosity >= CK_VERBOSE) | ||
| 34 | + printf("SKIP: %s\n", _check_current_function); | ||
| 35 | add_failure(runner, verbosity); | ||
| 36 | continue; | ||
| 37 | } | ||
| 38 | @@ -171,6 +173,8 @@ srunner_run_all(SRunner *runner, int verbosity) { | ||
| 39 | } | ||
| 40 | /* test */ | ||
| 41 | if (setjmp(env)) { | ||
| 42 | + if (verbosity >= CK_VERBOSE) | ||
| 43 | + printf("FAIL: %s\n", _check_current_function); | ||
| 44 | add_failure(runner, verbosity); | ||
| 45 | continue; | ||
| 46 | } | ||
| 47 | @@ -178,12 +182,16 @@ srunner_run_all(SRunner *runner, int verbosity) { | ||
| 48 | |||
| 49 | /* teardown */ | ||
| 50 | if (tc->teardown != NULL) { | ||
| 51 | - if (setjmp(env)) { | ||
| 52 | + if (setjmp(env)) { | ||
| 53 | + if (verbosity >= CK_VERBOSE) | ||
| 54 | + printf("PASS: %s\n", _check_current_function); | ||
| 55 | add_failure(runner, verbosity); | ||
| 56 | continue; | ||
| 57 | } | ||
| 58 | tc->teardown(); | ||
| 59 | } | ||
| 60 | + if (verbosity >= CK_VERBOSE) | ||
| 61 | + printf("PASS: %s\n", _check_current_function); | ||
| 62 | } | ||
| 63 | tc = tc->next_tcase; | ||
| 64 | } | ||
| 65 | diff --git a/tests/runtests.c b/expat/tests/runtests.c | ||
| 66 | index 7791fe0..75724e5 100644 | ||
| 67 | --- a/tests/runtests.c | ||
| 68 | +++ b/tests/runtests.c | ||
| 69 | @@ -11619,9 +11619,11 @@ main(int argc, char *argv[]) { | ||
| 70 | for (i = 1; i < argc; ++i) { | ||
| 71 | char *opt = argv[i]; | ||
| 72 | if (strcmp(opt, "-v") == 0 || strcmp(opt, "--verbose") == 0) | ||
| 73 | - verbosity = CK_VERBOSE; | ||
| 74 | + verbosity = CK_NORMAL; | ||
| 75 | else if (strcmp(opt, "-q") == 0 || strcmp(opt, "--quiet") == 0) | ||
| 76 | verbosity = CK_SILENT; | ||
| 77 | + else if (strcmp(opt, "-vv") == 0 || strcmp(opt, "--extra-verbose") == 0) | ||
| 78 | + verbosity = CK_VERBOSE; | ||
| 79 | else { | ||
| 80 | fprintf(stderr, "runtests: unknown option '%s'\n", opt); | ||
| 81 | return 2; | ||
| 82 | -- | ||
| 83 | 2.17.1 | ||
diff --git a/meta/recipes-core/expat/expat/run-ptest b/meta/recipes-core/expat/expat/run-ptest new file mode 100644 index 0000000000..1b39cec8e5 --- /dev/null +++ b/meta/recipes-core/expat/expat/run-ptest | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | output=${1:-"expat_tests.log"} # default log file | ||
| 4 | |||
| 5 | # logging function | ||
| 6 | function testCheck() { | ||
| 7 | testExec="$1" | ||
| 8 | shift | ||
| 9 | echo && echo ${testExec} && ./${testExec} "$@" | ||
| 10 | error=$? | ||
| 11 | result=$([[ ${error} -eq 0 ]] && echo "PASS" || echo "FAIL") | ||
| 12 | echo "${result}: ${testExec}" && echo "============================" | ||
| 13 | } | ||
| 14 | |||
| 15 | export output | ||
| 16 | export -f testCheck | ||
| 17 | TIME=$(which time) | ||
| 18 | |||
| 19 | echo "Architecture: $(uname -m)" > ${output} | ||
| 20 | echo "Image: $(uname -sr)" >> ${output} | ||
| 21 | ${TIME} -f 'Execution time: %e s' bash -c "testCheck runtests -vv" |& tee -a ${output} | ||
| 22 | ${TIME} -f 'Execution time: %e s' bash -c "testCheck runtestspp -vv" |& tee -a ${output} | ||
| 23 | echo | ||
diff --git a/meta/recipes-core/expat/expat_2.2.9.bb b/meta/recipes-core/expat/expat_2.2.9.bb index 8f3db41352..f477f99baf 100644 --- a/meta/recipes-core/expat/expat_2.2.9.bb +++ b/meta/recipes-core/expat/expat_2.2.9.bb | |||
| @@ -8,15 +8,21 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=5b8620d98e49772d95fc1d291c26aa79" | |||
| 8 | 8 | ||
| 9 | SRC_URI = "${SOURCEFORGE_MIRROR}/expat/expat-${PV}.tar.bz2 \ | 9 | SRC_URI = "${SOURCEFORGE_MIRROR}/expat/expat-${PV}.tar.bz2 \ |
| 10 | file://libtool-tag.patch \ | 10 | file://libtool-tag.patch \ |
| 11 | file://run-ptest \ | ||
| 12 | file://0001-Add-output-of-tests-result.patch \ | ||
| 11 | " | 13 | " |
| 12 | 14 | ||
| 13 | SRC_URI[md5sum] = "875a2c2ff3e8eb9e5a5cd62db2033ab5" | 15 | SRC_URI[md5sum] = "875a2c2ff3e8eb9e5a5cd62db2033ab5" |
| 14 | SRC_URI[sha256sum] = "f1063084dc4302a427dabcca499c8312b3a32a29b7d2506653ecc8f950a9a237" | 16 | SRC_URI[sha256sum] = "f1063084dc4302a427dabcca499c8312b3a32a29b7d2506653ecc8f950a9a237" |
| 15 | 17 | ||
| 16 | inherit autotools lib_package | 18 | EXTRA_OECMAKE_class-native += "-DEXPAT_BUILD_DOCS=OFF" |
| 17 | 19 | ||
| 18 | do_configure_prepend () { | 20 | RDEPENDS_${PN}-ptest += "bash" |
| 19 | rm -f ${S}/conftools/libtool.m4 | 21 | |
| 22 | inherit cmake lib_package ptest | ||
| 23 | |||
| 24 | do_install_ptest_class-target() { | ||
| 25 | install -m 755 ${B}/tests/* ${D}${PTEST_PATH} | ||
| 20 | } | 26 | } |
| 21 | 27 | ||
| 22 | BBCLASSEXTEND = "native nativesdk" | 28 | BBCLASSEXTEND += "native nativesdk" |
diff --git a/meta/recipes-devtools/cmake/cmake-native_3.17.3.bb b/meta/recipes-devtools/cmake/cmake-native_3.17.3.bb index b2952ee5f5..d91e42ef9a 100644 --- a/meta/recipes-devtools/cmake/cmake-native_3.17.3.bb +++ b/meta/recipes-devtools/cmake/cmake-native_3.17.3.bb | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | require cmake.inc | 1 | require cmake.inc |
| 2 | inherit native | 2 | inherit native |
| 3 | 3 | ||
| 4 | DEPENDS += "bzip2-replacement-native expat-native xz-native zlib-native curl-native ncurses-native" | 4 | DEPENDS += "bzip2-replacement-native xz-native zlib-native curl-native ncurses-native" |
| 5 | 5 | ||
| 6 | SRC_URI += "file://OEToolchainConfig.cmake \ | 6 | SRC_URI += "file://OEToolchainConfig.cmake \ |
| 7 | file://environment.d-cmake.sh \ | 7 | file://environment.d-cmake.sh \ |
| @@ -21,6 +21,7 @@ CMAKE_EXTRACONF = "\ | |||
| 21 | -DCMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE=0 \ | 21 | -DCMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE=0 \ |
| 22 | -DCMAKE_USE_SYSTEM_LIBRARY_LIBUV=0 \ | 22 | -DCMAKE_USE_SYSTEM_LIBRARY_LIBUV=0 \ |
| 23 | -DCMAKE_USE_SYSTEM_LIBRARY_LIBRHASH=0 \ | 23 | -DCMAKE_USE_SYSTEM_LIBRARY_LIBRHASH=0 \ |
| 24 | -DCMAKE_USE_SYSTEM_LIBRARY_EXPAT=0 \ | ||
| 24 | -DENABLE_ACL=0 -DHAVE_ACL_LIBACL_H=0 \ | 25 | -DENABLE_ACL=0 -DHAVE_ACL_LIBACL_H=0 \ |
| 25 | -DHAVE_SYS_ACL_H=0 \ | 26 | -DHAVE_SYS_ACL_H=0 \ |
| 26 | " | 27 | " |
