summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/expat/expat
diff options
context:
space:
mode:
authorOleksandr <oleksandr.s.popovych@globallogic.com>2020-07-20 19:54:42 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-07-22 12:45:52 +0100
commit3adba877e1b5e5f69a6d1501611624e2d3789a9b (patch)
tree69b30ea85455c63245a66952955889e52b763330 /meta/recipes-core/expat/expat
parentf284c5b2df220b520b025a59874e04ef4becd829 (diff)
downloadopenembedded-core-3adba877e1b5e5f69a6d1501611624e2d3789a9b.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. Signed-off-by: Oleksandr Popovych <oleksandr.s.popovych@globallogic.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/expat/expat')
-rw-r--r--meta/recipes-core/expat/expat/0001-Add-output-of-tests-result.patch83
-rw-r--r--meta/recipes-core/expat/expat/run-ptest23
2 files changed, 106 insertions, 0 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 @@
+From aa84835a00bfd65e784d58411e76f60658e939dc Mon Sep 17 00:00:00 2001
+From: Oleksandr Popovych <oleksandr.s.popovych@globallogic.com>
+Date: Tue, 18 Feb 2020 19:04:55 +0200
+Subject: [PATCH] Add output of tests result
+
+Added console output of testing results in form 'RESULT: TEST_NAME'.
+
+Changed verbose mode of test application set by '-v' ('--verbose')
+argument to CK_NORMAL.
+Added new supported argument '-vv' ('--extra-verbose') that changes
+verbose mode of test application to CK_VERBOSE. Results of each test
+are shown in output only if this mode is set.
+
+Upstream-Status: Denied
+
+This patch changes potentially deprecated feature that shoud be changed
+in upstream. [https://github.com/libexpat/libexpat/issues/382]
+
+Signed-off-by: Oleksandr Popovych <oleksandr.s.popovych@globallogic.com>
+---
+ tests/minicheck.c | 10 +++++++++-
+ tests/runtests.c | 4 +++-
+ 2 files changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/expat/tests/minicheck.c b/expat/tests/minicheck.c
+index a5a1efb..94fa412 100644
+--- a/tests/minicheck.c
++++ b/tests/minicheck.c
+@@ -164,6 +164,8 @@ srunner_run_all(SRunner *runner, int verbosity) {
+ if (tc->setup != NULL) {
+ /* setup */
+ if (setjmp(env)) {
++ if (verbosity >= CK_VERBOSE)
++ printf("SKIP: %s\n", _check_current_function);
+ add_failure(runner, verbosity);
+ continue;
+ }
+@@ -171,6 +173,8 @@ srunner_run_all(SRunner *runner, int verbosity) {
+ }
+ /* test */
+ if (setjmp(env)) {
++ if (verbosity >= CK_VERBOSE)
++ printf("FAIL: %s\n", _check_current_function);
+ add_failure(runner, verbosity);
+ continue;
+ }
+@@ -178,12 +182,16 @@ srunner_run_all(SRunner *runner, int verbosity) {
+
+ /* teardown */
+ if (tc->teardown != NULL) {
+- if (setjmp(env)) {
++ if (setjmp(env)) {
++ if (verbosity >= CK_VERBOSE)
++ printf("PASS: %s\n", _check_current_function);
+ add_failure(runner, verbosity);
+ continue;
+ }
+ tc->teardown();
+ }
++ if (verbosity >= CK_VERBOSE)
++ printf("PASS: %s\n", _check_current_function);
+ }
+ tc = tc->next_tcase;
+ }
+diff --git a/tests/runtests.c b/expat/tests/runtests.c
+index 7791fe0..75724e5 100644
+--- a/tests/runtests.c
++++ b/tests/runtests.c
+@@ -11619,9 +11619,11 @@ main(int argc, char *argv[]) {
+ for (i = 1; i < argc; ++i) {
+ char *opt = argv[i];
+ if (strcmp(opt, "-v") == 0 || strcmp(opt, "--verbose") == 0)
+- verbosity = CK_VERBOSE;
++ verbosity = CK_NORMAL;
+ else if (strcmp(opt, "-q") == 0 || strcmp(opt, "--quiet") == 0)
+ verbosity = CK_SILENT;
++ else if (strcmp(opt, "-vv") == 0 || strcmp(opt, "--extra-verbose") == 0)
++ verbosity = CK_VERBOSE;
+ else {
+ fprintf(stderr, "runtests: unknown option '%s'\n", opt);
+ return 2;
+--
+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 @@
+#!/bin/bash
+
+output=${1:-"expat_tests.log"} # default log file
+
+# logging function
+function testCheck() {
+ testExec="$1"
+ shift
+ echo && echo ${testExec} && ./${testExec} "$@"
+ error=$?
+ result=$([[ ${error} -eq 0 ]] && echo "PASS" || echo "FAIL")
+ echo "${result}: ${testExec}" && echo "============================"
+}
+
+export output
+export -f testCheck
+TIME=$(which time)
+
+echo "Architecture: $(uname -m)" > ${output}
+echo "Image: $(uname -sr)" >> ${output}
+${TIME} -f 'Execution time: %e s' bash -c "testCheck runtests -vv" |& tee -a ${output}
+${TIME} -f 'Execution time: %e s' bash -c "testCheck runtestspp -vv" |& tee -a ${output}
+echo