diff options
| -rw-r--r-- | meta/conf/distro/include/ptest-packagelists.inc | 1 | ||||
| -rw-r--r-- | meta/recipes-extended/xz/xz/run-ptest | 26 | ||||
| -rw-r--r-- | meta/recipes-extended/xz/xz_5.4.5.bb | 28 |
3 files changed, 53 insertions, 2 deletions
diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc index a1643c5548..68a3f63a6a 100644 --- a/meta/conf/distro/include/ptest-packagelists.inc +++ b/meta/conf/distro/include/ptest-packagelists.inc | |||
| @@ -77,6 +77,7 @@ PTESTS_FAST = "\ | |||
| 77 | sed \ | 77 | sed \ |
| 78 | slang \ | 78 | slang \ |
| 79 | wayland \ | 79 | wayland \ |
| 80 | xz \ | ||
| 80 | zlib \ | 81 | zlib \ |
| 81 | libexif \ | 82 | libexif \ |
| 82 | " | 83 | " |
diff --git a/meta/recipes-extended/xz/xz/run-ptest b/meta/recipes-extended/xz/xz/run-ptest new file mode 100644 index 0000000000..cc8ba92016 --- /dev/null +++ b/meta/recipes-extended/xz/xz/run-ptest | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | ptestdir=$(dirname "$(readlink -f "$0")") | ||
| 4 | cd "$ptestdir"/tests || exit | ||
| 5 | |||
| 6 | # executables test cases | ||
| 7 | tests_exec=$(file $(ls test_*) | grep "ELF" | awk -F: '{print $1}') | ||
| 8 | for i in ${tests_exec}; do | ||
| 9 | ./$i | ||
| 10 | done | ||
| 11 | |||
| 12 | # POSIX shell script test cases | ||
| 13 | export srcdir=${ptestdir}/tests | ||
| 14 | test_shell="test_files.sh test_scripts.sh test_compress.sh" | ||
| 15 | for j in ${test_shell}; do | ||
| 16 | if [ $j == "test_compress.sh" ]; then | ||
| 17 | ./$j create_compress_files | ||
| 18 | else | ||
| 19 | ./$j | ||
| 20 | fi | ||
| 21 | if [ $? -eq 0 ]; then | ||
| 22 | echo "PASS: $j" | ||
| 23 | else | ||
| 24 | echo "FAIL: $j" | ||
| 25 | fi | ||
| 26 | done | ||
diff --git a/meta/recipes-extended/xz/xz_5.4.5.bb b/meta/recipes-extended/xz/xz_5.4.5.bb index 09eade8be0..0f0849c3e5 100644 --- a/meta/recipes-extended/xz/xz_5.4.5.bb +++ b/meta/recipes-extended/xz/xz_5.4.5.bb | |||
| @@ -24,13 +24,15 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=c8ea84ebe7b93cce676b54355dc6b2c0 \ | |||
| 24 | file://lib/getopt.c;endline=23;md5=2069b0ee710572c03bb3114e4532cd84 \ | 24 | file://lib/getopt.c;endline=23;md5=2069b0ee710572c03bb3114e4532cd84 \ |
| 25 | " | 25 | " |
| 26 | 26 | ||
| 27 | SRC_URI = "https://tukaani.org/xz/xz-${PV}.tar.gz" | 27 | SRC_URI = "https://tukaani.org/xz/xz-${PV}.tar.gz \ |
| 28 | ${@bb.utils.contains('PTEST_ENABLED', '1', 'file://run-ptest', '', d)} \ | ||
| 29 | " | ||
| 28 | SRC_URI[sha256sum] = "135c90b934aee8fbc0d467de87a05cb70d627da36abe518c357a873709e5b7d6" | 30 | SRC_URI[sha256sum] = "135c90b934aee8fbc0d467de87a05cb70d627da36abe518c357a873709e5b7d6" |
| 29 | UPSTREAM_CHECK_REGEX = "xz-(?P<pver>\d+(\.\d+)+)\.tar" | 31 | UPSTREAM_CHECK_REGEX = "xz-(?P<pver>\d+(\.\d+)+)\.tar" |
| 30 | 32 | ||
| 31 | CACHED_CONFIGUREVARS += "gl_cv_posix_shell=/bin/sh" | 33 | CACHED_CONFIGUREVARS += "gl_cv_posix_shell=/bin/sh" |
| 32 | 34 | ||
| 33 | inherit autotools gettext | 35 | inherit autotools gettext ptest |
| 34 | 36 | ||
| 35 | PACKAGES =+ "liblzma" | 37 | PACKAGES =+ "liblzma" |
| 36 | 38 | ||
| @@ -42,3 +44,25 @@ ALTERNATIVE:${PN} = "xz xzcat unxz \ | |||
| 42 | lzma lzcat unlzma" | 44 | lzma lzcat unlzma" |
| 43 | 45 | ||
| 44 | BBCLASSEXTEND = "native nativesdk" | 46 | BBCLASSEXTEND = "native nativesdk" |
| 47 | |||
| 48 | RDEPENDS:${PN}-ptest += "bash file" | ||
| 49 | |||
| 50 | do_compile_ptest() { | ||
| 51 | oe_runmake check TESTS= | ||
| 52 | } | ||
| 53 | |||
| 54 | do_install_ptest () { | ||
| 55 | install -d ${D}${PTEST_PATH}/tests | ||
| 56 | find ${B}/tests/.libs -type f -executable -exec cp {} ${D}${PTEST_PATH}/tests \; | ||
| 57 | cp ${B}/config.h ${D}${PTEST_PATH} | ||
| 58 | for i in files xzgrep_expected_output test_files.sh test_scripts.sh test_compress.sh; do | ||
| 59 | cp -r ${S}/tests/$i ${D}${PTEST_PATH}/tests | ||
| 60 | done | ||
| 61 | mkdir -p ${D}${PTEST_PATH}/src/xz | ||
| 62 | ln -s ${bindir}/xz ${D}${PTEST_PATH}/src/xz/xz | ||
| 63 | mkdir -p ${D}${PTEST_PATH}/src/xzdec | ||
| 64 | ln -s ${bindir}/xzdec ${D}${PTEST_PATH}/src/xzdec/xzdec | ||
| 65 | mkdir -p ${D}${PTEST_PATH}/src/scripts | ||
| 66 | ln -s ${bindir}/xzdiff ${D}${PTEST_PATH}/src/scripts/xzdiff | ||
| 67 | ln -s ${bindir}/xzgrep ${D}${PTEST_PATH}/src/scripts/xzgrep | ||
| 68 | } | ||
