Add a failing test case for #21620

Extend Qt(4|5)Autogen.RerunMocBasic to check the following situation:

Class MyObject3 is a QObject-derived class without Q_OBJECT macro.
It's declared in myobject3.h that is not included by any file that is
input of AutoMoc (this is why we had to add PlainObject).

If myobject3.h were included by main.cpp, then AutoMoc would already
track this dependency, because main.cpp has a Q_OBJECT macro.

After the initial build(s), the Q_OBJECT macro is added to myobject3.h,
and an incremental build is run. With Qt >= 5.15 and Ninja, the build
fails, because AutoMoc is not run due to the missing dependency to
myobject3.h.
This commit is contained in:
Joerg Bornemann
2020-12-23 14:21:24 +01:00
parent 2999c40dd9
commit fefba42e37
6 changed files with 61 additions and 2 deletions

View File

@@ -0,0 +1,12 @@
#include "plainobject.h"
#include "myobject3.h"
PlainObject::PlainObject()
{
}
void PlainObject::doSomething()
{
MyObject3 obj3;
}