diff options
5 files changed, 101 insertions, 2 deletions
diff --git a/meta-oe/conf/include/ptest-packagelists-meta-oe.inc b/meta-oe/conf/include/ptest-packagelists-meta-oe.inc index ea336f1058..0473b60504 100644 --- a/meta-oe/conf/include/ptest-packagelists-meta-oe.inc +++ b/meta-oe/conf/include/ptest-packagelists-meta-oe.inc | |||
| @@ -13,6 +13,7 @@ PTESTS_FAST_META_OE = "\ | |||
| 13 | cmocka \ | 13 | cmocka \ |
| 14 | cunit \ | 14 | cunit \ |
| 15 | duktape \ | 15 | duktape \ |
| 16 | exiv2 \ | ||
| 16 | fuse3 \ | 17 | fuse3 \ |
| 17 | function2 \ | 18 | function2 \ |
| 18 | fwupd \ | 19 | fwupd \ |
diff --git a/meta-oe/recipes-support/exiv2/exiv2/0001-Allow-test-data-path-configuration.patch b/meta-oe/recipes-support/exiv2/exiv2/0001-Allow-test-data-path-configuration.patch new file mode 100644 index 0000000000..a5345733fb --- /dev/null +++ b/meta-oe/recipes-support/exiv2/exiv2/0001-Allow-test-data-path-configuration.patch | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | From 2483e51df6e02ad0ad5ae636767279fa230da44f Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Gyorgy Sarvari <skandigraun@gmail.com> | ||
| 3 | Date: Sun, 23 Nov 2025 11:52:24 +0100 | ||
| 4 | Subject: [PATCH] Allow test data path configuration | ||
| 5 | |||
| 6 | The unittests expect to the executed in the source folder before/after build, | ||
| 7 | and they expect the test data to be in the source folder. However for ptests | ||
| 8 | these folders are not available. | ||
| 9 | |||
| 10 | This patch allows the test data folders to be configuration during build time. | ||
| 11 | |||
| 12 | Upstream-Status: Inappropriate [ptest-specific] | ||
| 13 | Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> | ||
| 14 | --- | ||
| 15 | unitTests/CMakeLists.txt | 2 +- | ||
| 16 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 17 | |||
| 18 | diff --git a/unitTests/CMakeLists.txt b/unitTests/CMakeLists.txt | ||
| 19 | index 51040c0e2..e2604d4a7 100644 | ||
| 20 | --- a/unitTests/CMakeLists.txt | ||
| 21 | +++ b/unitTests/CMakeLists.txt | ||
| 22 | @@ -42,7 +42,7 @@ add_executable(unit_tests | ||
| 23 | target_compile_definitions(unit_tests | ||
| 24 | PRIVATE | ||
| 25 | exiv2lib_STATIC | ||
| 26 | - TESTDATA_PATH="${PROJECT_SOURCE_DIR}/test/data" | ||
| 27 | + TESTDATA_PATH="${TEST_FOLDER}/test/data" | ||
| 28 | ) | ||
| 29 | |||
| 30 | target_link_libraries(unit_tests | ||
diff --git a/meta-oe/recipes-support/exiv2/exiv2/0001-Use-automake-output-for-tests.patch b/meta-oe/recipes-support/exiv2/exiv2/0001-Use-automake-output-for-tests.patch new file mode 100644 index 0000000000..6514ac07a3 --- /dev/null +++ b/meta-oe/recipes-support/exiv2/exiv2/0001-Use-automake-output-for-tests.patch | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | From 09e5f783b3d1dcb7db6e975e9662c8401a614539 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Gyorgy Sarvari <skandigraun@gmail.com> | ||
| 3 | Date: Sun, 23 Nov 2025 11:35:50 +0100 | ||
| 4 | Subject: [PATCH] Use automake output for tests | ||
| 5 | |||
| 6 | Convert the Python unittest output to automake output so ptest can | ||
| 7 | ingest it. | ||
| 8 | |||
| 9 | Upstream-Status: Inappropriate [oe-specific] | ||
| 10 | Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> | ||
| 11 | --- | ||
| 12 | tests/runner.py | 3 ++- | ||
| 13 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
| 14 | |||
| 15 | diff --git a/tests/runner.py b/tests/runner.py | ||
| 16 | index adebf83ba..9800cf971 100755 | ||
| 17 | --- a/tests/runner.py | ||
| 18 | +++ b/tests/runner.py | ||
| 19 | @@ -4,6 +4,7 @@ | ||
| 20 | import argparse | ||
| 21 | import functools | ||
| 22 | import os | ||
| 23 | +import putao.unittest | ||
| 24 | import sys | ||
| 25 | import unittest | ||
| 26 | from fnmatch import fnmatchcase | ||
| 27 | @@ -93,7 +94,7 @@ if __name__ == '__main__': | ||
| 28 | DEFAULT_ROOT | ||
| 29 | ) | ||
| 30 | |||
| 31 | - test_res = unittest.runner.TextTestRunner(verbosity=args.verbose)\ | ||
| 32 | + test_res = putao.unittest.TestRunner()\ | ||
| 33 | .run(discovered_tests) | ||
| 34 | |||
| 35 | sys.exit(0 if len(test_res.failures) + len(test_res.errors) == 0 else 1) | ||
diff --git a/meta-oe/recipes-support/exiv2/exiv2/run-ptest b/meta-oe/recipes-support/exiv2/exiv2/run-ptest new file mode 100644 index 0000000000..6c50a12fc1 --- /dev/null +++ b/meta-oe/recipes-support/exiv2/exiv2/run-ptest | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | cd tests | ||
| 3 | python3 ./runner.py | ||
| 4 | |||
| 5 | cd .. | ||
| 6 | ./build/bin/unit_tests --gtest_print_time=0 | sed -E '/^\[ RUN/d ; s/\[ OK \]/PASS: / ; s/\[ DISABLED \]/SKIP: / ; s/\[ FAILED \]/FAIL: /' | ||
diff --git a/meta-oe/recipes-support/exiv2/exiv2_0.28.7.bb b/meta-oe/recipes-support/exiv2/exiv2_0.28.7.bb index e1f57ae8c7..82ee232fdc 100644 --- a/meta-oe/recipes-support/exiv2/exiv2_0.28.7.bb +++ b/meta-oe/recipes-support/exiv2/exiv2_0.28.7.bb | |||
| @@ -4,7 +4,34 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=625f055f41728f84a8d7938acc35bdc2" | |||
| 4 | 4 | ||
| 5 | DEPENDS = "zlib expat brotli libinih" | 5 | DEPENDS = "zlib expat brotli libinih" |
| 6 | 6 | ||
| 7 | SRC_URI = "git://github.com/Exiv2/exiv2.git;protocol=https;branch=0.28.x;tag=v${PV}" | 7 | SRC_URI = "git://github.com/Exiv2/exiv2.git;protocol=https;branch=0.28.x;tag=v${PV} \ |
| 8 | file://run-ptest \ | ||
| 9 | file://0001-Use-automake-output-for-tests.patch \ | ||
| 10 | file://0001-Allow-test-data-path-configuration.patch \ | ||
| 11 | " | ||
| 8 | SRCREV = "afcb7a8ba84a7de36d2f1ee7689394e078697956" | 12 | SRCREV = "afcb7a8ba84a7de36d2f1ee7689394e078697956" |
| 9 | 13 | ||
| 10 | inherit cmake gettext | 14 | inherit cmake gettext ptest |
| 15 | |||
| 16 | PACKAGECONFIG ??= "${@bb.utils.contains('PTEST_ENABLED', '1', 'test unittest', '', d)}" | ||
| 17 | PACKAGECONFIG[test] = "-DEXIV2_BUILD_SAMPLES=ON -DEXIV2_ENABLE_WEBREADY=ON" | ||
| 18 | PACKAGECONFIG[unittest] = "-DEXIV2_BUILD_UNIT_TESTS=ON -DTEST_FOLDER=${PTEST_PATH},,googletest" | ||
| 19 | |||
| 20 | RDEPENDS:${PN}-ptest += " \ | ||
| 21 | python3-html \ | ||
| 22 | python3-lxml \ | ||
| 23 | python3-multiprocessing \ | ||
| 24 | python3-shell \ | ||
| 25 | python3-unittest \ | ||
| 26 | python3-unittest-automake-output" | ||
| 27 | |||
| 28 | do_install_ptest(){ | ||
| 29 | cp -r ${S}/tests ${D}${PTEST_PATH}/ | ||
| 30 | cp -r ${S}/test ${D}${PTEST_PATH}/ | ||
| 31 | |||
| 32 | install -d ${D}${PTEST_PATH}/build/bin | ||
| 33 | install ${B}/bin/* ${D}${PTEST_PATH}/build/bin | ||
| 34 | |||
| 35 | install -d ${D}${PTEST_PATH}/src | ||
| 36 | install ${S}/src/canonmn_int.cpp ${D}${PTEST_PATH}/src | ||
| 37 | } | ||
