summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChangqing Li <changqing.li@windriver.com>2019-04-11 15:02:33 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-05-22 00:31:48 +0100
commit0e354a51844dc1e2262f426354748e4b76f51592 (patch)
treef8b7df2a35be6677422d968d01c8d376ecb01edd
parent6e17a309e225605e028b6b2d3a55827bbe8339e2 (diff)
downloadpoky-0e354a51844dc1e2262f426354748e4b76f51592.tar.gz
poky-0e354a51844dc1e2262f426354748e4b76f51592.tar.bz2
poky-0e354a51844dc1e2262f426354748e4b76f51592.zip
ruby: add ptest
(From OE-Core rev: ed650ca30379279f6a0f1e8f9f728cc542504732) Signed-off-by: Changqing Li <changqing.li@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/ruby/ruby.inc2
-rw-r--r--meta/recipes-devtools/ruby/ruby/run-ptest13
-rw-r--r--meta/recipes-devtools/ruby/ruby_2.5.3.bb10
3 files changed, 24 insertions, 1 deletions
diff --git a/meta/recipes-devtools/ruby/ruby.inc b/meta/recipes-devtools/ruby/ruby.inc
index 28e21fee9c..1ecd087d7d 100644
--- a/meta/recipes-devtools/ruby/ruby.inc
+++ b/meta/recipes-devtools/ruby/ruby.inc
@@ -24,7 +24,7 @@ SRC_URI = "http://cache.ruby-lang.org/pub/ruby/${SHRT_VER}/ruby-${PV}.tar.gz \
"
UPSTREAM_CHECK_URI = "https://www.ruby-lang.org/en/downloads/"
-inherit autotools
+inherit autotools ptest
# This snippet lets compiled extensions which rely on external libraries,
diff --git a/meta/recipes-devtools/ruby/ruby/run-ptest b/meta/recipes-devtools/ruby/ruby/run-ptest
new file mode 100644
index 0000000000..de7c415aba
--- /dev/null
+++ b/meta/recipes-devtools/ruby/ruby/run-ptest
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+test_fullname=`find test -name test_*.rb`
+
+for i in ${test_fullname}; do
+ ruby ./test/runner.rb ${i} 2>&1 > /dev/null
+ ret=$?
+ if [ $ret != 0 ]; then
+ echo "FAIL: ${i}"
+ else
+ echo "PASS: ${i}"
+ fi
+done
diff --git a/meta/recipes-devtools/ruby/ruby_2.5.3.bb b/meta/recipes-devtools/ruby/ruby_2.5.3.bb
index 173b44b377..519daf294f 100644
--- a/meta/recipes-devtools/ruby/ruby_2.5.3.bb
+++ b/meta/recipes-devtools/ruby/ruby_2.5.3.bb
@@ -3,6 +3,7 @@ require ruby.inc
SRC_URI += " \
file://ruby-CVE-2017-9226.patch \
file://ruby-CVE-2017-9228.patch \
+ file://run-ptest \
"
SRC_URI[md5sum] = "20c85b67846d49622ef3b24230803fef"
@@ -55,6 +56,13 @@ do_install_append_class-target () {
}
+do_install_ptest () {
+ cp -rf ${S}/test ${D}${PTEST_PATH}/
+ cp -r ${S}/include ${D}/${libdir}/ruby/
+ test_case_rb=`grep rubygems/test_case.rb ${B}/.installed.list`
+ sed -i -e 's:../../../test/:../../../ptest/test/:g' ${D}/$test_case_rb
+}
+
PACKAGES =+ "${PN}-ri-docs ${PN}-rdoc"
SUMMARY_${PN}-ri-docs = "ri (Ruby Interactive) documentation for the Ruby standard library"
@@ -67,4 +75,6 @@ FILES_${PN}-rdoc += "${libdir}/ruby/*/rdoc ${bindir}/rdoc"
FILES_${PN} += "${datadir}/rubygems"
+FILES_${PN}-ptest_append_class-target += "${libdir}/ruby/include"
+
BBCLASSEXTEND = "native"