summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorSimone Weiss <simone.weiss@elektrobit.com>2022-04-01 16:46:29 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-04-03 10:40:31 +0100
commitffbf7d2b97ff1dc9e847a67f3990c9c2074883f0 (patch)
tree42099e516108ba52c00b138eb90d343c9eac58fe /meta
parent7e8d8b0dca0e5e1977b190a98c9706fd7b771ac6 (diff)
downloadpoky-ffbf7d2b97ff1dc9e847a67f3990c9c2074883f0.tar.gz
popt: add ptest
Add a ptest for popt to core-image-ptest-all. Provide a patch to popt to adopt the test format to "simple test" and a script for running the test. All tests passed on a trial run. (From OE-Core rev: ffae118e7b1bdf704d9af0ad47809c3791b672b4) Signed-off-by: Simone Weiss <simone.weiss@elektrobit.com> Signed-off-by: David Niederpruem <david.niederpruem@elektrobit.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/conf/distro/include/ptest-packagelists.inc1
-rw-r--r--meta/recipes-support/popt/popt/0001-popt-test-output-format-for-ptest.patch68
-rw-r--r--meta/recipes-support/popt/popt/run-ptest3
-rw-r--r--meta/recipes-support/popt/popt_1.18.bb21
4 files changed, 91 insertions, 2 deletions
diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index ac3295d1aa..b51cce4d9e 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -48,6 +48,7 @@ PTESTS_FAST = "\
48 opkg-ptest \ 48 opkg-ptest \
49 pango-ptest \ 49 pango-ptest \
50 parted-ptest \ 50 parted-ptest \
51 popt-ptest \
51 python3-atomicwrites-ptest \ 52 python3-atomicwrites-ptest \
52 python3-bcrypt-ptest \ 53 python3-bcrypt-ptest \
53 python3-hypothesis-ptest \ 54 python3-hypothesis-ptest \
diff --git a/meta/recipes-support/popt/popt/0001-popt-test-output-format-for-ptest.patch b/meta/recipes-support/popt/popt/0001-popt-test-output-format-for-ptest.patch
new file mode 100644
index 0000000000..020949cc34
--- /dev/null
+++ b/meta/recipes-support/popt/popt/0001-popt-test-output-format-for-ptest.patch
@@ -0,0 +1,68 @@
1From 330b77081c3a4c7ae76cb08602db385b40fa7ff7 Mon Sep 17 00:00:00 2001
2From: Simone Weiss <simone.weiss@elektrobit.com>
3Date: Mon, 13 Dec 2021 09:29:53 +0000
4Subject: [PATCH] popt test output format for ptest
5
6patch test output format to match simple-test as it is used in ptests.
7
8Upstream-Status: Pending
9
10Signed-off-by: Simone Weiss <simone.weiss@elektrobit.com>
11Signed-off-by: David Niederpruem <david.niederpruem@elektrobit.com>
12---
13 tests/testit.sh | 20 ++++++++------------
14 1 file changed, 8 insertions(+), 12 deletions(-)
15
16diff --git a/tests/testit.sh b/tests/testit.sh
17index 2a7b4aa..50b42e2 100755
18--- a/tests/testit.sh
19+++ b/tests/testit.sh
20@@ -5,12 +5,11 @@ run() {
21 name=$1; shift
22 answer=$1; shift
23
24- echo Running test $name.
25-
26 result=`HOME=$builddir $builddir/$prog $*`
27 if [ "$answer" != "$result" ]; then
28- echo "Test \"$prog $*\" failed with: \"$result\" != \"$answer\" "
29- exit 2
30+ echo "FAIL: $name"
31+ else
32+ echo "PASS: $name"
33 fi
34 }
35
36@@ -23,17 +22,17 @@ run_diff() {
37 out=$builddir/tmp.out
38 diff_file=$builddir/tmp.diff
39
40- echo Running test $name.
41-
42 $builddir/$prog $in_file > $out
43 ret=$?
44 diff $out $answer_file > $diff_file
45 diff_ret=$?
46
47 if [ "$diff_ret" != "0" ]; then
48- echo "Test \"$name\" failed output is in $out, diff is:"
49- cat $diff_file
50- exit 2
51+ echo "FAIL: $name"
52+ echo "diff is:"
53+ cat $diff_file
54+ else
55+ echo "PASS: $name"
56 fi
57 rm $out $diff_file
58 }
59@@ -174,6 +173,3 @@ Help options:
60 #run_diff test3 "test3 - 51" test3-data/01.input test3-data/01.answer
61 #run_diff test3 "test3 - 52" test3-data/02.input test3-data/02.answer
62 #run_diff test3 "test3 - 53" test3-data/03.input test3-data/03.answer
63-
64-echo ""
65-echo "Passed."
66--
672.17.1
68
diff --git a/meta/recipes-support/popt/popt/run-ptest b/meta/recipes-support/popt/popt/run-ptest
new file mode 100644
index 0000000000..85754035d0
--- /dev/null
+++ b/meta/recipes-support/popt/popt/run-ptest
@@ -0,0 +1,3 @@
1#!/bin/sh
2
3./testit.sh
diff --git a/meta/recipes-support/popt/popt_1.18.bb b/meta/recipes-support/popt/popt_1.18.bb
index 057c44f223..af8add4ad6 100644
--- a/meta/recipes-support/popt/popt_1.18.bb
+++ b/meta/recipes-support/popt/popt_1.18.bb
@@ -8,9 +8,26 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=cb0613c30af2a8249b8dcc67d3edb06d"
8 8
9DEPENDS = "virtual/libiconv" 9DEPENDS = "virtual/libiconv"
10 10
11SRC_URI = "http://ftp.rpm.org/popt/releases/popt-1.x/${BP}.tar.gz" 11SRC_URI = "\
12 http://ftp.rpm.org/popt/releases/popt-1.x/${BP}.tar.gz \
13 file://0001-popt-test-output-format-for-ptest.patch \
14 file://run-ptest \
15"
12SRC_URI[sha256sum] = "5159bc03a20b28ce363aa96765f37df99ea4d8850b1ece17d1e6ad5c24fdc5d1" 16SRC_URI[sha256sum] = "5159bc03a20b28ce363aa96765f37df99ea4d8850b1ece17d1e6ad5c24fdc5d1"
13 17
14inherit autotools gettext 18inherit autotools gettext ptest
19
20RDEPENDS_${PN}-ptest += "bash"
21
22do_compile_ptest() {
23 sed 's#lt-test1#test1#g' ${S}/tests/testit.sh > ${B}/tests/testit.sh
24}
25
26do_install_ptest() {
27 install ${B}/tests/.libs/test* ${D}/${PTEST_PATH}
28 install ${B}/tests/.libs/tdict ${D}/${PTEST_PATH}
29 install ${B}/tests/testit.sh ${D}/${PTEST_PATH}
30 install ${B}/tests/test-poptrc ${D}/${PTEST_PATH}
31}
15 32
16BBCLASSEXTEND = "native nativesdk" 33BBCLASSEXTEND = "native nativesdk"