summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2017-12-08 19:22:27 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2017-12-13 12:50:18 (GMT)
commit6ce6fd426ee7649a40c2f253dbc5f814650f0992 (patch)
treecac6840f845f60df35ed21f7bb8c739006cb01a1 /Tests
parent45b6776ab301f4b5ec51e27863ffe061b1a0d60a (diff)
downloadCMake-6ce6fd426ee7649a40c2f253dbc5f814650f0992.zip
CMake-6ce6fd426ee7649a40c2f253dbc5f814650f0992.tar.gz
CMake-6ce6fd426ee7649a40c2f253dbc5f814650f0992.tar.bz2
Autogen: Tests: Separate StaticLibraryCycle test
Diffstat (limited to 'Tests')
-rw-r--r--Tests/QtAutogen/CMakeLists.txt4
-rw-r--r--Tests/QtAutogen/CommonTests.cmake1
-rw-r--r--Tests/QtAutogen/StaticLibraryCycle/CMakeLists.txt (renamed from Tests/QtAutogen/staticLibraryCycle/CMakeLists.txt)7
-rw-r--r--Tests/QtAutogen/StaticLibraryCycle/a.cpp12
-rw-r--r--Tests/QtAutogen/StaticLibraryCycle/a.h (renamed from Tests/QtAutogen/staticLibraryCycle/a.h)2
-rw-r--r--Tests/QtAutogen/StaticLibraryCycle/b.cpp (renamed from Tests/QtAutogen/staticLibraryCycle/b.cpp)0
-rw-r--r--Tests/QtAutogen/StaticLibraryCycle/b.h (renamed from Tests/QtAutogen/staticLibraryCycle/b.h)0
-rw-r--r--Tests/QtAutogen/StaticLibraryCycle/c.cpp (renamed from Tests/QtAutogen/staticLibraryCycle/c.cpp)0
-rw-r--r--Tests/QtAutogen/StaticLibraryCycle/c.h (renamed from Tests/QtAutogen/staticLibraryCycle/c.h)0
-rw-r--r--Tests/QtAutogen/StaticLibraryCycle/main.cpp (renamed from Tests/QtAutogen/staticLibraryCycle/main.cpp)0
-rw-r--r--Tests/QtAutogen/staticLibraryCycle/a.cpp7
11 files changed, 20 insertions, 13 deletions
diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt
index 47164d2..833f64e 100644
--- a/Tests/QtAutogen/CMakeLists.txt
+++ b/Tests/QtAutogen/CMakeLists.txt
@@ -60,9 +60,5 @@ if(NON_ASCII_BDIR AND WIN32)
endif()
# -- Test
-# Tests static library cycles
-add_subdirectory(staticLibraryCycle)
-
-# -- Test
# Complex test case
add_subdirectory(complex)
diff --git a/Tests/QtAutogen/CommonTests.cmake b/Tests/QtAutogen/CommonTests.cmake
index 7f72386..29bc4af 100644
--- a/Tests/QtAutogen/CommonTests.cmake
+++ b/Tests/QtAutogen/CommonTests.cmake
@@ -29,3 +29,4 @@ if(APPLE AND (NOT QT_TEST_VERSION STREQUAL 4))
ADD_AUTOGEN_TEST(MacOsFW)
endif()
ADD_AUTOGEN_TEST(SameName sameName)
+ADD_AUTOGEN_TEST(StaticLibraryCycle slc)
diff --git a/Tests/QtAutogen/staticLibraryCycle/CMakeLists.txt b/Tests/QtAutogen/StaticLibraryCycle/CMakeLists.txt
index 144a435..0c2f987 100644
--- a/Tests/QtAutogen/staticLibraryCycle/CMakeLists.txt
+++ b/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)
diff --git a/Tests/QtAutogen/StaticLibraryCycle/a.cpp b/Tests/QtAutogen/StaticLibraryCycle/a.cpp
new file mode 100644
index 0000000..faa52e6
--- /dev/null
+++ b/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;
+ }
+}
diff --git a/Tests/QtAutogen/staticLibraryCycle/a.h b/Tests/QtAutogen/StaticLibraryCycle/a.h
index 7176170..f24398e 100644
--- a/Tests/QtAutogen/staticLibraryCycle/a.h
+++ b/Tests/QtAutogen/StaticLibraryCycle/a.h
@@ -6,6 +6,8 @@
class A : public QObject
{
Q_OBJECT
+ static bool recursed;
+
public:
A();
};
diff --git a/Tests/QtAutogen/staticLibraryCycle/b.cpp b/Tests/QtAutogen/StaticLibraryCycle/b.cpp
index a807d89..a807d89 100644
--- a/Tests/QtAutogen/staticLibraryCycle/b.cpp
+++ b/Tests/QtAutogen/StaticLibraryCycle/b.cpp
diff --git a/Tests/QtAutogen/staticLibraryCycle/b.h b/Tests/QtAutogen/StaticLibraryCycle/b.h
index ededbd8..ededbd8 100644
--- a/Tests/QtAutogen/staticLibraryCycle/b.h
+++ b/Tests/QtAutogen/StaticLibraryCycle/b.h
diff --git a/Tests/QtAutogen/staticLibraryCycle/c.cpp b/Tests/QtAutogen/StaticLibraryCycle/c.cpp
index 7d427c2..7d427c2 100644
--- a/Tests/QtAutogen/staticLibraryCycle/c.cpp
+++ b/Tests/QtAutogen/StaticLibraryCycle/c.cpp
diff --git a/Tests/QtAutogen/staticLibraryCycle/c.h b/Tests/QtAutogen/StaticLibraryCycle/c.h
index 20f3725..20f3725 100644
--- a/Tests/QtAutogen/staticLibraryCycle/c.h
+++ b/Tests/QtAutogen/StaticLibraryCycle/c.h
diff --git a/Tests/QtAutogen/staticLibraryCycle/main.cpp b/Tests/QtAutogen/StaticLibraryCycle/main.cpp
index f5b7fd2..f5b7fd2 100644
--- a/Tests/QtAutogen/staticLibraryCycle/main.cpp
+++ b/Tests/QtAutogen/StaticLibraryCycle/main.cpp
diff --git a/Tests/QtAutogen/staticLibraryCycle/a.cpp b/Tests/QtAutogen/staticLibraryCycle/a.cpp
deleted file mode 100644
index 97cc66e..0000000
--- a/Tests/QtAutogen/staticLibraryCycle/a.cpp
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "a.h"
-#include "b.h"
-
-A::A()
-{
- B b;
-}