Skip to contentSkip to conversation

kbd: Add ptest support

PATCH Superseded [email protected] 2 participants 4 messages May 15, 2023 – May 18, 2023

v1 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kbd: Add ptest support

From: Qiu Tingting <[email protected]>

Add a ptest for kbd
- It is taking around 1s to execute with kvm, so added it to PTESTS_FAST
- It contains libkeymap unit tests(27 cases) and libkbdfile unit tests(13 cases)

---
 meta/recipes-core/kbd/files/run-ptest | 18 +++++++
 meta/recipes-core/kbd/kbd_2.5.1.bb    | 72 ++++++++++++++++++++++++++-
 2 files changed, 89 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-core/kbd/files/run-ptest
meta/recipes-core/kbd/files/run-ptest new file +18 -0
new file mode 100644
index 0000000000..cace13b8cb
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# Define test work dir
+WORKDIR=@PTEST_PATH@/tests/
+
+# Run test
+cd ${WORKDIR}
+
+# create atconfig
+if [[ ! -f "atconfig" ]]; then
+    echo 'abs_builddir="@PTEST_PATH@/tests/"' > atconfig
+    echo 'abs_srcdir="@PTEST_PATH@/tests/"' >> atconfig
+    echo 'abs_top_builddir="@PTEST_PATH@/"' >> atconfig
+fi
+
+./testsuite -k unittest | sed -e '/[0-9]:/s/://' \
+    -e '/ ok/s/^/PASS: /;/ FAILED/s/^/FAIL: /;/ skipped/s/^/SKIP: /' \
+    -e '/ ok/s/ ok.*//;/ skipped/s/ skipped.*//;/ FAILED/s/ FAILED.*//'
meta/recipes-core/kbd/kbd_2.5.1.bb +71 -1

87 lines not on this page · raw message

Signature · 1 line
2.25.1
#1 lore raw

meta/recipes-core/kbd/files/run-ptest line 14

Quoted 6 lines · On 15 May 2023, at 08:35, [email protected] via lists.openembedded.org…
meta/recipes-core/kbd/files/run-ptest new file +6 -0
+# create atconfig
+if [[ ! -f "atconfig" ]]; then
+    echo 'abs_builddir="@PTEST_PATH@/tests/"' > atconfig
+    echo 'abs_srcdir="@PTEST_PATH@/tests/"' >> atconfig
+    echo 'abs_top_builddir="@PTEST_PATH@/"' >> atconfig
+fi

You can generate this file when the package is built, surely.

Quoted 1 line

+RDEPENDS:${PN}-ptest += "bash"

Did you try to port the test suite away from bash?

Ross

#2 lore raw

Hi,Ross

Quoted 11 lines

meta/recipes-core/kbd/files/run-ptest line 14

Quoted 8 lines
meta/recipes-core/kbd/files/run-ptest new file +6 -0
+# create atconfig
+if [[ ! -f "atconfig" ]]; then
+ echo 'abs_builddir="@PTEST_PATH@/tests/"' > atconfig
+ echo 'abs_srcdir="@PTEST_PATH@/tests/"' >> atconfig
+ echo 'abs_top_builddir="@PTEST_PATH@/"' >> atconfig
+fi

You can generate this file when the package is built, surely.

When the package is built, this file is created, but the directory is not PTEST_PATH. So, I create a new file for ptest.
Of course, there is no problem using the built file.
I will try to modify this patch.

Quoted 5 lines
Quoted 3 lines

+RDEPENDS:${PN}-ptest += "bash"

Did you try to port the test suite away from bash?

No, I didn't.
I will try to delete it.