testing framework

Albert Astals Cid aacid at kde.org
Mon Jan 31 15:30:05 GMT 2022


El dilluns, 31 de gener de 2022, a les 0:10:07 (CET), Andreas Naumann va escriure:
> 
> On 30.01.22 23:21, David Hurka wrote:
> > On Sunday, January 30, 2022 1:00:01 PM CET okular-devel-request at kde.org wrote:
> >> Until now, I followed the instructions at
> >> https://okular.kde.org/build-it/ using kde/neon with pre-installed
> >> development libraries. My install prefix is my home folder ~/kde_installed.
> >>
> >> I am puzzled by two advices:
> >> 1) The website https://okular.kde.org/build-it/ states "If you install
> >> Okular in a different path than your system install directory it is
> >> possible that you need to run source build/prefix.sh; okular".
> >>       Does that even relate to the tests, or only to the installed
> >> binarys? That question came to my mind, because the kimgiotest loads the
> >> library "okularGenerator_kimgio.so" from the system, and the newly
> >> compiled one.
> >>       The command "source build/prefix.sh" updates the environment, but
> >> it does not change the behavior at all. It does set QT_PLUGIN_PATH to
> >> the installed path. But the test seems to ignore it.
> >> kde/neon with pre-installed development libraries.
> >> source build/prefix.sh; okular
> > Hi Andreas,
> >
> > this is the same way I did it the last time, integrated in KDevelop. So it
> > should work for you too. There must be something we do differently.
> >
> > prefix.sh should change the behavior.
> >
> >> 2) The documentation at
> >> https://community.kde.org/Get_Involved/development#Test_your_changes
> >> bases on kdesrc-build. Is that the way to go for every application?
> >> It looks a bit cumbersome.
> > It is just a possible way, but it is not required.
> >
> > I am sorry that I can not fix your issue right now. I will look soon if I did
> > something special in my build environment. Do you have more details that might
> > be relevant?
> >
> > You are not the only one who has trouble with the plugin path. :/
> 
> Thanks a lot for the reply. In the mean time, I found the reason and
> solution for the problem.
> 
> The relation between the plugins and the test "kimgiotest" depends on
> the variable QT_PLUGIN_PATH. The test is added via the line 12 in
> generators/kimgio/CMakeLists.txt
> 
>    "ecm_add_test(${kimgiotest_SRCS} TEST_NAME "kimgiotest"
> LINK_LIBRARIES okularcore okularpart Qt5::Svg Qt5::Test)"
> 
> This function sets the environment variable QT_PLUGIN_PATH for the test
> to the same value, as during running cmake. Thus I resolved the problem
> by running the sequence
> 
>    cmake -DCMAKE_INSTALL_PREFIX=~/kde_installed ..
>    source prefix.sh
>    cmake .
> 
> inside the build folder. Please note mixed run of cmake and sourcing the
> prefix.
> 
> I would like to add this information to the Readme.md in the root, and
> maybe set the QT_PLUGIN_PATH during the cmake run. This would remove the
> need to source the prefix and run cmake a second time. And it might be
> less confusing for new comers :)
> 
> What do you think?

Right, QT_PLUGIN_PATH is important before running cmake, good find!

i've never had this issue since my custom compilation script sets QT_PLUGIN_PATH before running cmake.

This is hopefully going to be fixed "soon" 
https://invent.kde.org/frameworks/kcoreaddons/-/merge_requests/164

I'm not super happy with having to comment that in the Readme.md but if you find a nice way to express/explain it, patches welcome in invent :)

Cheers,
  Albert

> 
> >
> > Cheers, David
> Greetings,
> Andreas
> >
> >
> >
> 






More information about the Okular-devel mailing list