Commit f5ccef17 authored by Sebastian Holtermann's avatar Sebastian Holtermann

Autogen: Extended mocInclude tests

The extended tests cover more AUTOMOC use cases.
parent a8d8d2fd
......@@ -22,6 +22,9 @@ if (QT_TEST_VERSION STREQUAL 4)
macro(qtx_wrap_cpp)
qt4_wrap_cpp(${ARGN})
endmacro()
macro(qtx_generate_moc)
qt4_generate_moc(${ARGN})
endmacro()
else()
if (NOT QT_TEST_VERSION STREQUAL 5)
......@@ -41,6 +44,9 @@ else()
macro(qtx_wrap_cpp)
qt5_wrap_cpp(${ARGN})
endmacro()
macro(qtx_generate_moc)
qt5_generate_moc(${ARGN})
endmacro()
endif()
......
#include "EObjA.hpp"
#include "EObjAExtra.hpp"
#include "EObjA_p.hpp"
class EObjALocal : public QObject
{
Q_OBJECT
public:
EObjALocal();
~EObjALocal();
};
EObjALocal::EObjALocal()
{
}
EObjALocal::~EObjALocal()
{
}
EObjAPrivate::EObjAPrivate()
{
EObjALocal localObj;
EObjAExtra extraObj;
}
EObjAPrivate::~EObjAPrivate()
{
}
EObjA::EObjA()
: d(new EObjAPrivate)
{
}
EObjA::~EObjA()
{
}
// For EObjALocal
#include "EObjA.moc"
// - Not the own header
#include "moc_EObjAExtra.cpp"
#ifndef EOBJA_HPP
#define EOBJA_HPP
#include <QObject>
// Sources includes a moc_ includes of an extra object
class EObjAPrivate;
class EObjA : public QObject
{
Q_OBJECT
public:
EObjA();
~EObjA();
private:
EObjAPrivate* const d;
};
#endif
#include "EObjAExtra.hpp"
#include "EObjAExtra_p.hpp"
EObjAExtraPrivate::EObjAExtraPrivate()
{
}
EObjAExtraPrivate::~EObjAExtraPrivate()
{
}
EObjAExtra::EObjAExtra()
: d(new EObjAExtraPrivate)
{
}
EObjAExtra::~EObjAExtra()
{
delete d;
}
#ifndef EOBJAEXTRA_HPP
#define EOBJAEXTRA_HPP
#include <QObject>
class EObjAExtraPrivate;
class EObjAExtra : public QObject
{
Q_OBJECT
public:
EObjAExtra();
~EObjAExtra();
private:
EObjAExtraPrivate* const d;
};
#endif
#ifndef EOBJAEXTRA_P_HPP
#define EOBJAEXTRA_P_HPP
class EObjAExtraPrivate : public QObject
{
Q_OBJECT
public:
EObjAExtraPrivate();
~EObjAExtraPrivate();
};
#endif
#ifndef EOBJA_P_HPP
#define EOBJA_P_HPP
class EObjAPrivate : public QObject
{
Q_OBJECT
public:
EObjAPrivate();
~EObjAPrivate();
};
#endif
#include "EObjB.hpp"
#include "EObjB_p.hpp"
#include "subExtra/EObjBExtra.hpp"
class EObjBLocal : public QObject
{
Q_OBJECT
public:
EObjBLocal();
~EObjBLocal();
};
EObjBLocal::EObjBLocal()
{
}
EObjBLocal::~EObjBLocal()
{
}
EObjBPrivate::EObjBPrivate()
{
EObjBLocal localObj;
EObjBExtra extraObj;
}
EObjBPrivate::~EObjBPrivate()
{
}
EObjB::EObjB()
: d(new EObjBPrivate)
{
}
EObjB::~EObjB()
{
}
// For EObjBLocal
#include "EObjB.moc"
// - Not the own header
// - in a subdirectory
#include "subExtra/moc_EObjBExtra.cpp"
#ifndef EOBJB_HPP
#define EOBJB_HPP
#include <QObject>
// Sources includes a moc_ includes of an extra object in a subdirectory
class EObjBPrivate;
class EObjB : public QObject
{
Q_OBJECT
public:
EObjB();
~EObjB();
private:
EObjBPrivate* const d;
};
#endif
#ifndef EOBJB_P_HPP
#define EOBJB_P_HPP
class EObjBPrivate : public QObject
{
Q_OBJECT
public:
EObjBPrivate();
~EObjBPrivate();
};
#endif
#include "LObjA.hpp"
#include "LObjA_p.h"
class LObjALocal : public QObject
{
Q_OBJECT
public:
LObjALocal();
~LObjALocal();
};
LObjALocal::LObjALocal()
{
}
LObjALocal::~LObjALocal()
{
}
LObjAPrivate::LObjAPrivate()
{
LObjALocal localObj;
}
LObjAPrivate::~LObjAPrivate()
{
}
LObjA::LObjA()
: d(new LObjAPrivate)
{
}
LObjA::~LObjA()
{
delete d;
}
#include "LObjA.moc"
#ifndef LOBJA_HPP
#define LOBJA_HPP
#include <QObject>
// Object source comes with a .moc include
class LObjAPrivate;
class LObjA : public QObject
{
Q_OBJECT
public:
LObjA();
~LObjA();
private:
LObjAPrivate* const d;
};
#endif
#ifndef LOBJA_P_HPP
#define LOBJA_P_HPP
class LObjAPrivate : public QObject
{
Q_OBJECT
public:
LObjAPrivate();
~LObjAPrivate();
};
#endif
#include "LObjB.hpp"
#include "LObjB_p.h"
class LObjBLocal : public QObject
{
Q_OBJECT
public:
LObjBLocal();
~LObjBLocal();
};
LObjBLocal::LObjBLocal()
{
}
LObjBLocal::~LObjBLocal()
{
}
LObjBPrivate::LObjBPrivate()
{
LObjBLocal localObj;
}
LObjBPrivate::~LObjBPrivate()
{
}
LObjB::LObjB()
: d(new LObjBPrivate)
{
}
LObjB::~LObjB()
{
delete d;
}
#include "LObjB.moc"
#include "moc_LObjB.cpp"
#ifndef LLObjB_HPP
#define LLObjB_HPP
#include <QObject>
// Object source comes with a .moc and a _moc include
class LObjBPrivate;
class LObjB : public QObject
{
Q_OBJECT
public:
LObjB();
~LObjB();
private:
LObjBPrivate* const d;
};
#endif
#ifndef LOBJB_P_HPP
#define LOBJB_P_HPP
class LObjBPrivate : public QObject
{
Q_OBJECT
public:
LObjBPrivate();
~LObjBPrivate();
};
#endif
#include "ObjA.hpp"
#include "ObjA_p.h"
class SubObjA : public QObject
ObjAPrivate::ObjAPrivate()
{
Q_OBJECT
public:
SubObjA() {}
~SubObjA() {}
Q_SLOT
void aSlot();
};
}
void SubObjA::aSlot()
ObjAPrivate::~ObjAPrivate()
{
}
void ObjA::go()
ObjA::ObjA()
: d(new ObjAPrivate)
{
SubObjA subObj;
}
#include "ObjA.moc"
ObjA::~ObjA()
{
delete d;
}
......@@ -3,11 +3,17 @@
#include <QObject>
// Object source comes without any _moc/.moc includes
class ObjAPrivate;
class ObjA : public QObject
{
Q_OBJECT
Q_SLOT
void go();
public:
ObjA();
~ObjA();
private:
ObjAPrivate* const d;
};
#endif
#ifndef OBJA_P_HPP
#define OBJA_P_HPP
class ObjAPrivate : public QObject
{
Q_OBJECT
public:
ObjAPrivate();
~ObjAPrivate();
};
#endif
#include "ObjB.hpp"
#include "ObjB_p.h"
class SubObjB : public QObject
ObjBPrivate::ObjBPrivate()
{
Q_OBJECT
public:
SubObjB() {}
~SubObjB() {}
}
Q_SLOT
void aSlot();
};
ObjBPrivate::~ObjBPrivate()
{
}
void SubObjB::aSlot()
ObjB::ObjB()
: d(new ObjBPrivate)
{
}
void ObjB::go()
ObjB::~ObjB()
{
SubObjB subObj;
delete d;
}
#include "ObjB.moc"
#include "moc_ObjB.cpp"
#ifndef OBJB_HPP
#define OBJB_HPP
#ifndef ObjB_HPP
#define ObjB_HPP
#include <QObject>
// Object source comes with a _moc include
class ObjBPrivate;
class ObjB : public QObject
{
Q_OBJECT
Q_SLOT
void go();
public:
ObjB();
~ObjB();
private:
ObjBPrivate* const d;
};
#endif
#ifndef OBJB_P_HPP
#define OBJB_P_HPP
class ObjBPrivate : public QObject
{
Q_OBJECT
public:
ObjBPrivate();
~ObjBPrivate();
};
#endif
#include "ObjC.hpp"
class SubObjC : public QObject
{
Q_OBJECT
public:
SubObjC() {}
~SubObjC() {}
Q_SLOT
void aSlot();
};
void SubObjC::aSlot()
{
}
void ObjC::go()
{
SubObjC subObj;
}
#include "ObjC.moc"
// Not the own header
#include "moc_ObjD.cpp"
#include "ObjD.hpp"
class SubObjD : public QObject
{
Q_OBJECT
public:
SubObjD() {}
~SubObjD() {}
Q_SLOT
void aSlot();
};
void SubObjD::aSlot()
{
}
void ObjD::go()
{
SubObjD subObj;
}
#include "ObjD.moc"
// Header in subdirectory
#include "subA/moc_SubObjA.cpp"
#include "SObjA.hpp"
SObjA::SObjA()
{
}
SObjA::~SObjA()
{
}
#include "SObjA.moc"
#ifndef SOBJA_HPP
#define SOBJA_HPP
#include <QObject>
// Object source includes externally generated .moc file
class SObjA : public QObject
{
Q_OBJECT
public:
SObjA();
~SObjA();
};
#endif
#include "SObjB.hpp"
SObjB::SObjB()
{
}
SObjB::~SObjB()
{
}
#include "SObjB.moc"
#ifndef SOBJB_HPP
#define SOBJB_HPP
#include <QObject>
// Object source includes externally generated .moc file
class SObjB : public QObject
{
Q_OBJECT
public:
SObjB();
~SObjB();
};
#endif
#include "SObjC.hpp"
void SObjCLocalFunction();
class SObjCLocal : public QObject
{
Q_OBJECT
public:
SObjCLocal();
~SObjCLocal();
};
SObjCLocal::SObjCLocal()
{
}
SObjCLocal::~SObjCLocal()
{
}
SObjC::SObjC()
{
SObjCLocal localObject;
SObjCLocalFunction();
}
SObjC::~SObjC()
{
}
#include "SObjC.moc"
#include "moc_SObjC.cpp"
// Include moc_ file for which the header is SKIP_AUTOMOC enabled
#include "moc_SObjCExtra.cpp"
#ifndef SOBJC_HPP
#define SOBJC_HPP
#include <QObject>
// Object source includes externally generated .moc file
class SObjC : public QObject
{
Q_OBJECT
public:
SObjC();
~SObjC();
};
#endif
#include "SObjCExtra.hpp"
class SObjCLocalExtra : public QObject
{
Q_OBJECT
public:
SObjCLocalExtra();
~SObjCLocalExtra();
};
SObjCLocalExtra::SObjCLocalExtra()
{
}
SObjCLocalExtra::~SObjCLocalExtra()
{
}
SObjCExtra::SObjCExtra()
{
}
SObjCExtra::~SObjCExtra()
{
}
// Externally generated header moc
#include "SObjCExtra_extMoc.cpp"
// AUTOMOC generated source moc
#include "SObjCExtra.moc"
#ifndef SOBJCEXTRA_HPP
#define SOBJCEXTRA_HPP
#include <QObject>
// Object source includes externally generated .moc file
class SObjCExtra : public QObject
{
Q_OBJECT
public:
SObjCExtra();
~SObjCExtra();
};
#endif