kde4support: kstandarddirs_unittest fix

Alex Merry kde at randomguy3.me.uk
Mon Dec 23 14:23:07 UTC 2013


On 23/12/13 12:52, David Faure wrote:
> On Monday 23 December 2013 11:43:39 Alex Merry wrote:
>> On 23/12/13 08:36, David Faure wrote:
>>> Still, replacing tests that pass means introducing the risk that we're not
>>> testing for the same thing anymore. But if you're fully convinced, go
>>> ahead. I wouldn't have rewritten these, but I don't want to veto the
>>> change.
>>>
>>> In fact my thinking when writing this test was: the whole point of
>>> kstandarddirs is to find installed files. As soon as we test something
>>> else, we lose the guarantee that it's indeed finding what the user just
>>> installed.... I admit that this was a "setup test" in addition to being a
>>> "unit test" though, and build.kde.org has a bit of a strange setup :)
>>
>> I see your point; given that this is only kde4support, I'll go for the
>> less invasive route of fixing the logic that determines when it should
>> skip the tests (so it skips when kde4support is not installed yet).
>>
>> Either way, the tests will fail is KDEDIRS is not set correctly; I think
>> the right approach there is to do a bit of a sanity check in
>> initTestCase() and bail (with either QSKIP or QFAIL) if it is either
>> empty or does not contain at least the install directory.
> 
> Or we can just set it with a qputenv? ;)
> 

Setting it correctly is the tricky part.  CMake doesn't seem keen on
giving you the install prefixes of other packages.

Alex


More information about the Kde-frameworks-devel mailing list