浏览代码

Autogen: Tests: Separate StaticLibraryCycle test

Sebastian Holtermann 8 年之前
父节点
当前提交
6ce6fd426e

+ 0 - 4
Tests/QtAutogen/CMakeLists.txt

@@ -59,10 +59,6 @@ if(NON_ASCII_BDIR AND WIN32)
   set(ALLOW_WRAP_CPP FALSE)
   set(ALLOW_WRAP_CPP FALSE)
 endif()
 endif()
 
 
-# -- Test
-# Tests static library cycles
-add_subdirectory(staticLibraryCycle)
-
 # -- Test
 # -- Test
 # Complex test case
 # Complex test case
 add_subdirectory(complex)
 add_subdirectory(complex)

+ 1 - 0
Tests/QtAutogen/CommonTests.cmake

@@ -29,3 +29,4 @@ if(APPLE AND (NOT QT_TEST_VERSION STREQUAL 4))
   ADD_AUTOGEN_TEST(MacOsFW)
   ADD_AUTOGEN_TEST(MacOsFW)
 endif()
 endif()
 ADD_AUTOGEN_TEST(SameName sameName)
 ADD_AUTOGEN_TEST(SameName sameName)
+ADD_AUTOGEN_TEST(StaticLibraryCycle slc)

+ 5 - 2
Tests/QtAutogen/staticLibraryCycle/CMakeLists.txt → Tests/QtAutogen/StaticLibraryCycle/CMakeLists.txt

@@ -1,5 +1,8 @@
-# Test AUTOMOC and AUTORCC on source files with the same name
-# but in different subdirectories
+cmake_minimum_required(VERSION 3.10)
+project(StaticLibraryCycle)
+include("../AutogenTest.cmake")
+
+# Test AUTOMOC on cyclic static libraries
 
 
 set(CMAKE_AUTOMOC ON)
 set(CMAKE_AUTOMOC ON)
 
 

+ 12 - 0
Tests/QtAutogen/StaticLibraryCycle/a.cpp

@@ -0,0 +1,12 @@
+#include "a.h"
+#include "b.h"
+
+bool A::recursed = false;
+
+A::A()
+{
+  if (!A::recursed) {
+    A::recursed = true;
+    B b;
+  }
+}

+ 2 - 0
Tests/QtAutogen/staticLibraryCycle/a.h → Tests/QtAutogen/StaticLibraryCycle/a.h

@@ -6,6 +6,8 @@
 class A : public QObject
 class A : public QObject
 {
 {
   Q_OBJECT
   Q_OBJECT
+  static bool recursed;
+
 public:
 public:
   A();
   A();
 };
 };

+ 0 - 0
Tests/QtAutogen/staticLibraryCycle/b.cpp → Tests/QtAutogen/StaticLibraryCycle/b.cpp


+ 0 - 0
Tests/QtAutogen/staticLibraryCycle/b.h → Tests/QtAutogen/StaticLibraryCycle/b.h


+ 0 - 0
Tests/QtAutogen/staticLibraryCycle/c.cpp → Tests/QtAutogen/StaticLibraryCycle/c.cpp


+ 0 - 0
Tests/QtAutogen/staticLibraryCycle/c.h → Tests/QtAutogen/StaticLibraryCycle/c.h


+ 0 - 0
Tests/QtAutogen/staticLibraryCycle/main.cpp → Tests/QtAutogen/StaticLibraryCycle/main.cpp


+ 0 - 7
Tests/QtAutogen/staticLibraryCycle/a.cpp

@@ -1,7 +0,0 @@
-#include "a.h"
-#include "b.h"
-
-A::A()
-{
-  B b;
-}