← Back to team overview

ubuntu-phone team mailing list archive

Re: preferred test framework for C++ backends?

 

Hi

On Friday 08 August 2014 15:42:57 Alex Chiang wrote:
> 
> Are there any that use QtTest?

lp:unity8 and related backend repos use quite a lot of QtTest. Check out the 
tests/plugins directory.

I think I've also seen some QtTest tests in some of the apps.

> 
> TBH, the two frameworks seem fairly similar in functionality, so this
> seems more like a social issue than a technology issue.

I agree. It's not much of a difference. From what I've seen so far, GTest 
makes it slightly easier to inject mocked objects/calls while QtTest fits in a 
bit better when you want to test Qt style APIs with signals, properties etc. 
Gives you handy stuff like tryCompare and QSignalSpy or interaction with UIs.

> We don't have any special requirements. We just want to do what is
> most popular and whatever the platform recommends, in order to
> minimize the friction for potential outside developers to contribute
> to our code.

Yes, I for one would keep the tests to the same framework as the code itself 
which I think is mostly what we do overall. If the codebase uses a lot of Qt 
it probably makes sense to stick to QtTest but not pulling in QtTest on a 
library that doesn't really use Qt otherwise...

Cheers,
Michael


Follow ups

References