diff options
author | Chi Xu <chi.xu@eng.windriver.com> | 2024-01-26 13:48:20 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-01-27 08:20:02 +0000 |
commit | 4cb6ff8a57cb27bce31b76136fd32b1a54c01eaf (patch) | |
tree | 7def3659e91285a887da5ae1824740c3aef86c4d /meta/recipes-extended/xz/xz/run-ptest | |
parent | 82eb0c47e4874d4600432d8daa04f470b7b1676e (diff) | |
download | poky-4cb6ff8a57cb27bce31b76136fd32b1a54c01eaf.tar.gz |
xz: Add ptest support
There are two types of cases: executables and POSIX shell scripts.
All test cases PASS.
Add xz-ptest to PTESTS_FAST because test duration less than 30s
on qemux86-64.
root@qemux86-64:~# ptest-runner xz
START: ptest-runner
2024-01-26T03:32
BEGIN: /usr/lib/xz/ptest
=== test_bcj_exact_size.c ===
PASS: test_exact_size
PASS: test_empty_block
(From OE-Core rev: 2704983f972e4fe1d4e0bee8491a07eb4f629346)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended/xz/xz/run-ptest')
-rw-r--r-- | meta/recipes-extended/xz/xz/run-ptest | 26 |
1 files changed, 26 insertions, 0 deletions
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 | ||