The unit tests architecture

Maximilian Kossick maximilian.kossick at googlemail.com
Mon Feb 1 18:58:35 CET 2010


On Mon, Feb 1, 2010 at 6:32 PM, Ian Monroe <ian.monroe at gmail.com> wrote:
> On Mon, Feb 1, 2010 at 11:16 AM, Maximilian Kossick
> <maximilian.kossick at googlemail.com> wrote:
>> On Mon, Feb 1, 2010 at 5:10 PM, Ian Monroe <ian.monroe at gmail.com> wrote:
>>> On Sat, Jan 30, 2010 at 8:30 PM, Nathan Sala <sala.nathan at gmail.com> wrote:
>>>>
>>>>
>>>> 2010/1/31 Ian Monroe <ian.monroe at gmail.com>
>>>>>
>>>>> On Sat, Jan 30, 2010 at 7:50 AM, Nathan Sala <sala.nathan at gmail.com>
>>>>> wrote:
>>>>> > Thank you Leo,
>>>>> >
>>>>> > This code is really helpful for us!
>>>>> >
>>>>> > Anyway, are some people willing to comment a global unit tests
>>>>> > system refactoring in Amarok?
>>>>> >
>>>>>
>>>>> What do you mean?
>>>>>
>>>>> The unit test code is currently quite broken, it doesn't even compile
>>>>> under linux. :/ But I'm not sure it needs a 'refactor'... it just
>>>>> needs to be fixed and have tests added to it.
>>>>
>>>> What do you mean "broken"? I can compile and run unit tests under Linux.
>>>
>>> I meant what I said, it didn't compile for me last I tried. I'll try
>>> it again later today.
>>
>> If not it might be helpful for somebody who is actually running Linux to fix it.
>
> I don't really understand how its able to link on the Mac though. Do
> they get some implicit dependency on libamarok so they are able to
> link? I guess one thing that's holding me back from fixing it is that
> I would feel like I was just throwing code around until something
> stuck without really understanding what was wrong...
>

The wikipedia page on Dynamic Linker says that the OS X linker is able
load libraries at runtime when they are actually needed. I guess
that's what happening here: The code that uses SvgHandler or
Amarok::saveLocation is not used in the unit tests, so the linker
never tries to resolve those symbols.

It might be possible to convince the Linux linker to ignore those
symbols because they are never ever called.

Otherwise Amarok's codebase needs to be changed so that it uses
interfaces and some kind of DI-lite (I actually have code that does
the latter for EngineController. Not really helpful yet...)


More information about the Amarok-devel mailing list