]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
lz4: Add ptest support
authorQiu Tingting <qiutt@fujitsu.com>
Thu, 6 Apr 2023 02:23:30 +0000 (10:23 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 2 May 2023 09:25:34 +0000 (10:25 +0100)
Add a ptest for lz4.
- It is taking around 9 min to execute with kvm, so added it to PTEST_SLOW.
- It contains one case: test_frame.
- Below is the run log:
  START: ptest-runner
  2023-04-06T00:36
  BEGIN: /usr/lib/lz4/ptest
  Starting lz4frame tester (64-bits, 1.9.4)
  Seed = 7314
  Basic tests completed
  All tests completed
  PASS: lz4/test_frame
  DURATION: 573
  END: /usr/lib/lz4/ptest
  2023-04-06T00:45
  STOP: ptest-runner
  TOTAL: 1 FAIL: 0

Signed-off-by: Qiu Tingting <qiutt@fujitsu.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/conf/distro/include/ptest-packagelists.inc
meta/recipes-support/lz4/files/run-ptest [new file with mode: 0644]
meta/recipes-support/lz4/lz4_1.9.4.bb

index 78750a0d98b2f37005d15e7cc3f3c0cd6021f1d3..2f83132aeb6618f1f84ec625d3fb572fda7567d4 100644 (file)
@@ -106,6 +106,7 @@ PTESTS_SLOW = "\
     tcl \
     util-linux \
     valgrind \
+    lz4 \
 "
 
 PTESTS_SLOW:remove:riscv64 = "valgrind"
@@ -115,7 +116,6 @@ PTESTS_SLOW:remove:x86 = "valgrind"
 PTESTS_PROBLEMS:append:x86 = " valgrind"
 
 #    ruby \ # Timeout
-#    lz4 \ # Needs a rewrite
 #    rt-tests \ # Needs to be checked whether it runs at all
 #    bash \ # Test outcomes are non-deterministic by design
 #    ifupdown \ # Tested separately in lib/oeqa/selftest/cases/imagefeatures.py
@@ -128,7 +128,6 @@ PTESTS_PROBLEMS:append:x86 = " valgrind"
 
 PTESTS_PROBLEMS = "\
     ruby \
-    lz4 \
     rt-tests \
     bash \
     ifupdown \
diff --git a/meta/recipes-support/lz4/files/run-ptest b/meta/recipes-support/lz4/files/run-ptest
new file mode 100644 (file)
index 0000000..f4a46a4
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# Define test work dir
+WORKDIR=@PTEST_PATH@/tests/
+
+# Run test
+cd ${WORKDIR}
+
+case_name="test_frame"
+./frametest 
+ret=$?
+if [[ ${ret} == "0" ]]; then
+    echo "PASS: lz4/$case_name"
+else
+    echo "FAIL: lz4/$case_name"
+fi
+
index a2a178bab5c53bc3dc81f27ab9b0cd0d31ba0bad..d2a25fd5b09dbc5518b8685fe495b1426461a0cf 100644 (file)
@@ -12,11 +12,15 @@ PE = "1"
 
 SRCREV = "5ff839680134437dbf4678f3d0c7b371d84f4964"
 
-SRC_URI = "git://github.com/lz4/lz4.git;branch=release;protocol=https"
+SRC_URI = "git://github.com/lz4/lz4.git;branch=release;protocol=https \
+          file://run-ptest \
+          "
 UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>.*)"
 
 S = "${WORKDIR}/git"
 
+inherit ptest
+
 # Fixed in r118, which is larger than the current version.
 CVE_CHECK_IGNORE += "CVE-2014-4715"
 
@@ -27,3 +31,17 @@ do_install() {
 }
 
 BBCLASSEXTEND = "native nativesdk"
+
+RDEPENDS:${PN}-ptest += "bash"
+
+do_compile_ptest() {
+        oe_runmake -C ${B}/tests/
+}
+
+do_install_ptest() {
+       install -d ${D}${PTEST_PATH}/tests/
+       install --mode=755 ${B}/tests/frametest ${D}${PTEST_PATH}/tests/
+       sed -i "s#@PTEST_PATH@#${PTEST_PATH}#g" ${D}${PTEST_PATH}/run-ptest
+
+}
+