[Qbs] How to reload a parent project after inserting a sub-project

Christian Kandeler Christian.Kandeler at qt.io
Mon Jul 8 12:22:24 CEST 2019

On Mon, 8 Jul 2019 22:13:48 +1200
Christian Gagneraud <chgans at gmail.com> wrote:

> On Mon, 8 Jul 2019 at 22:09, Christian Kandeler
> <Christian.Kandeler at qt.io> wrote:
> > I don't know what you mean by "simulating a full project reload". Lots of tst_api test cases do project reloads.  
> I just meant a convenience function that would handle:
>     project = qbs::Project();
>     job.reset(nullptr);
>     buildJob.reset(nullptr);
>     removeBuildDir(setupParams);
>     setupParams.setProjectFilePath(
>         QDir::cleanPath(m_workingDataDir +
> "/project-editing/toplevelproject.qbs"));
>     job.reset(project.setupProject(setupParams, m_logSink, nullptr));
>     waitForFinished(job.get());
>     QVERIFY2(!job->error().hasError(), qPrintable(job->error().toString()));
> So far, that how my "full reload" is implemented (read: copy/pasted),
> and i will want to do that b/w 5 and 10 times.

*shrug* Whatever you need there. But note that you cannot use any
QVERIFYs etc in such functions, as they won't be able to abort your test. Perhaps take a look at 
doBuildProject() for inspiration.


More information about the Qbs mailing list