[Interest] Need advice to add tests to an existing project

Christian Gagneraud chgans at gmail.com
Wed Nov 8 02:35:40 CET 2017


On 8/11/2017 11:50 AM, Xavier Bigand wrote:
> Thank you Christian for answer.
> 
> Yes I thought to create a static library of our project, but as we have 
> many IDE it will be an effort to do that. So I think that I found a 
> better solution as we already have a special build Developer for us, we 
> can simply add support of new application command line options to launch 
> it in automated test mode.
> 
> But if I do that will we able to launch tests directly from QtCreator as 
> suite tests or at least with a new running target (with correct launch 
> options)?

I think i see what you're trying to do, let's see:
- you have an (GUI) app that has built-in auto-tests
- you want these auto-test to be executed by QtC when you hit the "run 
all tests"
- your app needs extra parameter to tell it to run the auto-tests

If you're on Linux, you could add a shell script that has a name (and a 
path) compatible with QtC test scanner.
This shell script is as simple as:
----
#!/bin/sh
set -e
relative/path/to/app --run-auto-tests
----

But then your app will have to generate test results compatible with 
either QtTest or GoogleTest. I think they both generate junit files, so 
your app in auto-test mode has to generate junit files, that QtC will be 
able to parse and analyse.

Is it what you're trying to do?

Chris



More information about the Interest mailing list