GNOME Bugzilla – Bug 776938
installed tests cannot load libregress.so
Last modified: 2017-01-13 05:44:27 UTC
Running : gnome-desktop-testing-runner gjs/testFundamental.test Yields an error on loading libregress.so : JS G NS: Found info type OBJECT for 'TestFundamentalSubObject' in namespace 'Regress' ** (process:4055): WARNING **: Failed to load shared library 'libregress.so' referenced by the typelib: libregress.so: cannot open shared object file: No such file or directory JS G NS: Failed to define info 'TestFundamentalSubObject' not ok 1 Fundamental type support constructs a subtype of a fundamental type # Message: Expected function not to throw, but it threw Error: Unsupported type void, deriving from fundamental void. Looks like we're missing the path to $libdir/gjs in LD_LIBRARY_PATH.
Thanks for reporting! I can't reproduce this though; let's diagnose. $libdir/gjs shouldn't be in LD_LIBRARY_PATH because those aren't public libraries. What's the path to the libregress.so shared library listed in your built copy of Regress-1.0.gir?
I can't see any path to libregress.so in the built gir file. Here is the namespace : <namespace name="Regress" version="1.0" shared-library="libregress.so" c:identifier-prefixes="Regress" c:symbol-prefixes="regress"> What I find a bit disturbing is that Regress-1.0.gir isn't installed in the build directory. So I understand how that could work with the installed tests. Maybe I'm missing something?
It looks like this for me, at least on macOS: <namespace name="Regress" version="1.0" shared-library="/Users/fliep/install/lib/gjs/libregress.dylib" c:identifier-prefixes="Regress" c:symbol-prefixes="regress"> I usually run the tests uninstalled on my Linux machine, where presumably the namespace looks like yours. So maybe that's why I'm not running into this problem. I'll dig into this more soon.
Created attachment 343341 [details] [review] installed-tests: Fix script test Exec line The script tests should be executed with a shell, not GJS.
Created attachment 343342 [details] [review] installed-tests: Prepend pkglibdir to library path Typelibs don't include the full path to the shared library on every platform, so we need to add pkglibdir to GIRespository's library search path when running the tests installed.
Here's what fixed it for me, let me know if that works for you as well.
Yey! It all works now :) Thanks!
Attachment 343341 [details] pushed as f993a3a - installed-tests: Fix script test Exec line Attachment 343342 [details] pushed as 880c623 - installed-tests: Prepend pkglibdir to library path