[oe-commits] [openembedded-core] 12/40: ruby: some ptest fixes

git at git.openembedded.org git at git.openembedded.org
Tue Oct 22 11:24:38 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 063a9ff3f533729f6f0a428377555fd9c32bf8a6
Author: André Draszik <andre.draszik at jci.com>
AuthorDate: Tue Oct 1 15:29:56 2019 +0100

    ruby: some ptest fixes
    
    * the (new?) ruby expects some additional compiled libraries
      to run, so we need to copy them as part of ptest.
      Fixes errors like:
      # ruby ./runner.rb ./-ext-/vm/test_at_exit.rb
      Run options:
    
      # Running tests:
    
      [1/1] TestVM#test_at_exit = 0.06 s
        1) Failure:
      TestVM#test_at_exit [/usr/lib/ruby/ptest/test/-ext-/vm/test_at_exit.rb:7]:
    
      1. [1/2] Assertion for "stdout"
         | <["begin", "end"]> expected but was
         | <[]>.
    
      2. [2/2] Assertion for "stderr"
         | <[]> expected but was
         | <["-:1:in `require': cannot load such file -- -test-/vm/at_exit (LoadError)",
         |  "\tfrom -:1:in `<main>'"]>.
    
    * the 'erb' test can't find the erb binary, as we're not
      running this from within the build directory
    
    Signed-off-by: André Draszik <andre.draszik at jci.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/recipes-devtools/ruby/ruby_2.6.4.bb | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-devtools/ruby/ruby_2.6.4.bb b/meta/recipes-devtools/ruby/ruby_2.6.4.bb
index 4554487..fb202b8 100644
--- a/meta/recipes-devtools/ruby/ruby_2.6.4.bb
+++ b/meta/recipes-devtools/ruby/ruby_2.6.4.bb
@@ -44,6 +44,14 @@ do_install_append_class-target () {
 
 do_install_ptest () {
     cp -rf ${S}/test ${D}${PTEST_PATH}/
+    # install test-binaries
+    find $(find ./.ext -path '*/-test-') -name '*.so' -print0 \
+        | tar --no-recursion --null -T - --no-same-owner --preserve-permissions -cf - \
+        | tar -C ${D}${libdir}/ruby/${SHRT_VER}.0/ --no-same-owner --preserve-permissions --strip-components=2 -xf -
+    # adjust path to not assume build directory layout
+    sed -e 's|File.expand_path(.*\.\./bin/erb[^)]*|File.expand_path("${bindir}/erb"|g' \
+        -i ${D}${PTEST_PATH}/test/erb/test_erb_command.rb
+
     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
@@ -61,6 +69,9 @@ FILES_${PN}-rdoc += "${libdir}/ruby/*/rdoc ${bindir}/rdoc"
 
 FILES_${PN} += "${datadir}/rubygems"
 
-FILES_${PN}-ptest_append_class-target += "${libdir}/ruby/include"
+FILES_${PN}-ptest_append_class-target = "\
+    ${libdir}/ruby/include \
+    ${libdir}/ruby/${SHRT_VER}.0/*/-test- \
+"
 
 BBCLASSEXTEND = "native"

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list