Bug #1423
openMake the test suite installable
0%
Description
In Yocto, the tests are run on the installed tree rather than from the source tree. The current implementation of the tests in Babeltrace means they are only intended to be run from the source tree. It would be nice for users to have a test suite or subset of the test suite that could be run with the installed version of Babeltrace
Original description:
reference .lib in tests/lib/test-plugins.sh as the following show:
"${BT_TESTS_BUILDDIR}/lib/test-plugins" "${BT_TESTS_BUILDDIR}/lib/test-plugins-plugins/.libs"
.libs are used as the temporary directory, we should not reference a temporary directory.
Updated by Kienan Stewart 19 days ago
- Status changed from New to Feedback
- Assignee set to Bin Lan
Hi Bin Lan,
the test uses the shared objects in ${BT_TESTS_BUILDDIR}/lib/test-plugins-plugins/.libs
. Those shared objects are produced there by automake/libtool and not installed elsewhere.
Do you have an alternative solution in mind?
thanks,
kienan
Updated by Kienan Stewart 19 days ago
Hi again Bin Lan,
could you also explain the context of why this change is important to you? What steps of building and testing (and on which platform) led to this being an issue?
thanks,
kienan
Updated by Bin Lan 19 days ago
Hi kienan,
I am working to upgrade babeltrace from 2.0.6 to 2.1.0 for Yocto openembedded-core. Reproduction step is:
Download Yocto Poky.
Apply my patch: https://lists.openembedded.org/g/openembedded-core/message/212733.
I have to patch tests/lib/test-plugins.sh, then the test cases can pass.
Updated by Kienan Stewart 18 days ago
Hi Bin Lan,
thanks for the link to the yocto patches and discussion. When I cross-compile babeltrace2 locally without being in the context of poky, the cross-compiled shared libraries are in ".libs".
Eg.
# Environment variables elided # On an x86_64 build host ./configure --host=aarch64-linux-gnu make -j find tests/ -iname "*.so*"
If the change you are proposing is to simply remove ".libs" that would break the default behaviour for tests run following both native and cross compilation outside of the yocto context. Do you have a more general solution in mind?
I'm still familiarizing myself with the poky environment, but from what I can see when I use bitbake to build the babeltrace2 recipe, the build dir contains ".libs/" with shared objects as expected. E.g.,
debian@pleased-dinosaur:~/test/build/tmp/work/armv8a-poky-linux/babeltrace2/2.0.6/build$ find tests/ -iname '*.so' tests/lib/test-plugin-plugins/.libs/plugin-sfs.so tests/lib/test-plugin-plugins/.libs/plugin-minimal.so
Furthermore, the LT_OBJDIR
/objdir
for libtool seem to be ".libs" within the poky build directory:
debian@pleased-dinosaur:~/test/build/tmp/work/armv8a-poky-linux/babeltrace2/2.0.6/build$ grep -r LT_OBJDIR config.status:D["LT_OBJDIR"]=" \".libs/\"" src/common/config.h:#define LT_OBJDIR ".libs/" config.log:| #define LT_OBJDIR ".libs/" config.log:| #define LT_OBJDIR ".libs/" config.log:| #define LT_OBJDIR ".libs/" config.log:| #define LT_OBJDIR ".libs/" config.log:#define LT_OBJDIR ".libs/" debian@pleased-dinosaur:~/test/build/tmp/work/armv8a-poky-linux/babeltrace2/2.0.6/build$ grep -r objdir config* config.log:configure:12953: checking for objdir config.log:lt_cv_objdir=.libs config.status:objdir='.libs' config.status:archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ config.status: cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ config.status: echo "local: *; };" >> $output_objdir/$libname.ver~ config.status: $CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' config.status:objdir=$objdir
Is the recipe running the tests with only the contents of the "install" step or something like that?
thanks,
kienan
P.S. With respect to libtool itself the objdir
is not always ".libs". On ms-dos, for example, it would be "_libs". One way to get this information could be a short function e.g.
OBJDIR=$( source < <(libtool --config) echo $objdir )
Updated by Kienan Stewart 18 days ago
Hi Bin Lan,
after looking further at do_install_ptest
in babeltrace2_2.0.6.bb, it looks like it's the recipe copying the ".so" files out of ".libs" directory into the parent.
thanks,
kienan
Updated by Kienan Stewart 1 day ago
- Subject changed from tests/lib/test-plugins.sh should not reference .lib to Make the test suite installable
- Description updated (diff)
- Category set to Build system
- Status changed from Feedback to New
- Assignee deleted (
Bin Lan) - Target version changed from Babeltrace - 2.1 to Babeltrace - wishlist
I'm going to re-title this issue and set it to wish list.
My understanding the the desire here is to have an installable test suite. It's one thing to run the tests in-tree; but, the the yocto build process wants to run the tests on the installed version (which is a fair desire).