All of lore.kernel.org
 help / color / mirror / Atom feed
* [OE-core][PATCH v8] expat: Added ptest
@ 2020-04-30 16:55 Oleksandr
  2020-05-11 12:45 ` Richard Purdie
  0 siblings, 1 reply; 5+ messages in thread
From: Oleksandr @ 2020-04-30 16:55 UTC (permalink / raw)
  To: openembedded-core; +Cc: Oleksandr Popovych

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.16.5.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 .../meta/recipes-devtools/cmake/cmake-native_3.16.1.bb:do_compile (dependent Tasks ['cmake-native_3.16.1.bb:do_configure'])
          Task .../meta/recipes-devtools/cmake/cmake-native_3.16.1.bb:do_install (dependent Tasks ['cmake-native_3.16.1.bb:do_compile'])
          Task .../meta/recipes-devtools/cmake/cmake-native_3.16.1.bb:do_populate_sysroot (dependent Tasks ['cmake-native_3.16.1.bb:do_install'])
          Task virtual:native:.../meta/recipes-core/expat/expat_2.2.9.bb:do_prepare_recipe_sysroot (dependent Tasks ['ninja_1.10.0.bb:do_populate_sysroot', 'cmake-native_3.16.1.bb:do_populate_sysroot', 'expat_2.2.9.bb:do_fetch'])
          Task virtual:native:.../meta/recipes-core/expat/expat_2.2.9.bb:do_configure (dependent Tasks ['expat_2.2.9.bb:do_prepare_recipe_sysroot', 'expat_2.2.9.bb:do_deploy_source_date_epoch', 'expat_2.2.9.bb:do_generate_toolchain_file', 'expat_2.2.9.bb:do_patch'])
          Task virtual:native:.../meta/recipes-core/expat/expat_2.2.9.bb:do_compile (dependent Tasks ['expat_2.2.9.bb:do_configure'])
          Task virtual:native:.../meta/recipes-core/expat/expat_2.2.9.bb:do_install (dependent Tasks ['expat_2.2.9.bb:do_compile'])
          Task virtual:native:.../meta/recipes-core/expat/expat_2.2.9.bb:do_populate_sysroot (dependent Tasks ['expat_2.2.9.bb:do_install'])
          Task .../meta/recipes-devtools/cmake/cmake-native_3.16.1.bb:do_prepare_recipe_sysroot (dependent Tasks ['expat_2.2.9.bb:do_populate_sysroot', 'zlib_1.2.11.bb:do_populate_sysroot', 'bzip2_1.0.8.bb:do_populate_sysroot', 'xz_5.2.4.bb:do_populate_sysroot', 'ncurses_6.2.bb:do_populate_sysroot', 'curl_7.69.0.bb:do_populate_sysroot', 'cmake-native_3.16.1.bb:do_fetch'])
          Task .../meta/recipes-devtools/cmake/cmake-native_3.16.1.bb:do_configure (dependent Tasks ['cmake-native_3.16.1.bb:do_deploy_source_date_epoch', 'cmake-native_3.16.1.bb:do_patch', 'cmake-native_3.16.1.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>
---
 .../0001-Add-output-of-tests-result.patch     | 84 +++++++++++++++++++
 meta/recipes-core/expat/expat/run-ptest       | 24 ++++++
 meta/recipes-core/expat/expat_2.2.9.bb        | 14 +++-
 .../cmake/cmake-native_3.16.5.bb              |  3 +-
 4 files changed, 120 insertions(+), 5 deletions(-)
 create mode 100644 meta/recipes-core/expat/expat/0001-Add-output-of-tests-result.patch
 create mode 100644 meta/recipes-core/expat/expat/run-ptest

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..c78fd2bbef
--- /dev/null
+++ b/meta/recipes-core/expat/expat/0001-Add-output-of-tests-result.patch
@@ -0,0 +1,84 @@
+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..7bc81eba8a
--- /dev/null
+++ b/meta/recipes-core/expat/expat/run-ptest
@@ -0,0 +1,24 @@
+#!/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
+
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"
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/expat/expat-${PV}.tar.bz2 \
            file://libtool-tag.patch \
+	   file://run-ptest \
+	   file://0001-Add-output-of-tests-result.patch \
 	  "
 
 SRC_URI[md5sum] = "875a2c2ff3e8eb9e5a5cd62db2033ab5"
 SRC_URI[sha256sum] = "f1063084dc4302a427dabcca499c8312b3a32a29b7d2506653ecc8f950a9a237"
 
-inherit autotools lib_package
+EXTRA_OECMAKE_class-native += "-DEXPAT_BUILD_DOCS=OFF"
 
-do_configure_prepend () {
-	rm -f ${S}/conftools/libtool.m4
+RDEPENDS_${PN}-ptest += "bash"
+
+inherit cmake lib_package ptest
+
+do_install_ptest_class-target() {
+	install -m 755 ${B}/tests/* ${D}${PTEST_PATH}
 }
 
-BBCLASSEXTEND = "native nativesdk"
+BBCLASSEXTEND += "native nativesdk"
diff --git a/meta/recipes-devtools/cmake/cmake-native_3.16.5.bb b/meta/recipes-devtools/cmake/cmake-native_3.16.5.bb
index b2952ee5f5..d91e42ef9a 100644
--- a/meta/recipes-devtools/cmake/cmake-native_3.16.5.bb
+++ b/meta/recipes-devtools/cmake/cmake-native_3.16.5.bb
@@ -1,7 +1,7 @@
 require cmake.inc
 inherit native
 
-DEPENDS += "bzip2-replacement-native expat-native xz-native zlib-native curl-native ncurses-native"
+DEPENDS += "bzip2-replacement-native xz-native zlib-native curl-native ncurses-native"
 
 SRC_URI += "file://OEToolchainConfig.cmake \
             file://environment.d-cmake.sh \
@@ -21,6 +21,7 @@ CMAKE_EXTRACONF = "\
     -DCMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE=0 \
     -DCMAKE_USE_SYSTEM_LIBRARY_LIBUV=0 \
     -DCMAKE_USE_SYSTEM_LIBRARY_LIBRHASH=0 \
+    -DCMAKE_USE_SYSTEM_LIBRARY_EXPAT=0 \
     -DENABLE_ACL=0 -DHAVE_ACL_LIBACL_H=0 \
     -DHAVE_SYS_ACL_H=0 \
 "
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [OE-core][PATCH v8] expat: Added ptest
  2020-04-30 16:55 [OE-core][PATCH v8] expat: Added ptest Oleksandr
@ 2020-05-11 12:45 ` Richard Purdie
  2020-06-03 12:48   ` Oleksandr
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Purdie @ 2020-05-11 12:45 UTC (permalink / raw)
  To: openembedded-core, Joshua Watt; +Cc: Oleksandr Popovych

On Thu, 2020-04-30 at 19:55 +0300, Oleksandr via lists.openembedded.org
wrote:
> 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).
> 

Thanks, this is definitely getting there. There was only one test
failure this time, with meta-mingw:

https://autobuilder.yoctoproject.org/typhoon/#/builders/89/builds/1884

I've cc'd Joshua in case he has any insights on this.

Cheers,

Richard




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core][PATCH v8] expat: Added ptest
  2020-05-11 12:45 ` Richard Purdie
@ 2020-06-03 12:48   ` Oleksandr
  2020-07-15 16:54     ` Randy MacLeod
  0 siblings, 1 reply; 5+ messages in thread
From: Oleksandr @ 2020-06-03 12:48 UTC (permalink / raw)
  To: Richard Purdie; +Cc: openembedded-core, Joshua Watt

Hello Richard, Joshua,

On Mon, May 11, 2020 at 3:45 PM Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
>
> ...
>
> Thanks, this is definitely getting there. There was only one test
> failure this time, with meta-mingw:
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/89/builds/1884
>
> I've cc'd Joshua in case he has any insights on this.

I`ve tested my patch with meta-mingw layer on my host and it seems I
have fixed the current compilation error, with making some changes to
meta-mingw (by changing "CMAKE_SYSTEM_NAME" variable to "Windows"
value during toolchain file generation in
"recipes-core/expat/expat_%.bbappend" file using a
"recipes-devtools/cmake/cmake_%.bbappend" file as template). However
this is only part of a solution, because another error appears next to
it: gdb-cross-canadian that depends on expat now fails to build,
because it can not find a proper expat library. It seems that expat
recipe, which was switched to build with CMake in my patch, does not
generate output library in proper format (it compiles only
"libexpat.dll.a", when the current version of expat recipe from
upstream, that uses Autotools, generates both "libexpat.a" and
"libexpat.dll.a"). This is such an error that I can not figure out how
to solve it by myself, so I ask for help.

Additionally I would like to ask you: How should I send patches now
when at least two separate patches with similar purposes should be
sent to different layers (one for [OE-core] and other for
[meta-mingw])? Should they be connected with some kind of cover-letter
or is there another option?

Thanks for your attention.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core][PATCH v8] expat: Added ptest
  2020-06-03 12:48   ` Oleksandr
@ 2020-07-15 16:54     ` Randy MacLeod
  2020-07-15 19:57       ` Joshua Watt
  0 siblings, 1 reply; 5+ messages in thread
From: Randy MacLeod @ 2020-07-15 16:54 UTC (permalink / raw)
  To: oleksandr.s.popovych, Richard Purdie; +Cc: openembedded-core, Joshua Watt

On 2020-06-03 8:48 a.m., Oleksandr via lists.openembedded.org wrote:
> Hello Richard, Joshua,
> 
> On Mon, May 11, 2020 at 3:45 PM Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
>>
>> ...
>>
>> Thanks, this is definitely getting there. There was only one test
>> failure this time, with meta-mingw:
>>
>> https://autobuilder.yoctoproject.org/typhoon/#/builders/89/builds/1884
>>
>> I've cc'd Joshua in case he has any insights on this.
> 
> I`ve tested my patch with meta-mingw layer on my host and it seems I
> have fixed the current compilation error, with making some changes to
> meta-mingw (by changing "CMAKE_SYSTEM_NAME" variable to "Windows"
> value during toolchain file generation in
> "recipes-core/expat/expat_%.bbappend" file using a
> "recipes-devtools/cmake/cmake_%.bbappend" file as template). However
> this is only part of a solution, because another error appears next to
> it: gdb-cross-canadian that depends on expat now fails to build,
> because it can not find a proper expat library. It seems that expat
> recipe, which was switched to build with CMake in my patch, does not
> generate output library in proper format (it compiles only
> "libexpat.dll.a", when the current version of expat recipe from
> upstream, that uses Autotools, generates both "libexpat.a" and
> "libexpat.dll.a"). This is such an error that I can not figure out how
> to solve it by myself, so I ask for help.

When I was cleaning up my inbox, I noticed this thread had gone idle.

Ugh, I have no idea about Windows, Joshua any ideas?

> 
> Additionally I would like to ask you: How should I send patches now
> when at least two separate patches with similar purposes should be
> sent to different layers (one for [OE-core] and other for
> [meta-mingw])? Should they be connected with some kind of cover-letter
> or is there another option?

I think that if you just CC the maintainers and mention the dependency
in the commit log or wrapper email, then things will work out.

Thanks for continuing to work on this Oleksandr.
Hopefully v9 will work well and be merged.

../Randy

> 
> Thanks for your attention.
> 
> 
> 
> 


-- 
# Randy MacLeod
# Wind River Linux

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core][PATCH v8] expat: Added ptest
  2020-07-15 16:54     ` Randy MacLeod
@ 2020-07-15 19:57       ` Joshua Watt
  0 siblings, 0 replies; 5+ messages in thread
From: Joshua Watt @ 2020-07-15 19:57 UTC (permalink / raw)
  To: Randy MacLeod, oleksandr.s.popovych, Richard Purdie
  Cc: openembedded-core, Joshua Watt


On 7/15/20 11:54 AM, Randy MacLeod wrote:
> On 2020-06-03 8:48 a.m., Oleksandr via lists.openembedded.org wrote:
>> Hello Richard, Joshua,
>>
>> On Mon, May 11, 2020 at 3:45 PM Richard Purdie
>> <richard.purdie@linuxfoundation.org> wrote:
>>>
>>> ...
>>>
>>> Thanks, this is definitely getting there. There was only one test
>>> failure this time, with meta-mingw:
>>>
>>> https://autobuilder.yoctoproject.org/typhoon/#/builders/89/builds/1884
>>>
>>> I've cc'd Joshua in case he has any insights on this.
>>
>> I`ve tested my patch with meta-mingw layer on my host and it seems I
>> have fixed the current compilation error, with making some changes to
>> meta-mingw (by changing "CMAKE_SYSTEM_NAME" variable to "Windows"
>> value during toolchain file generation in
>> "recipes-core/expat/expat_%.bbappend" file using a
>> "recipes-devtools/cmake/cmake_%.bbappend" file as template). However
>> this is only part of a solution, because another error appears next to
>> it: gdb-cross-canadian that depends on expat now fails to build,
>> because it can not find a proper expat library. It seems that expat
>> recipe, which was switched to build with CMake in my patch, does not
>> generate output library in proper format (it compiles only
>> "libexpat.dll.a", when the current version of expat recipe from
>> upstream, that uses Autotools, generates both "libexpat.a" and
>> "libexpat.dll.a"). This is such an error that I can not figure out how
>> to solve it by myself, so I ask for help.
>
> When I was cleaning up my inbox, I noticed this thread had gone idle.
>
> Ugh, I have no idea about Windows, Joshua any ideas?

I don't have any idea either. If you can post a patch to the meta-mingw 
mailing list (yocto@lists.yoctoproject.org with [meta-mingw] in the 
subject), it might help provided a little more context.

>
>>
>> Additionally I would like to ask you: How should I send patches now
>> when at least two separate patches with similar purposes should be
>> sent to different layers (one for [OE-core] and other for
>> [meta-mingw])? Should they be connected with some kind of cover-letter
>> or is there another option?
>
> I think that if you just CC the maintainers and mention the dependency
> in the commit log or wrapper email, then things will work out.
>
> Thanks for continuing to work on this Oleksandr.
> Hopefully v9 will work well and be merged.
>
> ../Randy
>
>>
>> Thanks for your attention.
>>
>>
>> 
>>
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-07-15 19:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-30 16:55 [OE-core][PATCH v8] expat: Added ptest Oleksandr
2020-05-11 12:45 ` Richard Purdie
2020-06-03 12:48   ` Oleksandr
2020-07-15 16:54     ` Randy MacLeod
2020-07-15 19:57       ` Joshua Watt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.