Jelajahi Sumber

Tests: Merge QtAutogen.MocIncludeStrict and MocIncludeRelaxed

Sebastian Holtermann 6 tahun lalu
induk
melakukan
706d9738a6
97 mengubah file dengan 1011 tambahan dan 896 penghapusan
  1. 112 0
      Tests/QtAutogen/MocInclude/CMakeLists.txt
  2. 11 0
      Tests/QtAutogen/MocInclude/Common/DualSub/Second/Second.cpp
  3. 14 0
      Tests/QtAutogen/MocInclude/Common/DualSub/Second/Second.hpp
  4. 9 0
      Tests/QtAutogen/MocInclude/Common/DualSubMocked.cpp
  5. 15 0
      Tests/QtAutogen/MocInclude/Common/DualSubMocked.hpp
  6. 11 0
      Tests/QtAutogen/MocInclude/Common/ExternDot.cpp
  7. 5 5
      Tests/QtAutogen/MocInclude/Common/ExternDot.hpp
  8. 11 0
      Tests/QtAutogen/MocInclude/Common/ExternDotGenerated.cpp.in
  9. 15 0
      Tests/QtAutogen/MocInclude/Common/ExternDotGenerated.hpp.in
  10. 43 0
      Tests/QtAutogen/MocInclude/Common/InIncludes.in/SubOwnDot.cpp
  11. 17 0
      Tests/QtAutogen/MocInclude/Common/InIncludes.in/SubOwnDot.hpp
  12. 18 0
      Tests/QtAutogen/MocInclude/Common/InIncludes.in/SubOwnDot_p.hpp
  13. 4 0
      Tests/QtAutogen/MocInclude/Common/InIncludesMoc.cpp
  14. 32 0
      Tests/QtAutogen/MocInclude/Common/MixedCustom.cpp
  15. 20 0
      Tests/QtAutogen/MocInclude/Common/MixedCustom.hpp
  16. 39 0
      Tests/QtAutogen/MocInclude/Common/MixedSkipped.cpp
  17. 17 0
      Tests/QtAutogen/MocInclude/Common/MixedSkipped.hpp
  18. 20 0
      Tests/QtAutogen/MocInclude/Common/None.cpp
  19. 19 0
      Tests/QtAutogen/MocInclude/Common/None.hpp
  20. 14 0
      Tests/QtAutogen/MocInclude/Common/None_p.h
  21. 44 0
      Tests/QtAutogen/MocInclude/Common/OtherUnderscore.cpp
  22. 19 0
      Tests/QtAutogen/MocInclude/Common/OtherUnderscore.hpp
  23. 20 0
      Tests/QtAutogen/MocInclude/Common/OtherUnderscoreExtra.cpp
  24. 18 0
      Tests/QtAutogen/MocInclude/Common/OtherUnderscoreExtra.hpp
  25. 14 0
      Tests/QtAutogen/MocInclude/Common/OtherUnderscoreExtra_p.hpp
  26. 45 0
      Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSub.cpp
  27. 19 0
      Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSub.hpp
  28. 20 0
      Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSubDir/SubExtra.cpp
  29. 18 0
      Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSubDir/SubExtra.hpp
  30. 14 0
      Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSubDir/SubExtra_p.hpp
  31. 14 0
      Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSub_p.hpp
  32. 14 0
      Tests/QtAutogen/MocInclude/Common/OtherUnderscore_p.hpp
  33. 39 0
      Tests/QtAutogen/MocInclude/Common/OwnDot.cpp
  34. 19 0
      Tests/QtAutogen/MocInclude/Common/OwnDot.hpp
  35. 40 0
      Tests/QtAutogen/MocInclude/Common/OwnDotUnderscore.cpp
  36. 19 0
      Tests/QtAutogen/MocInclude/Common/OwnDotUnderscore.hpp
  37. 14 0
      Tests/QtAutogen/MocInclude/Common/OwnDotUnderscore_p.h
  38. 14 0
      Tests/QtAutogen/MocInclude/Common/OwnDot_p.h
  39. 22 0
      Tests/QtAutogen/MocInclude/Common/OwnUnderscore.cpp
  40. 19 0
      Tests/QtAutogen/MocInclude/Common/OwnUnderscore.hpp
  41. 14 0
      Tests/QtAutogen/MocInclude/Common/OwnUnderscore_p.h
  42. 32 0
      Tests/QtAutogen/MocInclude/Common/common.cpp.in
  43. 5 0
      Tests/QtAutogen/MocInclude/Common/moc_MixedCustom.cpp.in
  44. 0 44
      Tests/QtAutogen/MocInclude/EObjA.cpp
  45. 0 19
      Tests/QtAutogen/MocInclude/EObjA.hpp
  46. 0 20
      Tests/QtAutogen/MocInclude/EObjAExtra.cpp
  47. 0 18
      Tests/QtAutogen/MocInclude/EObjAExtra.hpp
  48. 0 14
      Tests/QtAutogen/MocInclude/EObjAExtra_p.hpp
  49. 0 14
      Tests/QtAutogen/MocInclude/EObjA_p.hpp
  50. 0 45
      Tests/QtAutogen/MocInclude/EObjB.cpp
  51. 0 19
      Tests/QtAutogen/MocInclude/EObjB.hpp
  52. 0 14
      Tests/QtAutogen/MocInclude/EObjB_p.hpp
  53. 0 39
      Tests/QtAutogen/MocInclude/LObjA.cpp
  54. 0 19
      Tests/QtAutogen/MocInclude/LObjA.hpp
  55. 0 14
      Tests/QtAutogen/MocInclude/LObjA_p.h
  56. 0 40
      Tests/QtAutogen/MocInclude/LObjB.cpp
  57. 0 19
      Tests/QtAutogen/MocInclude/LObjB.hpp
  58. 0 14
      Tests/QtAutogen/MocInclude/LObjB_p.h
  59. 0 20
      Tests/QtAutogen/MocInclude/ObjA.cpp
  60. 0 19
      Tests/QtAutogen/MocInclude/ObjA.hpp
  61. 0 14
      Tests/QtAutogen/MocInclude/ObjA_p.h
  62. 0 22
      Tests/QtAutogen/MocInclude/ObjB.cpp
  63. 0 19
      Tests/QtAutogen/MocInclude/ObjB.hpp
  64. 0 14
      Tests/QtAutogen/MocInclude/ObjB_p.h
  65. 17 0
      Tests/QtAutogen/MocInclude/Relaxed/CMakeLists.txt
  66. 0 0
      Tests/QtAutogen/MocInclude/Relaxed/RObjA.cpp
  67. 0 0
      Tests/QtAutogen/MocInclude/Relaxed/RObjA.hpp
  68. 0 0
      Tests/QtAutogen/MocInclude/Relaxed/RObjB.cpp
  69. 0 0
      Tests/QtAutogen/MocInclude/Relaxed/RObjB.hpp
  70. 0 0
      Tests/QtAutogen/MocInclude/Relaxed/RObjBExtra.hpp
  71. 0 0
      Tests/QtAutogen/MocInclude/Relaxed/RObjC.cpp
  72. 0 0
      Tests/QtAutogen/MocInclude/Relaxed/RObjC.hpp
  73. 21 0
      Tests/QtAutogen/MocInclude/Relaxed/relaxed.cpp
  74. 0 11
      Tests/QtAutogen/MocInclude/SObjA.cpp
  75. 0 11
      Tests/QtAutogen/MocInclude/SObjB.cpp.in
  76. 0 15
      Tests/QtAutogen/MocInclude/SObjB.hpp.in
  77. 0 35
      Tests/QtAutogen/MocInclude/SObjC.cpp
  78. 0 15
      Tests/QtAutogen/MocInclude/SObjC.hpp
  79. 0 31
      Tests/QtAutogen/MocInclude/SObjCExtra.cpp
  80. 0 15
      Tests/QtAutogen/MocInclude/SObjCExtra.hpp
  81. 0 4
      Tests/QtAutogen/MocInclude/SObjCExtra.moc.in
  82. 14 0
      Tests/QtAutogen/MocInclude/Strict/CMakeLists.txt
  83. 7 0
      Tests/QtAutogen/MocInclude/Strict/strict.cpp
  84. 9 0
      Tests/QtAutogen/MocInclude/main.cpp
  85. 0 71
      Tests/QtAutogen/MocInclude/shared.cmake
  86. 0 20
      Tests/QtAutogen/MocInclude/subExtra/EObjBExtra.cpp
  87. 0 18
      Tests/QtAutogen/MocInclude/subExtra/EObjBExtra.hpp
  88. 0 14
      Tests/QtAutogen/MocInclude/subExtra/EObjBExtra_p.hpp
  89. 0 41
      Tests/QtAutogen/MocInclude/subGlobal/GObj.cpp
  90. 0 17
      Tests/QtAutogen/MocInclude/subGlobal/GObj.hpp
  91. 0 17
      Tests/QtAutogen/MocInclude/subGlobal/GObj_p.hpp
  92. 0 20
      Tests/QtAutogen/MocIncludeRelaxed/CMakeLists.txt
  93. 0 12
      Tests/QtAutogen/MocIncludeRelaxed/RMain.cpp
  94. 0 26
      Tests/QtAutogen/MocIncludeRelaxed/main.cpp
  95. 0 10
      Tests/QtAutogen/MocIncludeStrict/CMakeLists.txt
  96. 0 26
      Tests/QtAutogen/MocIncludeStrict/main.cpp
  97. 1 2
      Tests/QtAutogen/Tests.cmake

+ 112 - 0
Tests/QtAutogen/MocInclude/CMakeLists.txt

@@ -0,0 +1,112 @@
+cmake_minimum_required(VERSION 3.15)
+project(MocInclude)
+get_filename_component(CS_REAL ${CMAKE_CURRENT_SOURCE_DIR} REALPATH)
+include("${CS_REAL}/../AutogenCoreTest.cmake")
+
+# Test moc include patterns
+
+set(COM_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Common")
+
+macro(addCopyCommand from to)
+    add_custom_command(
+      OUTPUT ${to}
+      COMMAND ${CMAKE_COMMAND} -E copy ${from} ${to}
+      DEPENDS ${from})
+endmacro()
+
+# Create an executable
+function(makeExecutable TARGET_NAME)
+    # Utility variables
+    set(CB_DIR "${CMAKE_CURRENT_BINARY_DIR}")
+
+    # Copy directory
+    file(REMOVE_RECURSE "${CB_DIR}/InIncludes")
+    file(COPY "${COM_DIR}/InIncludes.in" DESTINATION "${CB_DIR}")
+    file(RENAME "${CB_DIR}/InIncludes.in" "${CB_DIR}/InIncludes")
+
+    # Generate .moc file from the header externally and
+    # enabled SKIP_AUTOMOC on the source file
+    qtx_wrap_cpp(ExternDotMOC ${COM_DIR}/ExternDot.hpp OPTIONS "-p" "./")
+    addCopyCommand(${ExternDotMOC}
+                   ${CB_DIR}/ExternDot.moc)
+    set_property(
+      SOURCE ${COM_DIR}/ExternDot.cpp
+      PROPERTY SKIP_AUTOMOC ON)
+
+    # Generate .moc file from the GENERATED header externally
+    # and enabled SKIP_AUTOMOC on the source file
+    addCopyCommand(${COM_DIR}/ExternDotGenerated.hpp.in
+                   ${CB_DIR}/ExternDotGenerated.hpp)
+    addCopyCommand(${COM_DIR}/ExternDotGenerated.cpp.in
+                   ${CB_DIR}/ExternDotGenerated.cpp)
+    qtx_wrap_cpp(ExternDotGeneratedMOC
+                 ${CB_DIR}/ExternDotGenerated.hpp
+                 OPTIONS "-p" "./")
+    addCopyCommand(${ExternDotGeneratedMOC}
+                   ${CB_DIR}/ExternDotGenerated.moc)
+    set_property(
+      SOURCE ${CB_DIR}/ExternDotGenerated.cpp
+      PROPERTY SKIP_AUTOMOC ON)
+
+    # Generate header moc file externally with a custom name
+    # and enabled SKIP_AUTOMOC on the header
+    qtx_wrap_cpp(MixedCustomMOC
+                 ${COM_DIR}/MixedCustom.hpp
+                 OPTIONS "-p" "./")
+    addCopyCommand(${MixedCustomMOC}
+                   ${CB_DIR}/MixedCustom_extMoc.cpp)
+    set_property(
+      SOURCE ${COM_DIR}/MixedCustom.hpp
+      PROPERTY SKIP_AUTOMOC ON)
+    # Custom target to depend on
+    add_custom_target("${TARGET_NAME}_MixedCustom"
+      DEPENDS ${CB_DIR}/MixedCustom_extMoc.cpp
+      BYPRODUCTS ${CB_DIR}/moc_MixedCustom.cpp
+      COMMAND ${CMAKE_COMMAND} -E copy
+        ${COM_DIR}/moc_MixedCustom.cpp.in
+        ${CB_DIR}/moc_MixedCustom.cpp)
+
+    add_executable(${TARGET_NAME}
+      # Test own "*.moc" and "moc_*.cpp" includes
+      ${COM_DIR}/None.cpp
+      ${COM_DIR}/OwnDot.cpp
+      ${COM_DIR}/OwnUnderscore.cpp
+      ${COM_DIR}/OwnDotUnderscore.cpp
+
+      # Test "moc_*.cpp" includes of other files
+      ${COM_DIR}/OtherUnderscore.cpp
+      ${COM_DIR}/OtherUnderscoreExtra.cpp
+      ${COM_DIR}/OtherUnderscoreSub.cpp
+      ${COM_DIR}/OtherUnderscoreSubDir/SubExtra.cpp
+
+      # Test relative ../../ path for moc includes
+      ${COM_DIR}/DualSub/Second/Second.cpp
+      ${COM_DIR}/DualSubMocked.cpp
+
+      # Test externally generated moc files
+      ${COM_DIR}/ExternDot.cpp
+      ${CB_DIR}/ExternDot.moc
+
+      # Test externally generated moc files for GENERATED source
+      ${CB_DIR}/ExternDotGenerated.cpp
+      ${CB_DIR}/ExternDotGenerated.moc
+
+      # Test externally generated moc files and SKIP_AUTOMOC enabled header
+      ${COM_DIR}/MixedSkipped.cpp
+      ${COM_DIR}/MixedCustom.hpp
+      ${COM_DIR}/MixedCustom.cpp
+
+      # Test sources in a subdirectory
+      ${CB_DIR}/InIncludes/SubOwnDot.cpp
+      ${COM_DIR}/InIncludesMoc.cpp
+    )
+    add_dependencies(${TARGET_NAME} "${TARGET_NAME}_MixedCustom")
+    target_include_directories(${TARGET_NAME} PRIVATE "${COM_DIR}")
+    target_include_directories(${TARGET_NAME} PRIVATE "${CB_DIR}")
+    target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
+    target_link_libraries(${TARGET_NAME} ${QT_LIBRARIES})
+    set_target_properties(${TARGET_NAME} PROPERTIES AUTOMOC ON)
+endfunction()
+
+add_subdirectory(Strict)
+add_subdirectory(Relaxed)

+ 11 - 0
Tests/QtAutogen/MocInclude/Common/DualSub/Second/Second.cpp

@@ -0,0 +1,11 @@
+#include "Second.hpp"
+
+Second::Second()
+{
+}
+
+Second::~Second()
+{
+}
+
+#include "../../moc_DualSubMocked.cpp"

+ 14 - 0
Tests/QtAutogen/MocInclude/Common/DualSub/Second/Second.hpp

@@ -0,0 +1,14 @@
+#ifndef Second_HPP
+#define Second_HPP
+
+#include <QObject>
+
+class Second : public QObject
+{
+  Q_OBJECT
+public:
+  Second();
+  ~Second();
+};
+
+#endif

+ 9 - 0
Tests/QtAutogen/MocInclude/Common/DualSubMocked.cpp

@@ -0,0 +1,9 @@
+#include "DualSubMocked.hpp"
+
+DualSubMocked::DualSubMocked()
+{
+}
+
+DualSubMocked::~DualSubMocked()
+{
+}

+ 15 - 0
Tests/QtAutogen/MocInclude/Common/DualSubMocked.hpp

@@ -0,0 +1,15 @@
+#ifndef DualSubMocked_HPP
+#define DualSubMocked_HPP
+
+#include <QObject>
+
+// Header moc file is included by DualSub/Second/Second.cpp
+class DualSubMocked : public QObject
+{
+  Q_OBJECT
+public:
+  DualSubMocked();
+  ~DualSubMocked();
+};
+
+#endif

+ 11 - 0
Tests/QtAutogen/MocInclude/Common/ExternDot.cpp

@@ -0,0 +1,11 @@
+#include "ExternDot.hpp"
+
+ExternDot::ExternDot()
+{
+}
+
+ExternDot::~ExternDot()
+{
+}
+
+#include "ExternDot.moc"

+ 5 - 5
Tests/QtAutogen/MocInclude/SObjA.hpp → Tests/QtAutogen/MocInclude/Common/ExternDot.hpp

@@ -1,15 +1,15 @@
-#ifndef SOBJA_HPP
-#define SOBJA_HPP
+#ifndef ExternDot_HPP
+#define ExternDot_HPP
 
 #include <QObject>
 
 // Object source includes externally generated .moc file
-class SObjA : public QObject
+class ExternDot : public QObject
 {
   Q_OBJECT
 public:
-  SObjA();
-  ~SObjA();
+  ExternDot();
+  ~ExternDot();
 };
 
 #endif

+ 11 - 0
Tests/QtAutogen/MocInclude/Common/ExternDotGenerated.cpp.in

@@ -0,0 +1,11 @@
+#include "ExternDotGenerated.hpp"
+
+ExternDotGenerated::ExternDotGenerated()
+{
+}
+
+ExternDotGenerated::~ExternDotGenerated()
+{
+}
+
+#include "ExternDotGenerated.moc"

+ 15 - 0
Tests/QtAutogen/MocInclude/Common/ExternDotGenerated.hpp.in

@@ -0,0 +1,15 @@
+#ifndef ExternDotGenerated_HPP
+#define ExternDotGenerated_HPP
+
+#include <QObject>
+
+// GENERATED Object source includes externally generated .moc file
+class ExternDotGenerated : public QObject
+{
+  Q_OBJECT
+public:
+  ExternDotGenerated();
+  ~ExternDotGenerated();
+};
+
+#endif

+ 43 - 0
Tests/QtAutogen/MocInclude/Common/InIncludes.in/SubOwnDot.cpp

@@ -0,0 +1,43 @@
+#include "SubOwnDot.hpp"
+#include "SubOwnDot_p.hpp"
+
+namespace InIncludes {
+
+class SubOwnDotLocal : public QObject
+{
+  Q_OBJECT
+public:
+  SubOwnDotLocal();
+  ~SubOwnDotLocal();
+};
+
+SubOwnDotLocal::SubOwnDotLocal()
+{
+}
+
+SubOwnDotLocal::~SubOwnDotLocal()
+{
+}
+
+SubOwnDotPrivate::SubOwnDotPrivate()
+{
+}
+
+SubOwnDotPrivate::~SubOwnDotPrivate()
+{
+}
+
+SubOwnDot::SubOwnDot()
+{
+  SubOwnDotPrivate privateObj;
+  SubOwnDotLocal localObj;
+}
+
+SubOwnDot::~SubOwnDot()
+{
+}
+
+} // End of namespace
+
+// For the local QObject
+#include "SubOwnDot.moc"

+ 17 - 0
Tests/QtAutogen/MocInclude/Common/InIncludes.in/SubOwnDot.hpp

@@ -0,0 +1,17 @@
+#ifndef InIncludes_SubOwnDot_HPP
+#define InIncludes_SubOwnDot_HPP
+
+#include <QObject>
+
+namespace InIncludes {
+
+class SubOwnDot : public QObject
+{
+  Q_OBJECT
+public:
+  SubOwnDot();
+  ~SubOwnDot();
+};
+}
+
+#endif

+ 18 - 0
Tests/QtAutogen/MocInclude/Common/InIncludes.in/SubOwnDot_p.hpp

@@ -0,0 +1,18 @@
+#ifndef InIncludes_SubOwnDot_P_HPP
+#define InIncludes_SubOwnDot_P_HPP
+
+#include <QObject>
+
+namespace InIncludes {
+
+class SubOwnDotPrivate : public QObject
+{
+  Q_OBJECT
+public:
+  SubOwnDotPrivate();
+  ~SubOwnDotPrivate();
+};
+
+} // End of namespace
+
+#endif

+ 4 - 0
Tests/QtAutogen/MocInclude/Common/InIncludesMoc.cpp

@@ -0,0 +1,4 @@
+
+// Moc a header that is not in the sources but in a directory that
+// is in the list of include directories.
+#include "InIncludes/moc_SubOwnDot.cpp"

+ 32 - 0
Tests/QtAutogen/MocInclude/Common/MixedCustom.cpp

@@ -0,0 +1,32 @@
+#include "MixedCustom.hpp"
+
+class MixedCustomLocal : public QObject
+{
+  Q_OBJECT
+
+public:
+  MixedCustomLocal();
+  ~MixedCustomLocal();
+};
+
+MixedCustomLocal::MixedCustomLocal()
+{
+}
+
+MixedCustomLocal::~MixedCustomLocal()
+{
+}
+
+MixedCustom::MixedCustom()
+{
+  MixedCustomLocal local;
+}
+
+MixedCustom::~MixedCustom()
+{
+}
+
+// AUTOMOC generated source moc
+#include "MixedCustom.moc"
+// Externally generated header moc
+#include "MixedCustom_extMoc.cpp"

+ 20 - 0
Tests/QtAutogen/MocInclude/Common/MixedCustom.hpp

@@ -0,0 +1,20 @@
+#ifndef MixedCustom_HPP
+#define MixedCustom_HPP
+
+#include <QObject>
+
+// Object source includes
+// - externally generated header moc file
+// - AUTOMOC generated source .moc file
+class MixedCustom : public QObject
+{
+  Q_OBJECT
+public:
+  MixedCustom();
+  ~MixedCustom();
+};
+
+// Function forward declaration
+void moc_MixedCustom(MixedCustom const& arg);
+
+#endif

+ 39 - 0
Tests/QtAutogen/MocInclude/Common/MixedSkipped.cpp

@@ -0,0 +1,39 @@
+#include "MixedSkipped.hpp"
+#include "MixedCustom.hpp"
+
+class MixedSkippedLocal : public QObject
+{
+  Q_OBJECT
+
+public:
+  MixedSkippedLocal();
+  ~MixedSkippedLocal();
+};
+
+MixedSkippedLocal::MixedSkippedLocal()
+{
+}
+
+MixedSkippedLocal::~MixedSkippedLocal()
+{
+}
+
+MixedSkipped::MixedSkipped()
+{
+  MixedSkippedLocal local;
+  MixedCustom externCutom;
+  // Call moc named function
+  moc_MixedCustom(externCutom);
+}
+
+MixedSkipped::~MixedSkipped()
+{
+}
+
+// Include AUTOMOC generated moc files
+#include "MixedSkipped.moc"
+#include "moc_MixedSkipped.cpp"
+
+// Include externally generated moc_ named file that is not a moc file
+// and for which the relevant header is SKIP_AUTOMOC enabled
+#include "moc_MixedCustom.cpp"

+ 17 - 0
Tests/QtAutogen/MocInclude/Common/MixedSkipped.hpp

@@ -0,0 +1,17 @@
+#ifndef MixedSkipped_HPP
+#define MixedSkipped_HPP
+
+#include <QObject>
+
+// Object source includes
+// - Own moc_ and .moc files.
+// - externally generated moc_ file from a SKIP_AUTOMOC enabled header
+class MixedSkipped : public QObject
+{
+  Q_OBJECT
+public:
+  MixedSkipped();
+  ~MixedSkipped();
+};
+
+#endif

+ 20 - 0
Tests/QtAutogen/MocInclude/Common/None.cpp

@@ -0,0 +1,20 @@
+#include "None.hpp"
+#include "None_p.h"
+
+NonePrivate::NonePrivate()
+{
+}
+
+NonePrivate::~NonePrivate()
+{
+}
+
+None::None()
+  : d(new NonePrivate)
+{
+}
+
+None::~None()
+{
+  delete d;
+}

+ 19 - 0
Tests/QtAutogen/MocInclude/Common/None.hpp

@@ -0,0 +1,19 @@
+#ifndef None_HPP
+#define None_HPP
+
+#include <QObject>
+
+// Object source comes without any _moc/.moc includes
+class NonePrivate;
+class None : public QObject
+{
+  Q_OBJECT
+public:
+  None();
+  ~None();
+
+private:
+  NonePrivate* const d;
+};
+
+#endif

+ 14 - 0
Tests/QtAutogen/MocInclude/Common/None_p.h

@@ -0,0 +1,14 @@
+#ifndef None_P_HPP
+#define None_P_HPP
+
+#include <QObject>
+
+class NonePrivate : public QObject
+{
+  Q_OBJECT
+public:
+  NonePrivate();
+  ~NonePrivate();
+};
+
+#endif

+ 44 - 0
Tests/QtAutogen/MocInclude/Common/OtherUnderscore.cpp

@@ -0,0 +1,44 @@
+#include "OtherUnderscore.hpp"
+#include "OtherUnderscoreExtra.hpp"
+#include "OtherUnderscore_p.hpp"
+
+class OtherUnderscoreLocal : public QObject
+{
+  Q_OBJECT
+public:
+  OtherUnderscoreLocal();
+  ~OtherUnderscoreLocal();
+};
+
+OtherUnderscoreLocal::OtherUnderscoreLocal()
+{
+}
+
+OtherUnderscoreLocal::~OtherUnderscoreLocal()
+{
+}
+
+OtherUnderscorePrivate::OtherUnderscorePrivate()
+{
+  OtherUnderscoreLocal localObj;
+  OtherUnderscoreExtra extraObj;
+}
+
+OtherUnderscorePrivate::~OtherUnderscorePrivate()
+{
+}
+
+OtherUnderscore::OtherUnderscore()
+  : d(new OtherUnderscorePrivate)
+{
+}
+
+OtherUnderscore::~OtherUnderscore()
+{
+  delete d;
+}
+
+// For OtherUnderscoreLocal
+#include "OtherUnderscore.moc"
+// - Not the own header
+#include "moc_OtherUnderscoreExtra.cpp"

+ 19 - 0
Tests/QtAutogen/MocInclude/Common/OtherUnderscore.hpp

@@ -0,0 +1,19 @@
+#ifndef OtherUnderscore_HPP
+#define OtherUnderscore_HPP
+
+#include <QObject>
+
+// Sources includes a moc_ includes of an extra object
+class OtherUnderscorePrivate;
+class OtherUnderscore : public QObject
+{
+  Q_OBJECT
+public:
+  OtherUnderscore();
+  ~OtherUnderscore();
+
+private:
+  OtherUnderscorePrivate* const d;
+};
+
+#endif

+ 20 - 0
Tests/QtAutogen/MocInclude/Common/OtherUnderscoreExtra.cpp

@@ -0,0 +1,20 @@
+#include "OtherUnderscoreExtra.hpp"
+#include "OtherUnderscoreExtra_p.hpp"
+
+OtherUnderscoreExtraPrivate::OtherUnderscoreExtraPrivate()
+{
+}
+
+OtherUnderscoreExtraPrivate::~OtherUnderscoreExtraPrivate()
+{
+}
+
+OtherUnderscoreExtra::OtherUnderscoreExtra()
+  : d(new OtherUnderscoreExtraPrivate)
+{
+}
+
+OtherUnderscoreExtra::~OtherUnderscoreExtra()
+{
+  delete d;
+}

+ 18 - 0
Tests/QtAutogen/MocInclude/Common/OtherUnderscoreExtra.hpp

@@ -0,0 +1,18 @@
+#ifndef OtherUnderscoreEXTRA_HPP
+#define OtherUnderscoreEXTRA_HPP
+
+#include <QObject>
+
+class OtherUnderscoreExtraPrivate;
+class OtherUnderscoreExtra : public QObject
+{
+  Q_OBJECT
+public:
+  OtherUnderscoreExtra();
+  ~OtherUnderscoreExtra();
+
+private:
+  OtherUnderscoreExtraPrivate* const d;
+};
+
+#endif

+ 14 - 0
Tests/QtAutogen/MocInclude/Common/OtherUnderscoreExtra_p.hpp

@@ -0,0 +1,14 @@
+#ifndef OtherUnderscoreEXTRA_P_HPP
+#define OtherUnderscoreEXTRA_P_HPP
+
+#include <QObject>
+
+class OtherUnderscoreExtraPrivate : public QObject
+{
+  Q_OBJECT
+public:
+  OtherUnderscoreExtraPrivate();
+  ~OtherUnderscoreExtraPrivate();
+};
+
+#endif

+ 45 - 0
Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSub.cpp

@@ -0,0 +1,45 @@
+#include "OtherUnderscoreSub.hpp"
+#include "OtherUnderscoreSubDir/SubExtra.hpp"
+#include "OtherUnderscoreSub_p.hpp"
+
+class OtherUnderscoreSubLocal : public QObject
+{
+  Q_OBJECT
+public:
+  OtherUnderscoreSubLocal();
+  ~OtherUnderscoreSubLocal();
+};
+
+OtherUnderscoreSubLocal::OtherUnderscoreSubLocal()
+{
+}
+
+OtherUnderscoreSubLocal::~OtherUnderscoreSubLocal()
+{
+}
+
+OtherUnderscoreSubPrivate::OtherUnderscoreSubPrivate()
+{
+  OtherUnderscoreSubLocal localObj;
+  SubExtra extraObj;
+}
+
+OtherUnderscoreSubPrivate::~OtherUnderscoreSubPrivate()
+{
+}
+
+OtherUnderscoreSub::OtherUnderscoreSub()
+  : d(new OtherUnderscoreSubPrivate)
+{
+}
+
+OtherUnderscoreSub::~OtherUnderscoreSub()
+{
+  delete d;
+}
+
+// For OtherUnderscoreSubLocal
+#include "OtherUnderscoreSub.moc"
+// - Not the own header
+// - in a subdirectory
+#include "OtherUnderscoreSubDir/moc_SubExtra.cpp"

+ 19 - 0
Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSub.hpp

@@ -0,0 +1,19 @@
+#ifndef OtherUnderscoreSub_HPP
+#define OtherUnderscoreSub_HPP
+
+#include <QObject>
+
+// Sources includes a moc_ includes of an extra object in a subdirectory
+class OtherUnderscoreSubPrivate;
+class OtherUnderscoreSub : public QObject
+{
+  Q_OBJECT
+public:
+  OtherUnderscoreSub();
+  ~OtherUnderscoreSub();
+
+private:
+  OtherUnderscoreSubPrivate* const d;
+};
+
+#endif

+ 20 - 0
Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSubDir/SubExtra.cpp

@@ -0,0 +1,20 @@
+#include "SubExtra.hpp"
+#include "SubExtra_p.hpp"
+
+SubExtraPrivate::SubExtraPrivate()
+{
+}
+
+SubExtraPrivate::~SubExtraPrivate()
+{
+}
+
+SubExtra::SubExtra()
+  : d(new SubExtraPrivate)
+{
+}
+
+SubExtra::~SubExtra()
+{
+  delete d;
+}

+ 18 - 0
Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSubDir/SubExtra.hpp

@@ -0,0 +1,18 @@
+#ifndef SubExtra_HPP
+#define SubExtra_HPP
+
+#include <QObject>
+
+class SubExtraPrivate;
+class SubExtra : public QObject
+{
+  Q_OBJECT
+public:
+  SubExtra();
+  ~SubExtra();
+
+private:
+  SubExtraPrivate* const d;
+};
+
+#endif

+ 14 - 0
Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSubDir/SubExtra_p.hpp

@@ -0,0 +1,14 @@
+#ifndef SubExtra_P_HPP
+#define SubExtra_P_HPP
+
+#include <QObject>
+
+class SubExtraPrivate : public QObject
+{
+  Q_OBJECT
+public:
+  SubExtraPrivate();
+  ~SubExtraPrivate();
+};
+
+#endif

+ 14 - 0
Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSub_p.hpp

@@ -0,0 +1,14 @@
+#ifndef OtherUnderscoreSub_P_HPP
+#define OtherUnderscoreSub_P_HPP
+
+#include <QObject>
+
+class OtherUnderscoreSubPrivate : public QObject
+{
+  Q_OBJECT
+public:
+  OtherUnderscoreSubPrivate();
+  ~OtherUnderscoreSubPrivate();
+};
+
+#endif

+ 14 - 0
Tests/QtAutogen/MocInclude/Common/OtherUnderscore_p.hpp

@@ -0,0 +1,14 @@
+#ifndef OtherUnderscore_P_HPP
+#define OtherUnderscore_P_HPP
+
+#include <QObject>
+
+class OtherUnderscorePrivate : public QObject
+{
+  Q_OBJECT
+public:
+  OtherUnderscorePrivate();
+  ~OtherUnderscorePrivate();
+};
+
+#endif

+ 39 - 0
Tests/QtAutogen/MocInclude/Common/OwnDot.cpp

@@ -0,0 +1,39 @@
+#include "OwnDot.hpp"
+#include "OwnDot_p.h"
+
+class OwnDotLocal : public QObject
+{
+  Q_OBJECT
+public:
+  OwnDotLocal();
+  ~OwnDotLocal();
+};
+
+OwnDotLocal::OwnDotLocal()
+{
+}
+
+OwnDotLocal::~OwnDotLocal()
+{
+}
+
+OwnDotPrivate::OwnDotPrivate()
+{
+  OwnDotLocal localObj;
+}
+
+OwnDotPrivate::~OwnDotPrivate()
+{
+}
+
+OwnDot::OwnDot()
+  : d(new OwnDotPrivate)
+{
+}
+
+OwnDot::~OwnDot()
+{
+  delete d;
+}
+
+#include "OwnDot.moc"

+ 19 - 0
Tests/QtAutogen/MocInclude/Common/OwnDot.hpp

@@ -0,0 +1,19 @@
+#ifndef OwnDot_HPP
+#define OwnDot_HPP
+
+#include <QObject>
+
+// Object source comes with a .moc include
+class OwnDotPrivate;
+class OwnDot : public QObject
+{
+  Q_OBJECT
+public:
+  OwnDot();
+  ~OwnDot();
+
+private:
+  OwnDotPrivate* const d;
+};
+
+#endif

+ 40 - 0
Tests/QtAutogen/MocInclude/Common/OwnDotUnderscore.cpp

@@ -0,0 +1,40 @@
+#include "OwnDotUnderscore.hpp"
+#include "OwnDotUnderscore_p.h"
+
+class OwnDotUnderscoreLocal : public QObject
+{
+  Q_OBJECT
+public:
+  OwnDotUnderscoreLocal();
+  ~OwnDotUnderscoreLocal();
+};
+
+OwnDotUnderscoreLocal::OwnDotUnderscoreLocal()
+{
+}
+
+OwnDotUnderscoreLocal::~OwnDotUnderscoreLocal()
+{
+}
+
+OwnDotUnderscorePrivate::OwnDotUnderscorePrivate()
+{
+  OwnDotUnderscoreLocal localObj;
+}
+
+OwnDotUnderscorePrivate::~OwnDotUnderscorePrivate()
+{
+}
+
+OwnDotUnderscore::OwnDotUnderscore()
+  : d(new OwnDotUnderscorePrivate)
+{
+}
+
+OwnDotUnderscore::~OwnDotUnderscore()
+{
+  delete d;
+}
+
+#include "OwnDotUnderscore.moc"
+#include "moc_OwnDotUnderscore.cpp"

+ 19 - 0
Tests/QtAutogen/MocInclude/Common/OwnDotUnderscore.hpp

@@ -0,0 +1,19 @@
+#ifndef LOwnDotUnderscore_HPP
+#define LOwnDotUnderscore_HPP
+
+#include <QObject>
+
+// Object source comes with a .moc and a _moc include
+class OwnDotUnderscorePrivate;
+class OwnDotUnderscore : public QObject
+{
+  Q_OBJECT
+public:
+  OwnDotUnderscore();
+  ~OwnDotUnderscore();
+
+private:
+  OwnDotUnderscorePrivate* const d;
+};
+
+#endif

+ 14 - 0
Tests/QtAutogen/MocInclude/Common/OwnDotUnderscore_p.h

@@ -0,0 +1,14 @@
+#ifndef OwnDotUnderscore_P_HPP
+#define OwnDotUnderscore_P_HPP
+
+#include <QObject>
+
+class OwnDotUnderscorePrivate : public QObject
+{
+  Q_OBJECT
+public:
+  OwnDotUnderscorePrivate();
+  ~OwnDotUnderscorePrivate();
+};
+
+#endif

+ 14 - 0
Tests/QtAutogen/MocInclude/Common/OwnDot_p.h

@@ -0,0 +1,14 @@
+#ifndef OwnDot_P_HPP
+#define OwnDot_P_HPP
+
+#include <QObject>
+
+class OwnDotPrivate : public QObject
+{
+  Q_OBJECT
+public:
+  OwnDotPrivate();
+  ~OwnDotPrivate();
+};
+
+#endif

+ 22 - 0
Tests/QtAutogen/MocInclude/Common/OwnUnderscore.cpp

@@ -0,0 +1,22 @@
+#include "OwnUnderscore.hpp"
+#include "OwnUnderscore_p.h"
+
+OwnUnderscorePrivate::OwnUnderscorePrivate()
+{
+}
+
+OwnUnderscorePrivate::~OwnUnderscorePrivate()
+{
+}
+
+OwnUnderscore::OwnUnderscore()
+  : d(new OwnUnderscorePrivate)
+{
+}
+
+OwnUnderscore::~OwnUnderscore()
+{
+  delete d;
+}
+
+#include "moc_OwnUnderscore.cpp"

+ 19 - 0
Tests/QtAutogen/MocInclude/Common/OwnUnderscore.hpp

@@ -0,0 +1,19 @@
+#ifndef OwnUnderscore_HPP
+#define OwnUnderscore_HPP
+
+#include <QObject>
+
+// Object source comes with a _moc include
+class OwnUnderscorePrivate;
+class OwnUnderscore : public QObject
+{
+  Q_OBJECT
+public:
+  OwnUnderscore();
+  ~OwnUnderscore();
+
+private:
+  OwnUnderscorePrivate* const d;
+};
+
+#endif

+ 14 - 0
Tests/QtAutogen/MocInclude/Common/OwnUnderscore_p.h

@@ -0,0 +1,14 @@
+#ifndef OwnUnderscore_P_HPP
+#define OwnUnderscore_P_HPP
+
+#include <QObject>
+
+class OwnUnderscorePrivate : public QObject
+{
+  Q_OBJECT
+public:
+  OwnUnderscorePrivate();
+  ~OwnUnderscorePrivate();
+};
+
+#endif

+ 32 - 0
Tests/QtAutogen/MocInclude/Common/common.cpp.in

@@ -0,0 +1,32 @@
+#include "DualSub/Second/Second.hpp"
+#include "DualSubMocked.hpp"
+#include "ExternDot.hpp"
+#include "ExternDotGenerated.hpp"
+#include "None.hpp"
+#include "OtherUnderscore.hpp"
+#include "OtherUnderscoreSub.hpp"
+#include "OwnDot.hpp"
+#include "OwnDotUnderscore.hpp"
+#include "OwnUnderscore.hpp"
+#include "InIncludes/SubOwnDot.hpp"
+
+bool @COMMON_FUNCTION_NAME@()
+{
+  None objNone;
+  OwnUnderscore objOwnUnderscore;
+  OwnDot objOwnDot;
+  OwnDotUnderscore objOwnDotUnderscore;
+
+  OtherUnderscore objOtherUnderscore;
+  OtherUnderscoreSub objOtherUnderscoreSub;
+
+  Second second;
+  DualSubMocked dualSubMocked;
+
+  ExternDot objExternDot;
+  ExternDotGenerated objGeneratedExternDot;
+
+  InIncludes::SubOwnDot subOwnDot;
+
+  return true;
+}

+ 5 - 0
Tests/QtAutogen/MocInclude/Common/moc_MixedCustom.cpp.in

@@ -0,0 +1,5 @@
+
+void moc_MixedCustom(MixedCustom const & arg)
+{
+    (void)arg;
+}

+ 0 - 44
Tests/QtAutogen/MocInclude/EObjA.cpp

@@ -1,44 +0,0 @@
-#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()
-{
-  delete d;
-}
-
-// For EObjALocal
-#include "EObjA.moc"
-// - Not the own header
-#include "moc_EObjAExtra.cpp"

+ 0 - 19
Tests/QtAutogen/MocInclude/EObjA.hpp

@@ -1,19 +0,0 @@
-#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

+ 0 - 20
Tests/QtAutogen/MocInclude/EObjAExtra.cpp

@@ -1,20 +0,0 @@
-#include "EObjAExtra.hpp"
-#include "EObjAExtra_p.hpp"
-
-EObjAExtraPrivate::EObjAExtraPrivate()
-{
-}
-
-EObjAExtraPrivate::~EObjAExtraPrivate()
-{
-}
-
-EObjAExtra::EObjAExtra()
-  : d(new EObjAExtraPrivate)
-{
-}
-
-EObjAExtra::~EObjAExtra()
-{
-  delete d;
-}

+ 0 - 18
Tests/QtAutogen/MocInclude/EObjAExtra.hpp

@@ -1,18 +0,0 @@
-#ifndef EOBJAEXTRA_HPP
-#define EOBJAEXTRA_HPP
-
-#include <QObject>
-
-class EObjAExtraPrivate;
-class EObjAExtra : public QObject
-{
-  Q_OBJECT
-public:
-  EObjAExtra();
-  ~EObjAExtra();
-
-private:
-  EObjAExtraPrivate* const d;
-};
-
-#endif

+ 0 - 14
Tests/QtAutogen/MocInclude/EObjAExtra_p.hpp

@@ -1,14 +0,0 @@
-#ifndef EOBJAEXTRA_P_HPP
-#define EOBJAEXTRA_P_HPP
-
-#include <QObject>
-
-class EObjAExtraPrivate : public QObject
-{
-  Q_OBJECT
-public:
-  EObjAExtraPrivate();
-  ~EObjAExtraPrivate();
-};
-
-#endif

+ 0 - 14
Tests/QtAutogen/MocInclude/EObjA_p.hpp

@@ -1,14 +0,0 @@
-#ifndef EOBJA_P_HPP
-#define EOBJA_P_HPP
-
-#include <QObject>
-
-class EObjAPrivate : public QObject
-{
-  Q_OBJECT
-public:
-  EObjAPrivate();
-  ~EObjAPrivate();
-};
-
-#endif

+ 0 - 45
Tests/QtAutogen/MocInclude/EObjB.cpp

@@ -1,45 +0,0 @@
-#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()
-{
-  delete d;
-}
-
-// For EObjBLocal
-#include "EObjB.moc"
-// - Not the own header
-// - in a subdirectory
-#include "subExtra/moc_EObjBExtra.cpp"

+ 0 - 19
Tests/QtAutogen/MocInclude/EObjB.hpp

@@ -1,19 +0,0 @@
-#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

+ 0 - 14
Tests/QtAutogen/MocInclude/EObjB_p.hpp

@@ -1,14 +0,0 @@
-#ifndef EOBJB_P_HPP
-#define EOBJB_P_HPP
-
-#include <QObject>
-
-class EObjBPrivate : public QObject
-{
-  Q_OBJECT
-public:
-  EObjBPrivate();
-  ~EObjBPrivate();
-};
-
-#endif

+ 0 - 39
Tests/QtAutogen/MocInclude/LObjA.cpp

@@ -1,39 +0,0 @@
-#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"

+ 0 - 19
Tests/QtAutogen/MocInclude/LObjA.hpp

@@ -1,19 +0,0 @@
-#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

+ 0 - 14
Tests/QtAutogen/MocInclude/LObjA_p.h

@@ -1,14 +0,0 @@
-#ifndef LOBJA_P_HPP
-#define LOBJA_P_HPP
-
-#include <QObject>
-
-class LObjAPrivate : public QObject
-{
-  Q_OBJECT
-public:
-  LObjAPrivate();
-  ~LObjAPrivate();
-};
-
-#endif

+ 0 - 40
Tests/QtAutogen/MocInclude/LObjB.cpp

@@ -1,40 +0,0 @@
-#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"

+ 0 - 19
Tests/QtAutogen/MocInclude/LObjB.hpp

@@ -1,19 +0,0 @@
-#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

+ 0 - 14
Tests/QtAutogen/MocInclude/LObjB_p.h

@@ -1,14 +0,0 @@
-#ifndef LOBJB_P_HPP
-#define LOBJB_P_HPP
-
-#include <QObject>
-
-class LObjBPrivate : public QObject
-{
-  Q_OBJECT
-public:
-  LObjBPrivate();
-  ~LObjBPrivate();
-};
-
-#endif

+ 0 - 20
Tests/QtAutogen/MocInclude/ObjA.cpp

@@ -1,20 +0,0 @@
-#include "ObjA.hpp"
-#include "ObjA_p.h"
-
-ObjAPrivate::ObjAPrivate()
-{
-}
-
-ObjAPrivate::~ObjAPrivate()
-{
-}
-
-ObjA::ObjA()
-  : d(new ObjAPrivate)
-{
-}
-
-ObjA::~ObjA()
-{
-  delete d;
-}

+ 0 - 19
Tests/QtAutogen/MocInclude/ObjA.hpp

@@ -1,19 +0,0 @@
-#ifndef OBJA_HPP
-#define OBJA_HPP
-
-#include <QObject>
-
-// Object source comes without any _moc/.moc includes
-class ObjAPrivate;
-class ObjA : public QObject
-{
-  Q_OBJECT
-public:
-  ObjA();
-  ~ObjA();
-
-private:
-  ObjAPrivate* const d;
-};
-
-#endif

+ 0 - 14
Tests/QtAutogen/MocInclude/ObjA_p.h

@@ -1,14 +0,0 @@
-#ifndef OBJA_P_HPP
-#define OBJA_P_HPP
-
-#include <QObject>
-
-class ObjAPrivate : public QObject
-{
-  Q_OBJECT
-public:
-  ObjAPrivate();
-  ~ObjAPrivate();
-};
-
-#endif

+ 0 - 22
Tests/QtAutogen/MocInclude/ObjB.cpp

@@ -1,22 +0,0 @@
-#include "ObjB.hpp"
-#include "ObjB_p.h"
-
-ObjBPrivate::ObjBPrivate()
-{
-}
-
-ObjBPrivate::~ObjBPrivate()
-{
-}
-
-ObjB::ObjB()
-  : d(new ObjBPrivate)
-{
-}
-
-ObjB::~ObjB()
-{
-  delete d;
-}
-
-#include "moc_ObjB.cpp"

+ 0 - 19
Tests/QtAutogen/MocInclude/ObjB.hpp

@@ -1,19 +0,0 @@
-#ifndef ObjB_HPP
-#define ObjB_HPP
-
-#include <QObject>
-
-// Object source comes with a _moc include
-class ObjBPrivate;
-class ObjB : public QObject
-{
-  Q_OBJECT
-public:
-  ObjB();
-  ~ObjB();
-
-private:
-  ObjBPrivate* const d;
-};
-
-#endif

+ 0 - 14
Tests/QtAutogen/MocInclude/ObjB_p.h

@@ -1,14 +0,0 @@
-#ifndef OBJB_P_HPP
-#define OBJB_P_HPP
-
-#include <QObject>
-
-class ObjBPrivate : public QObject
-{
-  Q_OBJECT
-public:
-  ObjBPrivate();
-  ~ObjBPrivate();
-};
-
-#endif

+ 17 - 0
Tests/QtAutogen/MocInclude/Relaxed/CMakeLists.txt

@@ -0,0 +1,17 @@
+# Enable relaxed mode
+set(CMAKE_AUTOMOC_RELAXED_MODE TRUE)
+
+# Common test
+set(COMMON_FUNCTION_NAME commonRelaxed)
+configure_file(
+  "${COM_DIR}/common.cpp.in"
+  "${CMAKE_CURRENT_BINARY_DIR}/commonRelaxed.cpp")
+
+makeExecutable(libRelaxed)
+target_sources(libRelaxed PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/commonRelaxed.cpp"
+  RObjA.cpp
+  RObjB.cpp
+  RObjC.cpp
+  relaxed.cpp
+  )

+ 0 - 0
Tests/QtAutogen/MocIncludeRelaxed/RObjA.cpp → Tests/QtAutogen/MocInclude/Relaxed/RObjA.cpp


+ 0 - 0
Tests/QtAutogen/MocIncludeRelaxed/RObjA.hpp → Tests/QtAutogen/MocInclude/Relaxed/RObjA.hpp


+ 0 - 0
Tests/QtAutogen/MocIncludeRelaxed/RObjB.cpp → Tests/QtAutogen/MocInclude/Relaxed/RObjB.cpp


+ 0 - 0
Tests/QtAutogen/MocIncludeRelaxed/RObjB.hpp → Tests/QtAutogen/MocInclude/Relaxed/RObjB.hpp


+ 0 - 0
Tests/QtAutogen/MocIncludeRelaxed/RObjBExtra.hpp → Tests/QtAutogen/MocInclude/Relaxed/RObjBExtra.hpp


+ 0 - 0
Tests/QtAutogen/MocIncludeRelaxed/RObjC.cpp → Tests/QtAutogen/MocInclude/Relaxed/RObjC.cpp


+ 0 - 0
Tests/QtAutogen/MocIncludeRelaxed/RObjC.hpp → Tests/QtAutogen/MocInclude/Relaxed/RObjC.hpp


+ 21 - 0
Tests/QtAutogen/MocInclude/Relaxed/relaxed.cpp

@@ -0,0 +1,21 @@
+// AUTOMOC relaxed mode objects
+#include "RObjA.hpp"
+#include "RObjB.hpp"
+#include "RObjC.hpp"
+
+// Forward declaration
+bool commonRelaxed();
+
+int main(int argv, char** args)
+{
+  // Common tests
+  if (!commonRelaxed()) {
+    return -1;
+  }
+
+  // Relaxed tests
+  RObjA rObjA;
+  RObjB rObjB;
+  RObjC rObjC;
+  return 0;
+}

+ 0 - 11
Tests/QtAutogen/MocInclude/SObjA.cpp

@@ -1,11 +0,0 @@
-#include "SObjA.hpp"
-
-SObjA::SObjA()
-{
-}
-
-SObjA::~SObjA()
-{
-}
-
-#include "SObjA.moc"

+ 0 - 11
Tests/QtAutogen/MocInclude/SObjB.cpp.in

@@ -1,11 +0,0 @@
-#include "SObjB.hpp"
-
-SObjB::SObjB()
-{
-}
-
-SObjB::~SObjB()
-{
-}
-
-#include "SObjB.moc"

+ 0 - 15
Tests/QtAutogen/MocInclude/SObjB.hpp.in

@@ -1,15 +0,0 @@
-#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

+ 0 - 35
Tests/QtAutogen/MocInclude/SObjC.cpp

@@ -1,35 +0,0 @@
-#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"

+ 0 - 15
Tests/QtAutogen/MocInclude/SObjC.hpp

@@ -1,15 +0,0 @@
-#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

+ 0 - 31
Tests/QtAutogen/MocInclude/SObjCExtra.cpp

@@ -1,31 +0,0 @@
-#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"

+ 0 - 15
Tests/QtAutogen/MocInclude/SObjCExtra.hpp

@@ -1,15 +0,0 @@
-#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

+ 0 - 4
Tests/QtAutogen/MocInclude/SObjCExtra.moc.in

@@ -1,4 +0,0 @@
-
-void SObjCLocalFunction()
-{
-}

+ 14 - 0
Tests/QtAutogen/MocInclude/Strict/CMakeLists.txt

@@ -0,0 +1,14 @@
+# Disable relaxed mode
+set(CMAKE_AUTOMOC_RELAXED_MODE FALSE)
+
+# Common test
+set(COMMON_FUNCTION_NAME commonStrict)
+configure_file(
+  "${COM_DIR}/common.cpp.in"
+  "${CMAKE_CURRENT_BINARY_DIR}/commonStrict.cpp")
+
+makeExecutable(libStrict)
+target_sources(libStrict PRIVATE
+  "${CMAKE_CURRENT_BINARY_DIR}/commonStrict.cpp"
+  strict.cpp
+  )

+ 7 - 0
Tests/QtAutogen/MocInclude/Strict/strict.cpp

@@ -0,0 +1,7 @@
+// Forward declaration
+bool commonStrict();
+
+int main(int argv, char** args)
+{
+  return commonStrict() ? 0 : -1;
+}

+ 9 - 0
Tests/QtAutogen/MocInclude/main.cpp

@@ -0,0 +1,9 @@
+
+// Forward declaration
+bool libStrict();
+bool libRelaxed();
+
+int main(int argv, char** args)
+{
+  return (libStrict() && libRelaxed()) ? 0 : -1;
+}

+ 0 - 71
Tests/QtAutogen/MocInclude/shared.cmake

@@ -1,71 +0,0 @@
-# Test moc include patterns
-include_directories("../MocInclude")
-include_directories(${CMAKE_CURRENT_BINARY_DIR})
-
-# Generate .moc file externally and enabled SKIP_AUTOMOC on the file
-qtx_generate_moc(
-  ${CMAKE_CURRENT_SOURCE_DIR}/../MocInclude/SObjA.hpp
-  ${CMAKE_CURRENT_BINARY_DIR}/SObjA.moc)
-set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/../MocInclude/SObjA.cpp PROPERTY SKIP_AUTOMOC ON)
-
-# Generate .moc file externally from generated source file
-# and enabled SKIP_AUTOMOC on the source file
-add_custom_command(
-  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/SObjB.hpp
-  COMMAND ${CMAKE_COMMAND} -E copy
-    ${CMAKE_CURRENT_SOURCE_DIR}/../MocInclude/SObjB.hpp.in
-    ${CMAKE_CURRENT_BINARY_DIR}/SObjB.hpp)
-add_custom_command(
-  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/SObjB.cpp
-  COMMAND ${CMAKE_COMMAND} -E copy
-    ${CMAKE_CURRENT_SOURCE_DIR}/../MocInclude/SObjB.cpp.in
-    ${CMAKE_CURRENT_BINARY_DIR}/SObjB.cpp)
-qtx_generate_moc(
-  ${CMAKE_CURRENT_BINARY_DIR}/SObjB.hpp
-  ${CMAKE_CURRENT_BINARY_DIR}/SObjB.moc)
-set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/SObjB.cpp PROPERTY SKIP_AUTOMOC ON)
-
-# Generate moc file externally and enabled SKIP_AUTOMOC on the header
-qtx_generate_moc(
-  ${CMAKE_CURRENT_SOURCE_DIR}/../MocInclude/SObjCExtra.hpp
-  ${CMAKE_CURRENT_BINARY_DIR}/SObjCExtra_extMoc.cpp)
-set_property(
-  SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/../MocInclude/SObjCExtra.hpp
-  PROPERTY SKIP_AUTOMOC ON)
-# Custom target to depend on
-set(SOBJC_MOC ${CMAKE_CURRENT_BINARY_DIR}/moc_SObjCExtra.cpp)
-add_custom_target("${MOC_INCLUDE_NAME}_SOBJC"
-  DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/SObjCExtra_extMoc.cpp
-  BYPRODUCTS ${SOBJC_MOC}
-  COMMAND ${CMAKE_COMMAND} -E copy
-    ${CMAKE_CURRENT_SOURCE_DIR}/../MocInclude/SObjCExtra.moc.in
-    ${SOBJC_MOC})
-
-# MOC_INCLUDE_NAME must be defined by the includer
-add_executable(${MOC_INCLUDE_NAME}
-  # Common sources
-  ../MocInclude/ObjA.cpp
-  ../MocInclude/ObjB.cpp
-
-  ../MocInclude/LObjA.cpp
-  ../MocInclude/LObjB.cpp
-
-  ../MocInclude/EObjA.cpp
-  ../MocInclude/EObjAExtra.cpp
-  ../MocInclude/EObjB.cpp
-  ../MocInclude/subExtra/EObjBExtra.cpp
-
-  ../MocInclude/SObjA.cpp
-  ${CMAKE_CURRENT_BINARY_DIR}/SObjA.moc
-  ${CMAKE_CURRENT_BINARY_DIR}/SObjB.cpp
-  ${CMAKE_CURRENT_BINARY_DIR}/SObjB.moc
-  ../MocInclude/SObjC.cpp
-  ../MocInclude/SObjCExtra.hpp
-  ../MocInclude/SObjCExtra.cpp
-
-  ../MocInclude/subGlobal/GObj.cpp
-  main.cpp
-)
-add_dependencies(${MOC_INCLUDE_NAME} "${MOC_INCLUDE_NAME}_SOBJC")
-target_link_libraries(${MOC_INCLUDE_NAME} ${QT_LIBRARIES})
-set_target_properties(${MOC_INCLUDE_NAME} PROPERTIES AUTOMOC ON)

+ 0 - 20
Tests/QtAutogen/MocInclude/subExtra/EObjBExtra.cpp

@@ -1,20 +0,0 @@
-#include "EObjBExtra.hpp"
-#include "EObjBExtra_p.hpp"
-
-EObjBExtraPrivate::EObjBExtraPrivate()
-{
-}
-
-EObjBExtraPrivate::~EObjBExtraPrivate()
-{
-}
-
-EObjBExtra::EObjBExtra()
-  : d(new EObjBExtraPrivate)
-{
-}
-
-EObjBExtra::~EObjBExtra()
-{
-  delete d;
-}

+ 0 - 18
Tests/QtAutogen/MocInclude/subExtra/EObjBExtra.hpp

@@ -1,18 +0,0 @@
-#ifndef EOBJBEXTRA_HPP
-#define EOBJBEXTRA_HPP
-
-#include <QObject>
-
-class EObjBExtraPrivate;
-class EObjBExtra : public QObject
-{
-  Q_OBJECT
-public:
-  EObjBExtra();
-  ~EObjBExtra();
-
-private:
-  EObjBExtraPrivate* const d;
-};
-
-#endif

+ 0 - 14
Tests/QtAutogen/MocInclude/subExtra/EObjBExtra_p.hpp

@@ -1,14 +0,0 @@
-#ifndef EOBJBEXTRA_P_HPP
-#define EOBJBEXTRA_P_HPP
-
-#include <QObject>
-
-class EObjBExtraPrivate : public QObject
-{
-  Q_OBJECT
-public:
-  EObjBExtraPrivate();
-  ~EObjBExtraPrivate();
-};
-
-#endif

+ 0 - 41
Tests/QtAutogen/MocInclude/subGlobal/GObj.cpp

@@ -1,41 +0,0 @@
-#include "GObj.hpp"
-#include "GObj_p.hpp"
-
-namespace subGlobal {
-
-class GObjLocal : public QObject
-{
-  Q_OBJECT
-public:
-  GObjLocal();
-  ~GObjLocal();
-};
-
-GObjLocal::GObjLocal()
-{
-}
-
-GObjLocal::~GObjLocal()
-{
-}
-
-GObjPrivate::GObjPrivate()
-{
-}
-
-GObjPrivate::~GObjPrivate()
-{
-}
-
-GObj::GObj()
-{
-  GObjLocal localObj;
-}
-
-GObj::~GObj()
-{
-}
-}
-
-// For the local QObject
-#include "GObj.moc"

+ 0 - 17
Tests/QtAutogen/MocInclude/subGlobal/GObj.hpp

@@ -1,17 +0,0 @@
-#ifndef GOBJ_HPP
-#define GOBJ_HPP
-
-#include <QObject>
-
-namespace subGlobal {
-
-class GObj : public QObject
-{
-  Q_OBJECT
-public:
-  GObj();
-  ~GObj();
-};
-}
-
-#endif

+ 0 - 17
Tests/QtAutogen/MocInclude/subGlobal/GObj_p.hpp

@@ -1,17 +0,0 @@
-#ifndef GOBJ_P_HPP
-#define GOBJ_P_HPP
-
-#include <QObject>
-
-namespace subGlobal {
-
-class GObjPrivate : public QObject
-{
-  Q_OBJECT
-public:
-  GObjPrivate();
-  ~GObjPrivate();
-};
-}
-
-#endif

+ 0 - 20
Tests/QtAutogen/MocIncludeRelaxed/CMakeLists.txt

@@ -1,20 +0,0 @@
-cmake_minimum_required(VERSION 3.10)
-project(MocIncludeRelaxed)
-include("../AutogenCoreTest.cmake")
-
-# Test moc include patterns
-set(CMAKE_AUTOMOC_RELAXED_MODE TRUE)
-
-# Shared executable
-set(MOC_INCLUDE_NAME "mocIncludeRelaxed")
-include(${CMAKE_CURRENT_SOURCE_DIR}/../MocInclude/shared.cmake)
-
-# Relaxed only executable
-add_executable(mocIncludeRelaxedOnly
-  RObjA.cpp
-  RObjB.cpp
-  RObjC.cpp
-  RMain.cpp
-)
-target_link_libraries(mocIncludeRelaxedOnly ${QT_LIBRARIES})
-set_target_properties(mocIncludeRelaxedOnly PROPERTIES AUTOMOC ON)

+ 0 - 12
Tests/QtAutogen/MocIncludeRelaxed/RMain.cpp

@@ -1,12 +0,0 @@
-// Relaxed AUTOMOC objects
-#include "RObjA.hpp"
-#include "RObjB.hpp"
-#include "RObjC.hpp"
-
-int main(int argv, char** args)
-{
-  RObjA rObjA;
-  RObjB rObjB;
-  RObjC rObjC;
-  return 0;
-}

+ 0 - 26
Tests/QtAutogen/MocIncludeRelaxed/main.cpp

@@ -1,26 +0,0 @@
-#include "EObjA.hpp"
-#include "EObjB.hpp"
-#include "LObjA.hpp"
-#include "LObjB.hpp"
-#include "ObjA.hpp"
-#include "ObjB.hpp"
-#include "SObjA.hpp"
-#include "SObjB.hpp"
-#include "subGlobal/GObj.hpp"
-
-int main(int argv, char** args)
-{
-  subGlobal::GObj gObj;
-  ObjA objA;
-  ObjB objB;
-  LObjA lObjA;
-  LObjB lObjB;
-  EObjA eObjA;
-  EObjB eObjB;
-  SObjA sObjA;
-  SObjB sObjB;
-  return 0;
-}
-
-// Header in global subdirectory
-#include "subGlobal/moc_GObj.cpp"

+ 0 - 10
Tests/QtAutogen/MocIncludeStrict/CMakeLists.txt

@@ -1,10 +0,0 @@
-cmake_minimum_required(VERSION 3.10)
-project(MocIncludeStrict)
-include("../AutogenCoreTest.cmake")
-
-# Test moc include patterns
-set(CMAKE_AUTOMOC_RELAXED_MODE FALSE)
-
-# Shared executable
-set(MOC_INCLUDE_NAME "mocIncludeStrict")
-include(${CMAKE_CURRENT_SOURCE_DIR}/../MocInclude/shared.cmake)

+ 0 - 26
Tests/QtAutogen/MocIncludeStrict/main.cpp

@@ -1,26 +0,0 @@
-#include "EObjA.hpp"
-#include "EObjB.hpp"
-#include "LObjA.hpp"
-#include "LObjB.hpp"
-#include "ObjA.hpp"
-#include "ObjB.hpp"
-#include "SObjA.hpp"
-#include "SObjB.hpp"
-#include "subGlobal/GObj.hpp"
-
-int main(int argv, char** args)
-{
-  subGlobal::GObj gObj;
-  ObjA objA;
-  ObjB objB;
-  LObjA lObjA;
-  LObjB lObjB;
-  EObjA eObjA;
-  EObjB eObjB;
-  SObjA sObjA;
-  SObjB sObjB;
-  return 0;
-}
-
-// Header in global subdirectory
-#include "subGlobal/moc_GObj.cpp"

+ 1 - 2
Tests/QtAutogen/Tests.cmake

@@ -32,8 +32,7 @@ ADD_AUTOGEN_TEST(UicSkipSource)
 
 if(QT_TEST_ALLOW_QT_MACROS)
   ADD_AUTOGEN_TEST(MocCMP0071)
-  ADD_AUTOGEN_TEST(MocIncludeRelaxed mocIncludeRelaxed)
-  ADD_AUTOGEN_TEST(MocIncludeStrict mocIncludeStrict)
+  ADD_AUTOGEN_TEST(MocInclude)
   ADD_AUTOGEN_TEST(MocSkipSource)
 endif()