HI Alex

>// Did you use kvm? 21 minutes looks excessive, and I'm not sure we want to 
>lengthen the ptest by this much. libgit2 is not at the core of the typical 
>linux stack.

I have tested libgit2 on a intel board with "Intel(R) Genuine Intel(R) CPU", 
not KVM. It took so much time because that it has 2885 testcases. 

>// The added patch needs a better commit message. What does it add or change 
>and why? Why is it inappropriate for upstream submission?

An absolute path (CLAR_FIXTURES)is defined as specifying the location of the 
resource files. The CLAR_FIXTURES is set at compile time.  
The test binary will try to load the files from the absolute patch which does 
not exist on target board and  it  yields a lot of errors about "No such file 
or directory. " 
So I  have to change CLAR_FIXTURES to PTEST path (/usr/lib/libgit2/ptest/). 


Thanks,
haitao

-----Original Message-----
From: Alexander Kanavin <[email protected]> 
Sent: Monday, February 6, 2023 4:49 PM
To: Liu, Haitao <[email protected]>
Cc: [email protected]
Subject: Re: [OE-core][PATCH] libgit: add ptest for libgit2

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know 
the content is safe.

Did you use kvm? 21 minutes looks excessive, and I'm not sure we want to 
lengthen the ptest by this much. libgit2 is not at the core of the typical 
linux stack.

The added patch needs a better commit message. What does it add or change and 
why? Why is it inappropriate for upstream submission?

Alex

On Mon, 6 Feb 2023 at 09:44, jason.lau <[email protected]> wrote:
>
> Add ptest for libgit2.
> ALl test passed on a trial run and it took around 21m56s to execute so 
> added curl-ptest to PTESTS_SLOW.
>
> Signed-off-by: Liu Haitao <[email protected]>
> ---
>  .../distro/include/ptest-packagelists.inc     |  1 +
>  ...ests-add-CLAR_FIXTURES_DIR-for-ptest.patch | 54 
> +++++++++++++++++++  .../recipes-support/libgit2/libgit2/run-ptest |  
> 7 +++  meta/recipes-support/libgit2/libgit2_1.5.0.bb | 18 ++++++-
>  4 files changed, 78 insertions(+), 2 deletions(-)  create mode 100644 
> meta/recipes-support/libgit2/libgit2/0001-tests-add-CLAR_FIXTURES_DIR-
> for-ptest.patch  create mode 100644 
> meta/recipes-support/libgit2/libgit2/run-ptest
>
> diff --git a/meta/conf/distro/include/ptest-packagelists.inc 
> b/meta/conf/distro/include/ptest-packagelists.inc
> index 5422ecd378..9b88b58070 100644
> --- a/meta/conf/distro/include/ptest-packagelists.inc
> +++ b/meta/conf/distro/include/ptest-packagelists.inc
> @@ -104,6 +104,7 @@ PTESTS_SLOW = "\
>      tcl-ptest \
>      util-linux-ptest \
>      valgrind-ptest \
> +    libgit2-ptest \
>  "
>
>  PTESTS_SLOW:remove:riscv64 = "valgrind-ptest"
> diff --git 
> a/meta/recipes-support/libgit2/libgit2/0001-tests-add-CLAR_FIXTURES_DI
> R-for-ptest.patch 
> b/meta/recipes-support/libgit2/libgit2/0001-tests-add-CLAR_FIXTURES_DI
> R-for-ptest.patch
> new file mode 100644
> index 0000000000..f547d29e8a
> --- /dev/null
> +++ b/meta/recipes-support/libgit2/libgit2/0001-tests-add-CLAR_FIXTURE
> +++ S_DIR-for-ptest.patch
> @@ -0,0 +1,54 @@
> +From 7ae59e785260bb820cf1449da84140f8ae613e9f Mon Sep 17 00:00:00 
> +2001
> +From: Liu Haitao <[email protected]>
> +Date: Mon, 6 Feb 2023 06:40:20 +0200
> +Subject: [PATCH] tests: add CLAR_FIXTURES_DIR for ptest
> +
> +Upstream-Status: Inappropriate [yocto specific]
> +
> +Signed-off-by: Liu Haitao <[email protected]>
> +---
> + tests/libgit2/CMakeLists.txt | 8 +++++++-
> + tests/util/CMakeLists.txt    | 8 +++++++-
> + 2 files changed, 14 insertions(+), 2 deletions(-)
> +
> +diff --git a/tests/libgit2/CMakeLists.txt 
> +b/tests/libgit2/CMakeLists.txt index 27f421ad6..e1a95a610 100644
> +--- a/tests/libgit2/CMakeLists.txt
> ++++ b/tests/libgit2/CMakeLists.txt
> +@@ -9,7 +9,13 @@ if(NOT PYTHONINTERP_FOUND)
> + ENDIF()
> +
> + set(CLAR_PATH "${PROJECT_SOURCE_DIR}/tests/clar")
> +-set(CLAR_FIXTURES "${PROJECT_SOURCE_DIR}/tests/resources/")
> ++
> ++IF (CLAR_FIXTURES_DIR)
> ++      SET(CLAR_FIXTURES "${CLAR_FIXTURES_DIR}/resources/")
> ++ELSE()
> ++      set(CLAR_FIXTURES "${PROJECT_SOURCE_DIR}/tests/resources/")
> ++ENDIF()
> ++
> + set(TEST_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
> + add_definitions(-DCLAR_FIXTURE_PATH=\"${CLAR_FIXTURES}\")
> + add_definitions(-DCLAR_TMPDIR=\"libgit2_tests\")
> +diff --git a/tests/util/CMakeLists.txt b/tests/util/CMakeLists.txt 
> +index 232590ffd..c736bb3bb 100644
> +--- a/tests/util/CMakeLists.txt
> ++++ b/tests/util/CMakeLists.txt
> +@@ -9,7 +9,13 @@ if(NOT PYTHONINTERP_FOUND)
> + ENDIF()
> +
> + set(CLAR_PATH "${libgit2_SOURCE_DIR}/tests/clar")
> +-set(CLAR_FIXTURES "${libgit2_SOURCE_DIR}/tests/resources/")
> ++
> ++IF (CLAR_FIXTURES_DIR)
> ++      SET(CLAR_FIXTURES "${CLAR_FIXTURES_DIR}/resources/")
> ++ELSE()
> ++      set(CLAR_FIXTURES "${libgit2_SOURCE_DIR}/tests/resources/")
> ++ENDIF()
> ++
> + set(TEST_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
> + add_definitions(-DCLAR_FIXTURE_PATH=\"${CLAR_FIXTURES}\")
> + add_definitions(-DCLAR_TMPDIR=\"libgit2_tests\")
> +--
> +2.39.1
> +
> diff --git a/meta/recipes-support/libgit2/libgit2/run-ptest 
> b/meta/recipes-support/libgit2/libgit2/run-ptest
> new file mode 100644
> index 0000000000..66e0392af6
> --- /dev/null
> +++ b/meta/recipes-support/libgit2/libgit2/run-ptest
> @@ -0,0 +1,7 @@
> +#!/bin/sh
> +
> +cd tests
> +
> +export CLAR_SUMMARY="${PWD}/results.xml"
> +
> +./libgit2_tests -t | sed -e 's|ok .* - # SKIP|SKIP:|' -e 's|not ok .* 
> -|FAIL:|'  -e 's|ok .* -|PASS:|'
> diff --git a/meta/recipes-support/libgit2/libgit2_1.5.0.bb 
> b/meta/recipes-support/libgit2/libgit2_1.5.0.bb
> index ee4d79b11a..aca8b94551 100644
> --- a/meta/recipes-support/libgit2/libgit2_1.5.0.bb
> +++ b/meta/recipes-support/libgit2/libgit2_1.5.0.bb
> @@ -5,12 +5,15 @@ LIC_FILES_CHKSUM = 
> "file://COPYING;md5=112e6bb421dea73cd41de09e777f2d2c"
>
>  DEPENDS = "curl openssl zlib libssh2 libgcrypt libpcre2"
>
> -SRC_URI = "git://github.com/libgit2/libgit2.git;branch=main;protocol=https"
> +SRC_URI = "git://github.com/libgit2/libgit2.git;branch=main;protocol=https \
> +           file://0001-tests-add-CLAR_FIXTURES_DIR-for-ptest.patch \
> +           file://run-ptest \
> +          "
>  SRCREV = "fbea439d4b6fc91c6b619d01b85ab3b7746e4c19"
>
>  S = "${WORKDIR}/git"
>
> -inherit cmake
> +inherit cmake ptest
>
>  EXTRA_OECMAKE = "\
>      -DBUILD_CLAR=OFF \
> @@ -19,4 +22,15 @@ EXTRA_OECMAKE = "\
>      -DREGEX_BACKEND='pcre2' \
>  "
>
> +EXTRA_OECMAKE_PTEST = " -DBUILD_CLAR=ON -DVALGRIND=ON 
> -DCLAR_FIXTURES_DIR=${PTEST_PATH}/tests "
> +
> +EXTRA_OECMAKE += "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 
> '${EXTRA_OECMAKE_PTEST}', '', d)} "
> +
> +do_install_ptest(){
> +        install -d ${D}${PTEST_PATH}/tests/
> +        install ${B}/libgit2_tests ${D}${PTEST_PATH}/tests/
> +        cp ${S}/tests/resources/ ${D}${PTEST_PATH}/tests/ -rf }
> +
> +
>  BBCLASSEXTEND = "native"
> --
> 2.39.0
>
>
> 
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#176790): 
https://lists.openembedded.org/g/openembedded-core/message/176790
Mute This Topic: https://lists.openembedded.org/mt/96779266/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to